Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Constants

The constants class provides an implementation of the IConstants interface. It is a nested tree of classes the have a set of sane default values for the constants. The constants can be overridden by providing the nested classes as options to the constants. `ts import { Constants, Border, Spacing, Font, Colours, Opacity, Timing, Animation, Safe, Theme, } from '@ef-carbon/react-native-style';

// These classes can also all be customised const font = new Font(); const border = new Border({ base: { radius: this.font.size.normal / 2 } }); const spacing = new Spacing({ base: this.font.size.normal }); const colour = new Colours(); const opacity = new Opacity(); const timing = new Timing(); const animation = new Animation(); const safe = new Safe();

// Bundle up the constants const class = new Constants({ font, border, spacing, colour, opacity, timing, animation, safe, });

const theme = new Theme({ base: 'blue', constants }); `

see

Font

see

Border

see

Spacing

see

Colours

see

Opacity

see

Timing

see

Animation

see

Safe

Hierarchy

  • Constants

Implements

Index

Constructors

constructor

  • new Constants(__namedParameters?: object): Constants

Properties

animation

animation: Readonly<IAnimation>

border

border: Readonly<IBorder>

colour

colour: Readonly<IColours>

font

font: Readonly<IFont>

opacity

opacity: Readonly<IOpacity>

safe

safe: Readonly<ISafe>

spacing

spacing: Readonly<ISpacing>

timing

timing: Readonly<ITiming>