Skip to content

Typography

Consistent reset styles for default HTML typography, lists, inline and block elements.

Examples (anchor)

The typography styles can be customized prior to compiling using Sass or in real-time with CSS variables.

Headings and text (anchor)

<h1>

Heading 1

<h2>

Heading 2

<h3>

Heading 3

<h4>

Heading 4

<h5>

Heading 5

<h6>

Heading 6
<p>

The quick brown fox jumps over the lazy dog.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
123456789

<small>

The quick brown fox jumps over the lazy dog.
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
123456789

Lists (anchor)

<ol>

  1. Item
  2. Item
  3. Item
  4. Item

<ul>

  • Item 1
  • Item 2
  • Item 3
  • Item 4

<dl>

Term 1
Description
Term 2
Description

Inline elements (anchor)

Bold/strong
Italic/emphasis
Superscript(1)
Subscript(2)
Delete

Mark
Small
Keyboard
Code
Abbr

Block elements (anchor)

<details>

Summary

Details body content

<blockquote>

Blockquote with author and citation.

— Editor Daily Blog

<hr>


<pre>

:where(html) {
  color-scheme: light dark;
  color: CanvasText;
  background-color: Canvas;
}

<figure> with caption

Forest covered in snow with sunset filtering between tall trees.
Winter forest

Using the module (anchor)

Load StyleMods as demonstrated (change file path as required) then include the Sass mixin anywhere below.

custom.scss
@use "stylemods/scss" as *;
@include typography-css;

See the using modules page for more information.

Using the framework (anchor)

Using the recommended custom setup enable the styles in an overrides document:

overrides.scss
@use "stylemods/scss/configuration" as *;
$enable-typography: true;

Include the overrides and the framework styles with your custom document for compiling the framework:

custom.scss
@use "overrides";
@use "stylemods/scss/stylemods";

See using the framework for more information.

Source code (anchor)

The Typography source file is included with the content module files, you can view the source code from the latest release (v1.5.0) via the Github link below.

Source document
stylemods/scss/content/typography.scss
View on Github
https://github.com/pmbrown/StyleMods/blob/main/scss/content/typography.scss

Shared documentation about how to customize the default property values for the styles using the Sass and CSS variables is provided on the customizing page.