Typography

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.

PropertyDescriptionCore tokenValue
font-familyDefault font family sans-seriffont-family-sans'Open Sans', sans-serif
font-familyDefault font family monospacedfont-family-monoSource 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.

PropertyDescriptionCore tokenValue
font-weightSet font weight as light (300)font-weight-light300
font-weightSet font weight as regular (400)font-weight-regular400
font-weightSet font weight as semibold (600)font-weight-semibold600
font-weightSet font weight as bold (700)font-weight-bold700

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.

PropertyDescriptionCore tokenValue (rem)
font-sizeSet the font size as 12pxfont-scale-010.75
font-sizeSet the font size as 14pxfont-scale-020.875
font-sizeSet the font size as 16pxfont-scale-031
font-sizeSet the font size as 20pxfont-scale-041.25
font-sizeSet the font size as 24pxfont-scale-051.5
font-sizeSet the font size as 32pxfont-scale-062
font-sizeSet the font size as 48pxfont-scale-073
font-sizeSet the font size as 60pxfont-scale-083.75

Formatting

Style

PropertyDescriptionCore tokenValue
font-styleSet font style as italicfont-style-italicitalic
font-styleSet font style as normalfont-style-normalnormal

Letter spacing

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

PropertyDescriptionCore tokenValue(em)
letter-spacingSet letter spacing as -0.025emfont-tracking-tight-02-0.025
letter-spacingSet letter spacing as -0.0125emfont-tracking-tight-01-0.0125
letter-spacingSet letter spacing as 0emfont-tracking-normal0
letter-spacingSet letter spacing as 0.025emfont-tracking-wide-010.025
letter-spacingSet letter spacing as 0.05emfont-tracking-wide-020.05
letter-spacingSet letter spacing as 0.1emfont-tracking-wide-030.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.

PropertyDescriptionCore tokenValue(em)
line-heightSet line height as 1emfont-leading-compact-031
line-heightSet line height as 1.25emfont-leading-compact-021.25
line-heightSet line height as 1.365emfont-leading-compact-011.365
line-heightSet line height as 1.5emfont-leading-normal1.5
line-heightSet line height as 1.715emfont-leading-loose-011.715
line-heightSet line height as 2emfont-leading-loose-022

Capitalization

PropertyDescriptionCore tokenValue
text-transformPreserve default valuefont-transform-initialinitial
text-transformTransform text to lowercasefont-transform-lowercaselowercase
text-transformTransform text to uppercasefont-transform-uppercaseuppercase

Text decoration

PropertyDescriptionCore tokenValue
text-decorationUnset all present decorationsfont-decoration-no-linenone
text-decorationUnderline the textfont-decoration-underlineunderline
text-decorationPut a strikethrough the textfont-decoration-line-throughline-through

Text align

PropertyDescriptionCore tokenValue
text-alignCenters the text.text-align-centercenter
text-alignAlign the text to the right.text-align-rightright
text-alignAlign the text to the left.text-align-leftleft

Display

PropertyDescriptionCore tokenValue
displayDisplays an element as a block element.display-blockblock
displayDisplays an element as an inline element.display-inlineinline

Text overflow

PropertyDescriptionCore tokenValue
text-overflowThe text is clipped and not accessible.text-overflow-clipclip
text-overflowRender an ellipsis ("...") to represent the clipped text.text-overflow-ellipsisellipsis
text-overflowSet the property as unset.text-overflow-unsetunset

White space

PropertyDescriptionCore tokenValue
white-spaceWhitespace is preserved by the browser. Text will only wrap on line breaks.text-whiteSpace-prepre
white-spaceSequences of whitespace will collapse into a single whitespace. Text will wrap when necessary.text-whiteSpace-normalnormal
white-spaceSequences 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.text-whiteSpace-nowrapnowrap
white-spaceSequences of whitespace will collapse into a single whitespace. Text will wrap when necessary, and on line breaks.text-whiteSpace-pre-linepre-line
white-spaceWhitespace is preserved by the browser. Text will wrap when necessary, and on line breaks.text-whiteSpace-pre-wrappre-wrap

Accessibility

WCAG