Typography ​

Graupl provides a set of styles for headings and body text. By default, these styles apply to HTML elements without adding classes.

Base elements ​

Headings ​

Body text ​

Use <b> or <strong> for bold text, <i> or <em> for italics, and <small> for small print.

For examples of changing the size or weight of individual elements, see the font size and font weight utilities.

Custom Properties ​

The following custom properties can be used to customize the typography theme:

PropertyDescriptionDefault Value
--graupl-base-font-sizeThe base font size used to generate the font size scale.1rem
--graupl-font-size-xsThe extra-small font size.calc(0.694 * var(--graupl-base-font-size))
--graupl-font-size-smThe small font size.calc(0.833 * var(--graupl-base-font-size))
--graupl-font-size-baseThe base font size.calc(1 * var(--graupl-base-font-size))
--graupl-font-size-lgThe large font size.calc(1.2 * var(--graupl-base-font-size))
--graupl-font-size-xlThe extra-large font size.calc(1.44 * var(--graupl-base-font-size))
--graupl-font-size-2xlThe 2XL font size.calc(1.728 * var(--graupl-base-font-size))
--graupl-font-size-3xlThe 3XL font size.calc(2.074 * var(--graupl-base-font-size))
--graupl-font-size-4xlThe 4XL font size.calc(2.488 * var(--graupl-base-font-size))
--graupl-font-size-5xlThe 5XL font size.calc(2.986 * var(--graupl-base-font-size))
--graupl-font-weight-lightThe light font weight.300
--graupl-font-weight-normalThe normal font weight.400
--graupl-font-weight-boldThe bold font weight.700
--graupl-root-font-familyThe font family of the root element.system-ui, -apple-system, blinkmacsystemfont, "Segoe UI", roboto, "Helvetica Neue", arial, sans-serif
--graupl-root-font-sizeThe font size of the root element.clamp(0.85rem, calc(0.8rem + 0.5vw), 1.25rem)
--graupl-root-font-weightThe font weight of the root element.var(--graupl-font-weight-normal)
--graupl-root-font-styleThe font style of the root element.normal
--graupl-root-font-variantThe font variant of the root element.normal
--graupl-root-line-heightThe line height of the root element.1.2em
--graupl-root-letter-spacingThe letter spacing of the root element.normal
--graupl-root-word-spacingThe word spacing of the root element.normal
--graupl-font-sizeThe shared font size.inherit
--graupl-font-weightThe shared font weight.inherit
--graupl-font-styleThe shared font style.inherit
--graupl-font-variantThe shared font variant.inherit
--graupl-font-colorThe shared text colour.currentColor
--graupl-font-familyThe shared font family.inherit
--graupl-line-heightThe shared line height.var(--graupl-root-line-height)
--graupl-letter-spacingThe shared letter spacing.inherit
--graupl-word-spacingThe shared word spacing.inherit
--graupl-paragraph-font-sizeThe font size of paragraph elements.var(--graupl-font-size)
--graupl-paragraph-font-weightThe font weight of paragraph elements.var(--graupl-font-weight)
--graupl-paragraph-font-styleThe font style of paragraph elements.var(--graupl-font-style)
--graupl-paragraph-font-variantThe font variant of paragraph elements.var(--graupl-font-variant)
--graupl-paragraph-colorThe text colour of paragraph elements.var(--graupl-font-color)
--graupl-paragraph-font-familyThe font family of paragraph elements.var(--graupl-font-family)
--graupl-paragraph-line-heightThe line height of paragraph elements.var(--graupl-line-height)
--graupl-paragraph-letter-spacingThe letter spacing of paragraph elements.var(--graupl-letter-spacing)
--graupl-paragraph-word-spacingThe word spacing of paragraph elements.var(--graupl-word-spacing)
--graupl-paragraph-marginThe margin of paragraph elements.0 0 var(--graupl-spacer-2) 0
--graupl-small-font-sizeThe font size of small text.var(--graupl-font-size-sm)
--graupl-small-font-weightThe font weight of small text.var(--graupl-font-weight)
--graupl-small-font-styleThe font style of small text.var(--graupl-font-style)
--graupl-small-font-variantThe font variant of small text.var(--graupl-font-variant)
--graupl-small-colorThe text colour of small text.var(--graupl-font-color)
--graupl-small-font-familyThe font family of small text.var(--graupl-font-family)
--graupl-small-line-heightThe line height of small text.var(--graupl-line-height)
--graupl-small-letter-spacingThe letter spacing of small text.var(--graupl-letter-spacing)
--graupl-small-word-spacingThe word spacing of small text.var(--graupl-word-spacing)
--graupl-small-marginThe margin of small text.0 0 var(--graupl-spacer-2) 0
--graupl-bold-font-sizeThe font size of bold text.var(--graupl-font-size)
--graupl-bold-font-weightThe font weight of bold text.var(--graupl-font-weight)
--graupl-bold-font-styleThe font style of bold text.var(--graupl-font-style)
--graupl-bold-font-variantThe font variant of bold text.var(--graupl-font-variant)
--graupl-bold-colorThe text colour of bold text.var(--graupl-font-color)
--graupl-bold-font-familyThe font family of bold text.var(--graupl-font-family)
--graupl-bold-line-heightThe line height of bold text.var(--graupl-line-height)
--graupl-bold-letter-spacingThe letter spacing of bold text.var(--graupl-letter-spacing)
--graupl-bold-word-spacingThe word spacing of bold text.var(--graupl-word-spacing)
--graupl-bold-marginThe margin of bold text.0 0 var(--graupl-spacer-2) 0
--graupl-italic-font-sizeThe font size of italic text.var(--graupl-font-size)
--graupl-italic-font-weightThe font weight of italic text.var(--graupl-font-weight)
--graupl-italic-font-styleThe font style of italic text.italic
--graupl-italic-font-variantThe font variant of italic text.var(--graupl-font-variant)
--graupl-italic-colorThe text colour of italic text.var(--graupl-font-color)
--graupl-italic-font-familyThe font family of italic text.var(--graupl-font-family)
--graupl-italic-line-heightThe line height of italic text.var(--graupl-line-height)
--graupl-italic-letter-spacingThe letter spacing of italic text.var(--graupl-letter-spacing)
--graupl-italic-word-spacingThe word spacing of italic text.var(--graupl-word-spacing)
--graupl-italic-marginThe margin of italic text.0 0 var(--graupl-spacer-2) 0
--graupl-heading-font-weightThe font weight of headings.var(--graupl-font-weight-bold)
--graupl-heading-font-styleThe font style of headings.var(--graupl-font-style)
--graupl-heading-font-variantThe font variant of headings.var(--graupl-font-variant)
--graupl-heading-colorThe text colour of headings.var(--graupl-font-color)
--graupl-heading-font-familyThe font family of headings.var(--graupl-font-family)
--graupl-heading-line-heightThe line height of headings.var(--graupl-line-height)
--graupl-heading-letter-spacingThe letter spacing of headings.var(--graupl-letter-spacing)
--graupl-heading-word-spacingThe word spacing of headings.var(--graupl-word-spacing)
--graupl-heading-marginThe margin of headings.var(--graupl-spacer-5) 0 var(--graupl-spacer-2) 0
--graupl-h1-font-sizeThe font size of H1 elements.var(--graupl-font-size-5xl)
--graupl-h1-font-weightThe font weight of H1 elements.var(--graupl-heading-font-weight)
--graupl-h1-font-styleThe font style of H1 elements.var(--graupl-heading-font-style)
--graupl-h1-font-variantThe font variant of H1 elements.var(--graupl-heading-font-variant)
--graupl-h1-colorThe text colour of H1 elements.var(--graupl-heading-color)
--graupl-h1-font-familyThe font family of H1 elements.var(--graupl-heading-font-family)
--graupl-h1-line-heightThe line height of H1 elements.var(--graupl-heading-line-height)
--graupl-h1-letter-spacingThe letter spacing of H1 elements.var(--graupl-heading-letter-spacing)
--graupl-h1-word-spacingThe word spacing of H1 elements.var(--graupl-heading-word-spacing)
--graupl-h1-marginThe margin of H1 elements.var(--graupl-heading-margin)
--graupl-h2-font-sizeThe font size of H2 elements.var(--graupl-font-size-4xl)
--graupl-h2-font-weightThe font weight of H2 elements.var(--graupl-heading-font-weight)
--graupl-h2-font-styleThe font style of H2 elements.var(--graupl-heading-font-style)
--graupl-h2-font-variantThe font variant of H2 elements.var(--graupl-heading-font-variant)
--graupl-h2-colorThe text colour of H2 elements.var(--graupl-heading-color)
--graupl-h2-font-familyThe font family of H2 elements.var(--graupl-heading-font-family)
--graupl-h2-line-heightThe line height of H2 elements.var(--graupl-heading-line-height)
--graupl-h2-letter-spacingThe letter spacing of H2 elements.var(--graupl-heading-letter-spacing)
--graupl-h2-word-spacingThe word spacing of H2 elements.var(--graupl-heading-word-spacing)
--graupl-h2-marginThe margin of H2 elements.var(--graupl-heading-margin)
--graupl-h3-font-sizeThe font size of H3 elements.var(--graupl-font-size-3xl)
--graupl-h3-font-weightThe font weight of H3 elements.var(--graupl-heading-font-weight)
--graupl-h3-font-styleThe font style of H3 elements.var(--graupl-heading-font-style)
--graupl-h3-font-variantThe font variant of H3 elements.var(--graupl-heading-font-variant)
--graupl-h3-colorThe text colour of H3 elements.var(--graupl-heading-color)
--graupl-h3-font-familyThe font family of H3 elements.var(--graupl-heading-font-family)
--graupl-h3-line-heightThe line height of H3 elements.var(--graupl-heading-line-height)
--graupl-h3-letter-spacingThe letter spacing of H3 elements.var(--graupl-heading-letter-spacing)
--graupl-h3-word-spacingThe word spacing of H3 elements.var(--graupl-heading-word-spacing)
--graupl-h3-marginThe margin of H3 elements.var(--graupl-heading-margin)
--graupl-h4-font-sizeThe font size of H4 elements.var(--graupl-font-size-2xl)
--graupl-h4-font-weightThe font weight of H4 elements.var(--graupl-heading-font-weight)
--graupl-h4-font-styleThe font style of H4 elements.var(--graupl-heading-font-style)
--graupl-h4-font-variantThe font variant of H4 elements.var(--graupl-heading-font-variant)
--graupl-h4-colorThe text colour of H4 elements.var(--graupl-heading-color)
--graupl-h4-font-familyThe font family of H4 elements.var(--graupl-heading-font-family)
--graupl-h4-line-heightThe line height of H4 elements.var(--graupl-heading-line-height)
--graupl-h4-letter-spacingThe letter spacing of H4 elements.var(--graupl-heading-letter-spacing)
--graupl-h4-word-spacingThe word spacing of H4 elements.var(--graupl-heading-word-spacing)
--graupl-h4-marginThe margin of H4 elements.var(--graupl-heading-margin)
--graupl-h5-font-sizeThe font size of H5 elements.var(--graupl-font-size-xl)
--graupl-h5-font-weightThe font weight of H5 elements.var(--graupl-heading-font-weight)
--graupl-h5-font-styleThe font style of H5 elements.var(--graupl-heading-font-style)
--graupl-h5-font-variantThe font variant of H5 elements.var(--graupl-heading-font-variant)
--graupl-h5-colorThe text colour of H5 elements.var(--graupl-heading-color)
--graupl-h5-font-familyThe font family of H5 elements.var(--graupl-heading-font-family)
--graupl-h5-line-heightThe line height of H5 elements.var(--graupl-heading-line-height)
--graupl-h5-letter-spacingThe letter spacing of H5 elements.var(--graupl-heading-letter-spacing)
--graupl-h5-word-spacingThe word spacing of H5 elements.var(--graupl-heading-word-spacing)
--graupl-h5-marginThe margin of H5 elements.var(--graupl-heading-margin)
--graupl-h6-font-sizeThe font size of H6 elements.var(--graupl-font-size-lg)
--graupl-h6-font-weightThe font weight of H6 elements.var(--graupl-heading-font-weight)
--graupl-h6-font-styleThe font style of H6 elements.var(--graupl-heading-font-style)
--graupl-h6-font-variantThe font variant of H6 elements.var(--graupl-heading-font-variant)
--graupl-h6-colorThe text colour of H6 elements.var(--graupl-heading-color)
--graupl-h6-font-familyThe font family of H6 elements.var(--graupl-heading-font-family)
--graupl-h6-line-heightThe line height of H6 elements.var(--graupl-heading-line-height)
--graupl-h6-letter-spacingThe letter spacing of H6 elements.var(--graupl-heading-letter-spacing)
--graupl-h6-word-spacingThe word spacing of H6 elements.var(--graupl-heading-word-spacing)
--graupl-h6-marginThe margin of H6 elements.var(--graupl-heading-margin)

Change --graupl-base-font-size to adjust the font-size scale, or set a property for the element you want to adjust.

Sass variables ​

The following Sass variables can be used to customize the generation of the typography theme:

VariableDescriptionDefault Value
$selector-baseThe prefix used for element selectors.""
$modifier-selector-baseThe prefix used for modifier selectors."."
$paragraph-selector-baseThe prefix for the paragraph selector.""
$paragraph-selectorThe paragraph element selector."p"
$small-selector-baseThe prefix for the small text selector.""
$small-selectorThe small text element selector."small"
$h1-selector-baseThe prefix for the H1 selector.""
$h1-selectorThe H1 element selector."h1"
$h2-selector-baseThe prefix for the H2 selector.""
$h2-selectorThe H2 element selector."h2"
$h3-selector-baseThe prefix for the H3 selector.""
$h3-selectorThe H3 element selector."h3"
$h4-selector-baseThe prefix for the H4 selector.""
$h4-selectorThe H4 element selector."h4"
$h5-selector-baseThe prefix for the H5 selector.""
$h5-selectorThe H5 element selector."h5"
$h6-selector-baseThe prefix for the H6 selector.""
$h6-selectorThe H6 element selector."h6"
$root-selector-baseThe prefix for the root selector.":"
$root-selectorThe root element selector."root"
$bold-selector-baseThe prefix for the bold selector.""
$bold-selectorThe bold element selector."b"
$strong-selector-baseThe prefix for the strong selector.""
$strong-selectorThe strong element selector."strong"
$emphasis-selector-baseThe prefix for the emphasis selector.""
$emphasis-selectorThe emphasis element selector."em"
$italic-selector-baseThe prefix for the italic selector.""
$italic-selectorThe italic element selector."i"
$generate-base-font-sizesA flag to generate the base font-size scale.true
$generate-base-font-weightsA flag to generate the base font-weight scale.true
$base-font-sizeThe base font size used to generate the font size scale.1rem
$root-font-sizeThe font size of the root element.clamp(0.85rem, calc(0.8rem + 0.5vw), 1.25rem)
$root-line-heightThe line height of the root element.1.2em
$root-letter-spacingThe letter spacing of the root element.normal
$root-word-spacingThe word spacing of the root element.normal
$root-font-styleThe font style of the root element.normal
$root-font-variantThe font variant of the root element.normal
$font-size-multipliersA map of overrides for the default font size multipliers.()
$font-weightsA map of overrides for the default font weights.()
$root-font-familyThe font family of the root element.System font stack

When compiling Graupl, set $paragraph-selector or $small-selector to apply the styles to a different selector. Use the corresponding -selector-base variable to add a prefix.