Version 2 is a modular CSS typography system that replaces traditional element-based styling with customizable, class-based controls. It offers precise management of font sizes, weights, spacing, and responsive behavior through intuitive classes (.h1-.h6, .body-sm/md/lg) and CSS variables, ensuring perfect typographic rhythm across all devices.
Typescale v2 is a complete redesign of our typography system that:
The system uses a modular scale based on:
--class-font-body
: Base font size (default: 18px)--class-scale-ratio
: Scaling ratio (default: 1.2)This creates harmonious relationships between all text elements.
Independent control over:
Each with their own size, weight, line-height, color and letter-spacing.
Variable | Default | Description |
---|---|---|
--class-font-body |
18px | Base font size for body text |
--class-scale-ratio |
1.2 | Multiplier for type scale |
Variable | Default | Description |
---|---|---|
--class-heading-font |
Arial, sans-serif | Font family for all headings |
--class-heading-weight |
700 | Font weight for all headings |
--class-heading-leading |
1.2 | Line-height for headings |
--class-heading-color |
inherit | Text color for headings |
--class-heading-tracking |
-0.02em | Letter-spacing for headings |
Variable | Default | Description |
---|---|---|
--class-body-font |
Arial, sans-serif | Font family for all body text |
--class-body-weight |
400 | Font weight for body text |
--class-body-leading |
1.6 | Line-height for body text |
--class-body-color |
inherit | Text color for body text |
--class-body-tracking |
0 | Letter-spacing for body text |
.h1
.h2
.h3
.h4
.h5
.h6
Large body text
.body-lg
Regular body text (default)
.body-md
Small body text
.body-sm
:root {
/* Base settings */
--class-font-body: 17px;
--class-scale-ratio: 1.25;
/* Heading settings */
--class-heading-weight: 800;
--class-heading-leading: 1.3;
--class-heading-color: #2a2a2a;
--class-heading-tracking: -0.03em;
/* Body settings */
--class-body-weight: 350;
--class-body-leading: 1.7;
--class-body-color: #444;
--class-body-tracking: 0.01em;
}
@media (max-width: 1024px) {
:root {
--class-font-body: 16px;
--class-scale-ratio: 1.2;
--class-heading-leading: 1.25;
}
}
@media (max-width: 768px) {
:root {
--class-font-body: 15px;
--class-body-leading: 1.8;
--class-heading-tracking: -0.01em;
}
}