Typography
The Typography component provides a reusable pattern for typography in the interface.
Variant
In this case, variant is set to h1 and element parameter is left untouched. This results in a <p> element that looks like h5 element.
Variant h1
Element
When the parameter element is set and the variant element is not, the result is a p element that looks like a <h1> element.
Element h1
Heading Variants
Standard HTML heading levels from h1 to h6. These are semantic elements that define the document structure and hierarchy.
Variant: h1
Variant: h2
Variant: h3
Variant: h4
Variant: h5
Variant: h6
Display Variants
Large display text variants including headline, title, and subtitle. These are used for prominent text that needs visual emphasis.
Body Text Variants
Standard body text variants including body, paragraph (p), and bold. These are the primary text styles for content.
Variant: body. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec suscipit auctor dui, a efficitur ligula. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
Variant: p. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec suscipit auctor dui, a efficitur ligula. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
Variant: bold. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec suscipit auctor dui, a efficitur ligula. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
Variant: lead. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec suscipit auctor dui, a efficitur ligula. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.
Small Text Variants
Smaller text variants including caption, byline, and meta. These are used for secondary information and annotations.
Specialized Variants
Specialized text variants for specific use cases such as marketing and email content.
API
| Parameter | Default | Description |
|---|---|---|
|
element
|
p | What element the markup will use. |
|
variant
|
false | Headings (h1, h2...) can only be set to other headings. If left empty it will default to the given element. |
|
slot
|
The content | |
|
autopromote
|
false | Upgrade element to h1 (from h3 and above), if seen first on page. |
|
useHeadingsContext
|
true | If a heading should be based off of the context its in. |
CSS API
| Variable | Default | Type | Values | Description |
|---|---|---|---|---|
|
--c-typography--font-family-base
|
var(--font-family-base) | font | - | Controls the base typeface used by body, paragraph, lead, small text, and non-heading variants that inherit the base family. |
|
--c-typography--font-family-heading
|
var(--font-family-heading) | font | - | Controls the typeface used by variants that explicitly switch to the heading family. |
|
--c-typography--font-weight-normal
|
var(--font-weight-normal) | select | 100, 200, 300, 400, 500, 600 | Controls the default font weight for variants that keep the base weight. |
|
--c-typography--font-weight-medium
|
var(--font-weight-medium) | select | 400, 500, 600, 700 | Controls the shared medium emphasis used by title and lead variants. |
|
--c-typography--font-weight-bold
|
var(--font-weight-bold) | select | 600, 700, 800, 900 | Controls the heavier emphasis used by bold and marketing variants. |
|
--c-typography--font-weight-heading
|
var(--font-weight-heading) | select | 400, 500, 600, 700, 800, 900 | Controls the default weight used by heading level variants h1 through h6. |
|
--c-typography--line-height-base
|
var(--line-height-base) | range | - | Controls the reading line height for variants that keep the base line height. |
|
--c-typography--line-height-heading
|
var(--line-height-heading) | range | - | Controls the shared line height for heading-style variants. |
|
--c-typography--letter-spacing-base
|
var(--letter-spacing-base) | range | - | Controls the default tracking for variants that inherit the base letter spacing. |
|
--c-typography--letter-spacing-heading
|
var(--letter-spacing-heading) | range | - | Controls the tracking for heading-style variants that use the heading spacing scale. |
|
--c-typography--space
|
var(--space) | range | - | Controls the vertical spacing inserted between adjacent heading-style variants. |
|
--c-typography--font-size-90
|
var(--font-size-90) | range | - | Controls caption, byline, and meta text sizes. |
|
--c-typography--font-size-200
|
var(--font-size-200) | range | - | Controls the shared size used by lead text and the smaller heading level h6. |
|
--c-typography--font-size-300
|
var(--font-size-300) | range | - | Controls the default size used by h5 headings. |
|
--c-typography--font-size-400
|
var(--font-size-400) | range | - | Controls the shared size used by subtitle and h4 variants. |
|
--c-typography--font-size-500
|
var(--font-size-500) | range | - | Controls the shared size used by title and h3 variants. |
|
--c-typography--font-size-600
|
var(--font-size-600) | range | - | Controls the shared size used by headline and h2 variants. |
|
--c-typography--font-size-700
|
var(--font-size-700) | range | - | Controls the default size used by h1 headings. |
|
--c-typography--font-size-800
|
var(--font-size-800) | range | - | Controls the default size used by the marketing variant. |
|
--c-typography--body-font-size-multiplier
|
1 | range | - | Scales regular body and paragraph text locally without changing the shared type scale. |
|
--c-typography--bold-font-size-multiplier
|
1 | range | - | Scales the bold variant locally without changing other text styles. |
|
--c-typography--lead-font-size-multiplier
|
1 | range | - | Scales lead text locally without changing the shared lead token. |
|
--c-typography--caption-font-size-multiplier
|
1 | range | - | Scales caption text locally without changing the shared small-text token. |
|
--c-typography--byline-font-size-multiplier
|
1 | range | - | Scales byline text locally without changing the shared small-text token. |
|
--c-typography--meta-font-size-multiplier
|
1 | range | - | Scales meta text locally without changing the shared small-text token. |
|
--c-typography--email-font-size-multiplier
|
1 | range | - | Scales email text locally without changing the shared body size. |
|
--c-typography--h1-font-size-multiplier
|
1 | range | - | Scales h1 locally for one placement without changing the global h1 scale. |
|
--c-typography--h2-font-size-multiplier
|
1 | range | - | Scales h2 locally for one placement without changing the global h2 scale. |
|
--c-typography--h3-font-size-multiplier
|
1 | range | - | Scales h3 locally for one placement without changing the global h3 scale. |
|
--c-typography--h4-font-size-multiplier
|
1 | range | - | Scales h4 locally for one placement without changing the global h4 scale. |
|
--c-typography--h5-font-size-multiplier
|
1 | range | - | Scales h5 locally for one placement without changing the global h5 scale. |
|
--c-typography--h6-font-size-multiplier
|
1 | range | - | Scales h6 locally for one placement without changing the global h6 scale. |
|
--c-typography--headline-font-size-multiplier
|
1 | range | - | Scales the headline variant locally without changing the shared display scale. |
|
--c-typography--title-font-size-multiplier
|
1 | range | - | Scales the title variant locally without changing the shared display scale. |
|
--c-typography--subtitle-font-size-multiplier
|
1 | range | - | Scales the subtitle variant locally without changing the shared display scale. |
|
--c-typography--marketing-font-size-multiplier
|
1 | range | - | Scales the marketing variant locally without changing the shared display scale. |