Typography normalization
Typography normalization gives text elements a stable starting point across browsers. It keeps useful reading conventions while aligning font, size, line, spacing, and inline-text behavior so later styles do not depend on a browser's built-in defaults. See Reset styles for the wider reset model.
Text baseline
The text baseline sets the common reading context for the page. The full reset uses a system font stack and a 1.5 root line height, then preserves a larger h1 and a clear gap between adjacent paragraphs (src/…/global.scss• L9-25).
Root text context
The root context gives ordinary text a consistent font and line rhythm. This reduces variation between browser defaults without forcing a visual design system on the page.
References: src/…/global.scss• L9-13
Heading and paragraph rhythm
The reset keeps the main heading scale and restores vertical separation between consecutive paragraphs. These rules provide a useful reading structure after the global margin reset removes browser spacing from all elements.
References: src/…/global.scss• L1-7 src/…/global.scss• L19-25
Inline text semantics
Inline text rules preserve the meaning of links, abbreviations, code, and raised or lowered text while removing browser-specific differences. The result is a common base for content styles rather than a complete typography theme.
Links and abbreviations
Links start with a transparent background, and titled abbreviations keep a dotted underline. These choices retain recognizable text cues while avoiding browser-specific background or decoration behavior.
References: src/…/text.scss• L1-7
Code and preformatted text
Code-oriented elements use a monospace family and inherit the surrounding text size. Inline code, keyboard input, sample output, and preformatted blocks therefore share the same basic text scale across browsers.
References: src/…/text.scss• L9-12
Subscript and superscript
Subscript and superscript text uses a smaller size, reduced line height, and baseline positioning. Separate vertical offsets keep each form in its expected position without changing the surrounding line rhythm.
References: src/…/text.scss• L14-26
Block text spacing
Block text normalization controls spacing for lists and horizontal rules so browser defaults do not change the shape of a content block. It keeps list structure visible and gives nested lists a predictable relationship to their parent list.
List spacing
Description, ordered, and unordered lists receive shared outer spacing. Nested lists remove that extra outer margin so nesting does not add accidental gaps at every level.
References: src/…/other.scss• L8-14
Horizontal rule behavior
Horizontal rules keep their inherited text color and use a zero-height content box with visible overflow. This gives the separator a stable cross-browser base while leaving its final appearance to later styles.
References: src/…/other.scss• L1-6
Normalization boundaries
Typography normalization works with the other reset areas rather than replacing them. The full reset adds text, form, and element behavior together through src/index.scss• L1-6; the smaller variant keeps only a limited heading rule and does not provide the full text treatment.
The relationship between the page-wide baseline and text-specific rules is:
flowchart TD
A[Browser text defaults] --> B[Root font and line context]
B --> C[Heading and paragraph rhythm]
B --> D[Inline text semantics]
B --> E[List and separator spacing]
C --> F[Stable content starting point]
D --> F
E --> F
For the neighboring reset responsibilities, see Foundational element normalization, Form control normalization, and Minimal reset variant.
References: src/index.scss• L1-6 src/mini.scss• L13-19
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the root line-height choice aligned with form-control inheritance in src/…/forms.scss.
- Keep the full reset and the minimal variant clearly separated so users do not expect the minimal variant to include inline text or list normalization.
- Preserve the link and abbreviation cues when changing the text baseline or global margin reset.
- Check nested-list spacing when changing list margins, because the rule applies across mixed list types.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| Root line height changes without matching control inheritance | Text and controls use different vertical rhythm | Keep the root baseline and form-control inherited line height aligned |
| Global margins are reset without restoring paragraph or list spacing | Content blocks run together or list structure loses readable gaps | Retain the targeted paragraph and list spacing rules |
| Inline text rules are omitted from a full-reset build | Code, abbreviations, links, or subscript text fall back to browser-specific defaults | Keep the text component included in src/index.scss |
Key files
| File | Why to read it |
|---|---|
| src/…/global.scss | Defines the page-wide font, line height, heading scale, and paragraph rhythm. |
| src/…/text.scss | Defines the shared behavior for links, abbreviations, code, and subscript or superscript text. |
| src/…/other.scss | Defines list spacing and horizontal-rule behavior that affects text blocks. |
| src/index.scss | Shows how the typography rules join the full reset. |
| src/mini.scss | Shows the narrower heading and list behavior available in the minimal reset. |