Function font

  • CSS mixin for defining a set of font style related rules. All numbers default to rem unit.

    Example

    font('Roboto', '16px') // Returns...
    
    {
    font-family: 'Roboto';
    font-size: 16px,
    font-style: normal,
    font-weight: 400,
    font-variant: normal;
    line-height: normal;
    letter-spacing: normal;
    }

    Parameters

    • family: string

      Font family.

    • size: string | number = '1.6rem'

      Font size. If the value specified is a number, the associated unit will be 'rem'.

    • weight: FontWeight = fontWeights.normal

      Font weight.

    • style: FontStyle = 'normal'

      Font style.

    • lineHeight: LineHeight = 'normal'

      Line height. If the value specified is a number, the associated unit will be 'rem'.

    • letterSpacing: LetterSpacing = 'normal'

      Letter spacing. If the value specified is a number, the associated unit will be 'rem'.

    • variant: FontVariant = 'normal'

      Font variant.

    Returns string

    Generated CSS rules.