Skip to main content

Typography

Our typographical subsystem helps you to create a consistent, flexible typographic style for your application. Design tokens for font family, font size, [line height], and [font weight] give you a granular way to customize type, and our typeset convention gives you a flexible and easy way to apply and define composed sets of typographic properties.

Typesets

A typeset is a composed set of typographical styles that are used for specific purposes. We include three categories of typesets to be used with body text, UI text, and headings. All three come in a variety of sizing variants, but you can also define your own typesets as needed.

The default typeset, which is used as the default body typeset, utilizes all base tokens.

The default typeset
@use '@wwnds/core' as nds;

.my-selector {
@include nds.typeset;
}

// CSS output
// .my-selector {
// font-family: var(--nds-font-family-base);
// font-size: var(--nds-font-size-base);
// line-height: var(--nds-line-height-base);
// }

Body Typesets

Used for content, the body typesets are typically set at the document body to define the defaults for most content. They always use a font family of font-family-base and a line height of line-height-base.

body-xsbody-smbody-mdbody-lg
Lorem ipsum dolor sit, amet consectetur adipisicing elit.
Lorem ipsum dolor sit, amet consectetur adipisicing elit.
Lorem ipsum dolor sit, amet consectetur adipisicing elit.
Lorem ipsum dolor sit, amet consectetur adipisicing elit.

Additionally, the body-base typeset uses the base font size token (font-size-base).

UI Typesets

Used for user interface elements where text doesn't typically reflow, the UI typesets have a smaller default line height than body typesets. They always use a font family of font-family-base and a line height of line-height-3.

ui-xsui-smui-mdui-lg
Lorem ipsum dolor sit, amet consectetur adipisicing elit.
Lorem ipsum dolor sit, amet consectetur adipisicing elit.
Lorem ipsum dolor sit, amet consectetur adipisicing elit.
Lorem ipsum dolor sit, amet consectetur adipisicing elit.

Additionally, the ui-base typeset uses the base font size token (font-size-base).

Heading Typesets

Used to convey hierarchy, the heading typesets create greater vertical separation while still adhering to a consistent vertical rhythm.

HeadingExample
heading-1
Lorem ipsum dolor sit
heading-2
Lorem ipsum dolor sit
heading-3
Lorem ipsum dolor sit
heading-4
Lorem ipsum dolor sit
heading-5
Lorem ipsum dolor sit
heading-6
Lorem ipsum dolor sit

Font Family

Our font family system provides design tokens for sans serif, serif, and monospace font family types, all defaulting to their respective system stack. System stack defaults help us keep the size of the design system down while ensuring that all devices use a font that looks good on that device.

To customize the font family and ensure a more consistent typographic experience for your users, simply override the font family design tokens.

TokenCustomizableUsage
font-family-system-sansnoa sans serif system font stack
font-family-system-serifnoa serif system font stack
font-family-system-mononoa monospace system font stack
font-family-sansyesthe main sans serif font family
font-family-serifyesthe main serif font family
font-family-monoyesthe main monospace font family
font-family-baseyesthe main font family that will be used throughout your application
font-family-headingsyesthe font family that will be used for headings

Usage Examples

Use a font family token
@use '@wwnds/core' as nds;

.my-serif-selector {
font-family: var(--nds-font-family-serif);
}
Set custom serif font as base
@use '@wwnds/core' with (
$font-family-serif: 'Lora',
$font-family-base: var(--nds-font-family-serif),
);

// --nds-font-family-base will resolve to "'Lora', var(--nds-font-family-system-serif)"

Font Size

The main way to control font sizing in the Norton Design System is with the font size role tokens. These tokens capture the base font size for your content, sizes suitable to convey hierarchy (in other words: headings), and a small subset of t-shirt sizes to help create a consistent sense of scale for typography in your application.

Role TokenDefault valuePx equivalent1
font-size-basefont-size-md16px
font-size-xsfont-size-1212px
font-size-smfont-size-1414px
font-size-mdfont-size-1616px
font-size-lgfont-size-1818px
font-size-h1font-size-3232px
font-size-h2font-size-2424px
font-size-h3font-size-2020px
font-size-h4font-size-1818px
font-size-h5font-size-1616px
font-size-h6font-size-1414px

Font size system tokens form the basis of the font sizing system. Note that these cannot be modified and always use rem units to ensure that the user is in charge of text size.

System TokenValuePx equivalent1
font-size-100.625rem10px
font-size-120.75rem12px
font-size-140.875em14px
font-size-161rem16px
font-size-181.125rem18px
font-size-201.25rem20px
font-size-241.5rem24px
font-size-322rem32px
font-size-402.5rem40px
font-size-483rem48px

Usage Examples

Using a font size token
@use '@wwnds/core' as nds;

.my-large-text {
font-size: var(--nds-font-size-lg);
}
Use larger font sizes across your application
@use '@wwnds/core' with (
$font-size-xs: var(--nds-font-size-14),
$font-size-sm: var(--nds-font-size-16),
$font-size-md: var(--nds-font-size-18),
$font-size-lg: var(--nds-font-size-20),
);

// --nds-font-size-base is still equal to var(--nds-font-size-md),
// making the base font size equivalent to 18px

Footnotes

  1. Since all font sizes are set as rem, the computed pixel equivalent assumes a browser font size of 16px. 2