Navigation: uCss > Source > Modules > Typography
Modules: Config | Base | Layout | Theming | Typography | Patterns | Utilities
Fluid Typography. A system where semantics (
h1) and style (.t) are decoupled. Features smoothclamp()-based scaling for both Headings (.t) and Body Text (.tx), covering a massive range (fromxxldown toxxs+) to ensure perfect readability on every device.
The Typography Module handles the size, weight, line-height, and alignment of text.
It separates Headings (.t, Title) from Body Copy (.tx, Text) to allow for distinct font-family and scaling logic.
.t--xl isn't 4rem. It's clamp(3rem, 1.5vw + 2.6rem, 4rem). It truly scales linearly with the viewport width..ta-c--lg centers text only when the container is large, not when the screen is large..xb (Extra Bold) or .lt (Light) independent of the heading level.<span class="t--h1"> look like an H1, or an <h1 class="t--h4"> look like an H4. Note: uCss separates semantics (HTML tag) from visuals (Classes).[!LIGHTBULB] Why separate
.tand.tx? Because Titles usually have tight line-heights (1.1 - 1.25) and display fonts. Body text needs looser line-heights (1.5 - 1.6) and readable serif/sans fonts. Separating them allows global tuning.
Computed Fluidity.
typography.cssis a typesetting engine that abandons static pixel values for fluid mathematics. Usingclamp()functions, typography in uCss scales smoothly between a minimum viewport size and a maximum viewport size, ensuring perfect legibility on any device without media query "jumps".
Traditional frameworks use "breakpoints".
This causes:
uCss Fluidity: We define a start point (2.5rem at 320px) and an end point (3.5rem at 1366px container width). The browser calculates the perfect pixel value for every single pixel in between.
Don't abuse <h1> just to get big text. Use <p class="t--xxl">.
Don't abuse <h6> just to get small text. Use <p class="t--xs">.
Keep your document outline (H1 -> H2 -> H3) clean for screen readers and SEO, and use uCss classes to style them to match your design.
<h1>Hello World</h1>. It sizes itself based on defaults..t--xxxl. Watch it become massive..ta-c. It centers..up. It becomes UPPERCASE.typography.min.css.<h1 class="t t--xxxl ta-c lh--xs">Big Title</h1>.<p class="tx tx--s ta-c--md lt">Small centered light text</p>.| File | Full (Raw) | Clean | Min | Gzip | Brotli |
|---|---|---|---|---|---|
typography.css (Aggregator) |
14 KB | 9.5 KB | 7.7 KB | 2.7 KB | 2.1 KB |
title.css |
6.1 KB | 4.3 KB | 3.4 KB | 0.9 KB | 0.8 KB |
text.css |
5.9 KB | 4.2 KB | 3.4 KB | 0.9 KB | 0.8 KB |
text-align.css |
1.8 KB | 1.1 KB | 0.9 KB | 0.3 KB | 0.2 KB |
| Module | Full Source | Clean Source | Minified (Prod) |
|---|---|---|---|
| Typography | typography.css | typography.clean.css | typography.min.css |
<link rel="preconnect" href="https://ucss.unqa.dev">
<link rel="stylesheet" href="https://ucss.unqa.dev/latest/lib/typography.min.css">
/p/)<link rel="stylesheet" href="https://ucss.unqa.dev/p/lib/typography.min.css">
| File | Description | Download |
|---|---|---|
title.css |
Headings. The .t class system. Handles h1-h6 sizing logic and weight modifiers. Sets font-family: var(--title-font). |
src |
text.css |
Body. The .tx class system. Handles paragraphs, captions, and generic text sizing. Sets font-family: var(--text-font). |
src |
text-align.css |
Alignment. The .ta class system. Handles responsive alignment (start, center, end). |
src |
clamp)The formula looks like this: clamp(MIN, SLOPE + INTERCEPT, MAX).
Example:
clamp(2rem, 5vw + 1rem, 4rem)
5vw is small. Result -> 2rem.5vw is bigger. Result -> 3rem.5vw is huge. Result -> 4rem (Capped).uCss creates a hierarchy of these scales so that XXS text grows slowly, but XXXL text grows rapidly.
.t)The .t class essentially "activates" the Title Variable System on an element.
--t-fs (Size), --t-fw (Weight), --t-lh (Line Height).font-family: var(--title-font) and reset margins..xxl then update the --t-fs variable to a specific fluid value..tx)The .tx system works identically to .t, but for body copy.
--tx-fs, --tx-fw, --tx-lh.font-family: var(--text-font).1.5) for readability, whereas Title uses a tight one (1.25)..t)| Class | Variable | Min Size | Max Size | Use Case |
|---|---|---|---|---|
.t--xxxl |
--t-fs--xxxl |
3.5rem |
6rem |
Hero Titles |
.t--xxl |
--t-fs--xxl |
3rem |
5rem |
Page Titles |
.t--xl |
--t-fs--xl |
2.5rem |
4rem |
Section Headers |
.t--l |
--t-fs--l |
2rem |
3rem |
Card Titles |
.t--m |
--t-fs--m |
1.75rem |
2.5rem |
Subtitles |
.t--s |
--t-fs--s |
1.5rem |
2rem |
Widget Headers |
.t--xs |
--t-fs--xs |
1.25rem |
1.5rem |
Meta labels |
.tx)| Class | Variable | Min Size | Max Size | Use Case |
|---|---|---|---|---|
.tx--xxl |
--tx-fs--xxl |
1.5rem |
1.75rem |
Lead Paragraphs |
.tx--xl |
--tx-fs--xl |
1.375rem |
1.5rem |
Intro Text |
.tx--l |
--tx-fs--l |
1.25rem |
1.375rem |
Article Body (Large) |
.tx--m |
--tx-fs--m |
1.125rem |
1.25rem |
Default Body |
.tx--s |
--tx-fs--s |
1rem |
1.125rem |
UI Text / Captions |
Applies to both .t and .tx
| Class | Name | Weight |
|---|---|---|
.ub, .hl |
Ultra Bold / Headline | 900 |
.xb, .tb |
Extra Bold / Title Bold | 800 |
.bd |
Bold | 700 |
.sb |
Semi Bold | 600 |
.md |
Medium | 500 |
.rg |
Regular | 400 |
.lt |
Light | 300 |
.ta)| Class | Logic | Responsive Modifiers |
|---|---|---|
.ta |
Base Toggle | |
.ta-s |
Start (Left) | .ta-s--sm, .ta-s--md, .ta-s--lg |
.ta-c |
Center | .ta-c--sm, .ta-c--md, .ta-c--lg |
.ta-e |
End (Right) | .ta-e--sm, .ta-e--md, .ta-e--lg |
.ta-j |
Justify |
| Class | Value | Usage |
|---|---|---|
.lh--xs |
1 |
Headings / Tiles. Tight packing. |
.lh--s |
1.125 |
Tight text. |
.lh--m |
1.25 |
Default Title LH. |
.lh--l |
1.375 |
Relaxed. |
.lh--xl |
1.5 |
Default Body LH. Max readability. |
Don't write <h2 class="t--xl"> everywhere.
If your design system says H2s should always be XL, configure it in your theme:
:root {
/* Re-bind the H2 variable to the XL sizing variable */
--h2-fs: var(--t-fs--xl);
}
Now <h2 class="t"> is automatically XL.
Only use the classes (.t--xl) for exceptions (e.g., a specific marketing hero title that deviates from the system).
A common pattern is "Center on mobile, Left on desktop".
<h1 class="t ta-c ta-s--lg">
I am Center on small screens, Left on large screens.
</h1>
This reads: "Align Center by default. Align (Start) Left when container is Large."
For giant marketing headers, you often want:
.t--xxxl).lh--xs).up uppercase, .hl headline weight)<h1 class="t t--xxxl lh--xs up hl ta-c">
The Future is Fluid
</h1>
--title-font and --text-font.:root {
--title-font: 'Outfit', sans-serif;
--text-font: 'Inter', sans-serif;
}
.massive class:.t.massive {
--t-fs: 10rem; /* Static override */
--t-lh: 1;
}
Just set the variable; the .t class handles the application.Navigation: uCss > Source > Modules > Typography
License: MPL-2.0 Copyright: Β© 2025 Shukhrat (Alive π) β€» UNQA
src/lib/
βββ config/ # 1. CONFIGURATION (The Brain)
β βββ root/ # - Semantic Modules
β β βββ colors.css # - Palettes & Themes
β β βββ typography.css # - Fonts & Scales
β β βββ layout.css # - Radius & Spacing
β β βββ patterns.css # - Component Vars
β βββ adapters/ # - CMS Adapters
β β βββ blocksy.css # - Blocksy Theme
β β βββ gutenberg.css # - WordPress Block Editor
β βββ root.css # - Entry Point
β
βββ base/ # 2. BASE (The Foundation)
β βββ html/ # - HTML Engine
β β βββ reset.css # - Normalization
β β βββ typography.css # - Text Defaults
β β βββ flow.css # - Smart Flow Engine
β β βββ lists.css # - List Styles
β β βββ forms.css # - Input Styling
β β βββ helpers.css # - HTML Utilities
β βββ html.css # - Entry Point
β
βββ patterns/ # 3. PATTERNS (The Components)
β βββ button/ # - Atomic Component
β β βββ base.css
β β βββ group.css
β βββ card/ # - Card Component
β β βββ base.css
β β βββ content.css # - Slots & Padding
β β βββ media.css # - Full-bleed Media
β β βββ subgrid.css # - Subgrid Support
β βββ button.css # - Aggregator
β βββ card.css # - Aggregator
β βββ media.css # - Media Wrapper
β βββ link.css # - Link Wrapper
β βββ patterns.css # - Entry Point
β
βββ layout/ # 4. LAYOUT (The Skeleton)
β βββ grid/ # - Grid Engine
β β βββ base.css # - Core Logic
β β βββ columns.css # - Presets
β β βββ subgrid.css # - Smart Grid
β β βββ recipes.css # - Smart Logic (.masonry .g-row)
β β βββ item.css # - Child Logic
β βββ flex/ # - Flex Engine
β β βββ base.css # - Core Logic
β β βββ alignment.css # - Alignment Tools
β β βββ gaps.css # - Smart Gaps
β β βββ item.css # - Child Logic
β βββ container.css # - Container Queries (.c)
β βββ flex.css # - Entry Point
β βββ grid.css # - Entry Point
β βββ section.css # - Structural Layout
β
βββ theming/ # 5. THEMING (The Skin)
β βββ set.css
β βββ overlay.css
β
βββ typography/ # 6. TYPOGRAPHY (The Voice) <== YOU ARE HERE
β βββ title.css
β βββ text.css
β βββ text-align.css
β
βββ utilities/ # 7. UTILITIES (The Tools)
βββ display.css
βββ position.css
βββ overflow.css
βββ margin.css
βββ padding.css
βββ radius.css
βββ size.css # - Size Utilities
βββ blur.css
βββ utilities.css