Typography
Our design system provides a comprehensive set of typography styles and color utilities to ensure consistency and readability across all applications. You can apply these styles using predefined CSS classes or by directly leveraging the underlying CSS custom properties (variables) for more granular control.
Core Typography Styles
We offer a range of typography presets, each designed for specific use-cases, from large display headings to fine print helper text. These presets define font-family
, font-size
, font-weight
, line-height
, and letter-spacing
.
Applying Core Styles
There are two primary ways to apply these core typography styles:
- Using CSS Helper Classes: Apply the relevant
lmn-typography-*
class directly to your HTML element. - Using CSS Custom Properties (Variables): For custom components or more complex scenarios, you can use the underlying CSS variables to construct your own styles.
Below is a detailed list of available core styles:
Display Styles
Used for prominent, attention-grabbing text, typically at the top of a page or section.
Name | CSS Class | Example Usage (Class) |
---|---|---|
Display 1 | .lmn-typography-display-1 | <h1 class="lmn-typography-display-1">...</h1> |
Display 2 | .lmn-typography-display-2 | <h1 class="lmn-typography-display-2">...</h1> |
Display 3 | .lmn-typography-display-3 | <h1 class="lmn-typography-display-3">...</h1> |
Display 4 | .lmn-typography-display-4 | <h1 class="lmn-typography-display-4">...</h1> |
Display 5 | .lmn-typography-display-5 | <h2 class="lmn-typography-display-5">...</h2> |
Display 6 | .lmn-typography-display-6 | <h2 class="lmn-typography-display-6">...</h2> |
Display 7 | .lmn-typography-display-7 | <h2 class="lmn-typography-display-7">...</h2> |
Display 8 | .lmn-typography-display-8 | <h2 class="lmn-typography-display-8">...</h2> |
CSS Variables for Display Styles:
For each preset (e.g., display-1
), the following CSS variables are available:
--lmn-global-typography-display-1-family
--lmn-global-typography-display-1-size
--lmn-global-typography-display-1-weight
--lmn-global-typography-display-1-line-height
--lmn-global-typography-display-1-letter-spacing
(Replace display-1
with display-2
, display-3
, etc., for other display styles)
Example Usage (Variables):
.my-custom-hero-heading {
font-family: var(--lmn-global-typography-display-1-family);
font-size: var(--lmn-global-typography-display-1-size);
font-weight: var(--lmn-global-typography-display-1-weight);
line-height: var(--lmn-global-typography-display-1-line-height);
letter-spacing: var(--lmn-global-typography-display-1-letter-spacing);
/* Optionally, add a color */
color: var(--lmn-global-typography-color-brand-core);
}
Title Styles
Used for page titles and main section headings.
Name | CSS Class | Example Usage (Class) |
---|---|---|
Title 1 | .lmn-typography-title-1 | <h1 class="lmn-typography-title-1">...</h1> |
Title 2 | .lmn-typography-title-2 | <h2 class="lmn-typography-title-2">...</h2> |
Title 3 | .lmn-typography-title-3 | <h3 class="lmn-typography-title-3">...</h3> |
Title 4 | .lmn-typography-title-4 | <h4 class="lmn-typography-title-4">...</h4> |
CSS Variables for Title Styles:
For each preset (e.g., title-1
), the following CSS variables are available:
--lmn-global-typography-title-1-family
--lmn-global-typography-title-1-size
--lmn-global-typography-title-1-weight
--lmn-global-typography-title-1-line-height
--lmn-global-typography-title-1-letter-spacing
(Replace title-1
with title-2
, etc., for other title styles)
Example Usage (Variables):
.my-section-title {
font-family: var(--lmn-global-typography-title-2-family);
font-size: var(--lmn-global-typography-title-2-size);
font-weight: var(--lmn-global-typography-title-2-weight);
line-height: var(--lmn-global-typography-title-2-line-height);
letter-spacing: var(--lmn-global-typography-title-2-letter-spacing);
color: var(--lmn-global-typography-color-neutral-primary);
}
Subtitle Styles
Used for subheadings, captions, and ancillary text that supports titles or body content.
Name | CSS Class | Example Usage (Class) |
---|---|---|
Subtitle 1 | .lmn-typography-subtitle-1 | <h5 class="lmn-typography-subtitle-1">...</h5> |
Subtitle 2 | .lmn-typography-subtitle-2 | <h6 class="lmn-typography-subtitle-2">...</h6> |
Subtitle 3 | .lmn-typography-subtitle-3 | <p class="lmn-typography-subtitle-3">...</p> |
Subtitle 4 | .lmn-typography-subtitle-4 | <p class="lmn-typography-subtitle-4">...</p> |
Subtitle 5 | .lmn-typography-subtitle-5 | <small class="lmn-typography-subtitle-5">...</small> |
CSS Variables for Subtitle Styles:
For each preset (e.g., subtitle-1
), the following CSS variables are available:
--lmn-global-typography-subtitle-1-family
--lmn-global-typography-subtitle-1-size
--lmn-global-typography-subtitle-1-weight
--lmn-global-typography-subtitle-1-line-height
--lmn-global-typography-subtitle-1-letter-spacing
(Replace subtitle-1
with subtitle-2
, etc., for other subtitle styles)
Example Usage (Variables):
.my-image-caption {
font-family: var(--lmn-global-typography-subtitle-5-family);
font-size: var(--lmn-global-typography-subtitle-5-size);
font-weight: var(--lmn-global-typography-subtitle-5-weight);
line-height: var(--lmn-global-typography-subtitle-5-line-height);
letter-spacing: var(--lmn-global-typography-subtitle-5-letter-spacing);
color: var(--lmn-global-typography-color-neutral-secondary);
}
Body Styles
Used for primary content, such as articles, descriptions, and long-form text.
Name | CSS Class | Example Usage (Class) |
---|---|---|
Body Editorial | .lmn-typography-body-editorial | <p class="lmn-typography-body-editorial">...</p> |
Body Comfortable | .lmn-typography-body-comfortable | <p class="lmn-typography-body-comfortable">...</p> |
Body Compact | .lmn-typography-body-compact | <p class="lmn-typography-body-compact">...</p> |
CSS Variables for Body Styles:
For each preset (e.g., body-editorial
), the following CSS variables are available:
--lmn-global-typography-body-editorial-family
--lmn-global-typography-body-editorial-size
--lmn-global-typography-body-editorial-weight
--lmn-global-typography-body-editorial-line-height
--lmn-global-typography-body-editorial-letter-spacing
(Replace body-editorial
with body-comfortable
or body-compact
for other body styles)
Example Usage (Variables):
.my-article-content p { /* Assuming styling is applied to paragraphs within this class */
font-family: var(--lmn-global-typography-body-comfortable-family);
font-size: var(--lmn-global-typography-body-comfortable-size);
font-weight: var(--lmn-global-typography-body-comfortable-weight);
line-height: var(--lmn-global-typography-body-comfortable-line-height);
letter-spacing: var(--lmn-global-typography-body-comfortable-letter-spacing);
color: var(--lmn-global-typography-color-neutral-primary);
margin-bottom: var(--lmn-global-typography-paragraph-spacing-below); /* For paragraph spacing */
}
Special Note on Paragraphs: When lmn-typography-body-*
classes are applied to a <p>
tag, or to a container element that has <p>
tag descendants, a bottom margin is automatically applied to each paragraph. This margin is controlled by the CSS variable --lmn-global-typography-paragraph-spacing-below
.
Example (input_file_3.ts
structure):
<div class="lmn-typography-body-editorial">
<p>First paragraph content...</p>
<p>Second paragraph content...</p>
</div>
Or:
<p class="lmn-typography-body-comfortable">
Single paragraph content...
</p>
Support Styles
Used for UI elements like labels, buttons, code snippets, and helper text.
Name | CSS Class | Example Usage (Class) |
---|---|---|
Label 1 | .lmn-typography-label-1 | <span class="lmn-typography-label-1">...</span> |
Label 2 | .lmn-typography-label-2 | <span class="lmn-typography-label-2">...</span> |
Label 3 | .lmn-typography-label-3 | <span class="lmn-typography-label-3">...</span> |
Label 4 | .lmn-typography-label-4 | <span class="lmn-typography-label-4">...</span> |
Button 1 | .lmn-typography-button-1 | <button class="lmn-typography-button-1">...</button> |
Button 2 | .lmn-typography-button-2 | <button class="lmn-typography-button-2">...</button> |
Button 3 | .lmn-typography-button-3 | <button class="lmn-typography-button-3">...</button> |
Code | .lmn-typography-code | <code class="lmn-typography-code">...</code> |
Helper | .lmn-typography-helper | <small class="lmn-typography-helper">...</small> |
CSS Variables for Support Styles:
Each support style (e.g., label-1
, button-1
, code
, helper
) has its own set of 5 CSS variables, following the pattern: --lmn-global-typography-{presetName}-family
--lmn-global-typography-{presetName}-size
...and so on.
For example, for code
:
--lmn-global-typography-code-family
--lmn-global-typography-code-size
--lmn-global-typography-code-weight
--lmn-global-typography-code-line-height
--lmn-global-typography-code-letter-spacing
Example Usage (Variables):
.my-custom-button-text {
font-family: var(--lmn-global-typography-button-1-family);
font-size: var(--lmn-global-typography-button-1-size);
font-weight: var(--lmn-global-typography-button-1-weight);
line-height: var(--lmn-global-typography-button-1-line-height);
letter-spacing: var(--lmn-global-typography-button-1-letter-spacing);
/* Usually combined with other button styling (padding, background, etc.) */
}
.my-form-field-label {
font-family: var(--lmn-global-typography-label-2-family);
font-size: var(--lmn-global-typography-label-2-size);
font-weight: var(--lmn-global-typography-label-2-weight);
line-height: var(--lmn-global-typography-label-2-line-height);
letter-spacing: var(--lmn-global-typography-label-2-letter-spacing);
color: var(--lmn-global-typography-color-neutral-secondary);
}
.my-inline-code-snippet {
font-family: var(--lmn-global-typography-code-family);
font-size: var(--lmn-global-typography-code-size);
font-weight: var(--lmn-global-typography-code-weight);
line-height: var(--lmn-global-typography-code-line-height);
letter-spacing: var(--lmn-global-typography-code-letter-spacing);
background-color: #f0f0f0; /* Example background for code */
padding: 0.2em 0.4em;
border-radius: 3px;
}
Typography Colors
We provide a palette of text colors to be used in conjunction with the core typography styles.
Applying Colors
- Using CSS Helper Classes: Add the
lmn-typography-color-*
class to an element that also has a core typography style class applied (e.g.,lmn-typography-title-1
). - Using CSS Custom Properties (Variables): Apply the color directly using the
color
CSS property and the relevant CSS variable.
Available Colors:
Category | Name | CSS Class | CSS Variable |
---|---|---|---|
Neutral | Neutral Primary | .lmn-typography-color-neutral-primary | --lmn-global-typography-color-neutral-primary |
Neutral Primary Negative | .lmn-typography-color-neutral-primary-negative | --lmn-global-typography-color-neutral-primary-negative | |
Neutral Secondary | .lmn-typography-color-neutral-secondary | --lmn-global-typography-color-neutral-secondary | |
Neutral Secondary Negative | .lmn-typography-color-neutral-secondary-negative | --lmn-global-typography-color-neutral-secondary-negative | |
Brand | Brand Core | .lmn-typography-color-brand-core | --lmn-global-typography-color-brand-core |
Brand Core Negative | .lmn-typography-color-brand-core-negative | --lmn-global-typography-color-brand-core-negative | |
Brand Alt | .lmn-typography-color-brand-alt | --lmn-global-typography-color-brand-alt | |
Brand Alt Negative | .lmn-typography-color-brand-alt-negative | --lmn-global-typography-color-brand-alt-negative | |
Brand CTA | .lmn-typography-color-brand-cta | --lmn-global-typography-color-brand-cta | |
Brand CTA Negative | .lmn-typography-color-brand-cta-negative | --lmn-global-typography-color-brand-cta-negative | |
Functional | Danger | .lmn-typography-color-danger | --lmn-global-typography-color-danger |
Danger Negative | .lmn-typography-color-danger-negative | --lmn-global-typography-color-danger-negative | |
Alert | .lmn-typography-color-alert | --lmn-global-typography-color-alert | |
Alert Negative | .lmn-typography-color-alert-negative | --lmn-global-typography-color-alert-negative | |
Success | .lmn-typography-color-success | --lmn-global-typography-color-success | |
Success Negative | .lmn-typography-color-success-negative | --lmn-global-typography-color-success-negative | |
Info | .lmn-typography-color-info | --lmn-global-typography-color-info | |
Info Negative | .lmn-typography-color-info-negative | --lmn-global-typography-color-info-negative | |
News | .lmn-typography-color-news | --lmn-global-typography-color-news | |
News Negative | .lmn-typography-color-news-negative | --lmn-global-typography-color-news-negative |
"Negative" variants are typically designed for use on dark backgrounds.
Example Usage (Class):
<h1 class="lmn-typography-title-1 lmn-typography-color-brand-core">
Brand Core Title
</h1>
<p class="lmn-typography-body-comfortable lmn-typography-color-neutral-secondary">
Secondary neutral text.
</p>
Example Usage (Variable):
.my-custom-text-with-danger-color {
/* Assumes a core typography style is also applied or defined */
color: var(--lmn-global-typography-color-danger);
}
.my-component-on-dark-background .title {
font-family: var(--lmn-global-typography-title-2-family);
/* ... other font properties ... */
color: var(--lmn-global-typography-color-neutral-primary-negative);
}
Utility Classes
Uppercase Text
To transform text to uppercase, use the .lmn-typography-uppercase
class.
CSS Class: .lmn-typography-uppercase
CSS Property: text-transform: uppercase;
Example Usage:
<div class="lmn-typography-label-1 lmn-typography-uppercase">
This label is uppercase
</div>