Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BorderWidth

Provides a set of width values that can be used as constants for style mixins or used directly for static styles. The default base is the default 2. This provides a sensible default for most styling purposes. The width values can be customised by changing the scale and base option values.

example
Change the scaling between divisions ```ts import { BorderWidth } from '@ef-carbon/react-native-style'; const width = new BorderWidth({ base: 4, scale: 4}); console.log(width.tiny); // 0.015625 console.log(width.smallest); // 0.0625 console.log(width.smaller); // 0.25 console.log(width.small); // 1 console.log(width.normal); // 4 console.log(width.large); // 16 console.log(width.larger); // 128 console.log(width.largest); // 512 console.log(width.huge); // 2048 ````
example
Customise the divisions ```ts import { BorderWidth } from '@ef-carbon/react-native-style'; const width = new BorderWidth({ scale: 2, { 300: 3 500: 8, 700: 25 }}); console.log(width.tiny); // 0.5 console.log(width.smallest); // 1 console.log(width.smaller); // 3 (usually 2) console.log(width.small); // 4 console.log(width.normal); // 8 console.log(width.large); // 16 console.log(width.larger); // 25 (usually 32) console.log(width.largest); // 64 console.log(width.huge); // 128 ````

Hierarchy

Implements

Index

Constructors

constructor

  • new BorderWidth(__namedParameters?: object): BorderWidth

Accessors

100

  • get 100(): number

200

  • get 200(): number

300

  • get 300(): number

400

  • get 400(): number

500

  • get 500(): number

600

  • get 600(): number

700

  • get 700(): number

800

  • get 800(): number

900

  • get 900(): number

huge

  • get huge(): number

large

  • get large(): number

larger

  • get larger(): number

largest

  • get largest(): number

normal

  • get normal(): number

small

  • get small(): number

smaller

  • get smaller(): number

smallest

  • get smallest(): number

tiny

  • get tiny(): number

Methods

__@toPrimitive

  • __@toPrimitive(hint: "string" | "number" | "default"): number | string