fontSize

The license could not be verified: License Certificate has expired!

How to get fontSize

import { fontSize } from 'fds/system';

Type: Function

A styling mixin which sets the "font-size" and "line-height" of an element based on the specified name.

Arguments

# Name Type Description
1. name String

The name of the font size to render the textual content of the component in. This will set the "font-size" and "line-height" CSS properties based on a predefined set of values. Each font size represents a certain use case in which it should be implemented, which is described below.

Can be one of:

  • s: a small (regular) font size, used for compact text (like in Tooltip).

  • m: the regular content font size.

  • heading-level-4: the font size for a heading with level 4 (smallest heading).

  • heading-level-3: the font size for a heading with level 3.

  • heading-level-2: the font size for a heading with level 2.

  • heading-level-1: the font size for a heading with level 1 (largest heading).

  • inherit: derive the font size from the parent element.

Returns

Type: String

A style rule resulting in a generated class name on the element.

Generally created using fds/system/applyCss and/or any styling utility provided by FDS.

Was this page helpful?