Typography

Ready
warning
Use this component only if all other Halstack Design System components for adding text DO NOT meet your requirements. This component should always be the LAST OPTION to use.

Font family

For our sans-serif font-family, we use the humanist typeface Open Sans, designed by Steve Matteson and licensed under the Apache License, Version 2.0.

TokenDescriptionPropertyValue
font-family-sansDefault font family sans-seriffont-family'Open Sans', sans-serif
font-family-monoDefault font family monospacedfont-familySource Code Pro', monospace

Weight

In order to add contrast between typographic elements in the UI, Halstack uses four different and well balanced font-weight values.

TokenDescriptionPropertyValue
font-weight-lightSet font weight as light (300)font-weight300
font-weight-regularSet font weight as regular (400)font-weight400
font-weight-semiboldSet font weight as semibold (600)font-weight600
font-weight-boldSet font weight as bold (700)font-weight700

Scale

As we approached the foundational elements with simplification and standardization in mind, the typographic scale is one of the most important elements to create hierarchy. Our type scale provides eight relative values based on a root font size of 16px, making it scalable and accessible.

TokenDescriptionPropertyValue (rem)
font-scale-01Set the font size as 12pxfont-size0.75
font-scale-02Set the font size as 14pxfont-size0.875
font-scale-03Set the font size as 16pxfont-size1
font-scale-04Set the font size as 20pxfont-size1.25
font-scale-05Set the font size as 24pxfont-size1.5
font-scale-06Set the font size as 32pxfont-size2
font-scale-07Set the font size as 48pxfont-size3
font-scale-08Set the font size as 60pxfont-size3.75

Formatting

Style

TokenDescriptionPropertyValue
font-style-italicSet font style as italicfont-styleitalic
font-style-normalSet font style as normalfont-stylenormal

Letter spacing

We calibrate our letter-spacing at large scales to provide a better legibility and readability of our text.

TokenDescriptionPropertyValue(em)
font-tracking-tight-02Set letter spacing as -0.025emletter-spacing-0.025
font-tracking-tight-01Set letter spacing as -0.0125emletter-spacing-0.0125
font-tracking-normalSet letter spacing as 0emletter-spacing0
font-tracking-wide-01Set letter spacing as 0.025emletter-spacing0.025
font-tracking-wide-02Set letter spacing as 0.05emletter-spacing0.05
font-tracking-wide-03Set letter spacing as 0.1emletter-spacing0.1

Leading

We use a ratio of 1:1.5 as a standard line-height value. A body font of 16px (1rem) returns a value of 24px (1.5rem), which is the main reference measurement for the vertical organization.

TokenDescriptionPropertyValue(em)
font-leading-compact-03Set line height as 1emline-height1
font-leading-compact-02Set line height as 1.25emline-height1.25
font-leading-compact-01Set line height as 1.365emline-height1.365
font-leading-normalSet line height as 1.5emline-height1.5
font-leading-loose-01Set line height as 1.715emline-height1.715
font-leading-loose-02Set line height as 2emline-height2

Capitalization

TokenDescriptionPropertyValue
font-transform-initialPreserve default valuetext-transforminitial
font-transform-lowercaseTransform text to lowercasetext-transformlowercase
font-transform-uppercaseTransform text to uppercasetext-transformuppercase

Text decoration

TokenDescriptionPropertyValue
font-decoration-no-lineUnset all present decorationstext-decorationnone
font-decoration-underlineUnderline the texttext-decorationunderline
font-decoration-line-throughPut a strikethrough the texttext-decorationline-through

Text align

TokenDescriptionPropertyValue
text-align-centerCenters the text.text-aligncenter
text-align-rightAlign the text to the right.text-alignright
text-align-leftAlign the text to the left.text-alignleft

Display

TokenDescriptionPropertyValue
display-blockDisplays an element as a block element.displayblock
display-inlineDisplays an element as an inline element.displayinline

Text overflow

TokenDescriptionPropertyValue
text-overflow-clipThe text is clipped and not accessible.text-overflowclip
text-overflow-ellipsisRender an ellipsis ("...") to represent the clipped text.text-overflowellipsis
text-overflow-unsetSet the property as unset.text-overflowunset

White space

TokenDescriptionPropertyValue
text-whiteSpace-preWhitespace is preserved by the browser. Text will only wrap on line breaks.white-spacepre
text-whiteSpace-normalSequences of whitespace will collapse into a single whitespace. Text will wrap when necessary.white-spacenormal
text-whiteSpace-nowrapSequences of whitespace will collapse into a single whitespace. Text will never wrap to the next line. The text continues on the same line until a 'br' tag is encountered.white-spacenowrap
text-whiteSpace-pre-lineSequences of whitespace will collapse into a single whitespace. Text will wrap when necessary, and on line breaks.white-spacepre-line
text-whiteSpace-pre-wrapWhitespace is preserved by the browser. Text will wrap when necessary, and on line breaks.white-spacepre-wrap

Accessibility

WCAG