Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Font

The font class provides Constants that provide common font style values.

example
Using the values ```ts import { TextStyle } from 'react-native'; import { font } from '@Ef-carbon/react-native-style'; const style: TextStyle = { fontSize: font.size.normal, fontWeight: font.weight.normal, fontFamily: font.family.normal, letterSpacing: font.letterSpacing, lineHeight: font.size.normal * font.lineHeight, }; ```
see

FontSize

see

FontWeight

see

FontFamily

see

{@link fontLetterSpacing}

see

{@link fontLineHeight}

example
Using the mixins ```ts import { TextStyle } from 'react-native'; import { Theme } from '@Ef-carbon/react-native-style'; const theme = new Theme({ base: 'blue' }); const style: TextStyle = { ...theme.font.primary, }; ```
see

ThemeFont

see

Theme

Hierarchy

Implements

Index

Constructors

constructor

  • new Font(__namedParameters?: object): Font
  • Parameters

    • Default value __namedParameters: object = {}
      • family: undefined | IFontFamily<string>
      • letterSpacing: undefined | number
      • lineHeight: undefined | number
      • size: undefined | IFontSize
      • weight: undefined | IFontWeight<"100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900">

    Returns Font

Properties

family

family: Readonly<IFamily>

letterSpacing

letterSpacing: number

lineHeight

lineHeight: number

size

size: Readonly<ISize>

weight

weight: Readonly<IWeight>