Typography & Colors
The size scale is fluid - sizes grow with the window width, no media queries. This page lists the entire scale, weights, colors, and text effects. Ready-made showcases: examples.
1. The size scale
Every size is a clamp(): a minimum, a fluid, and
a maximum value. Text doesn't jump at breakpoints, it grows
gradually - that's why there isn't a single font media query
anywhere in the framework.
The reference point is .text-3
- the paragraph size. Everything below is metadata, everything
above is headings and hero text.
| Class | Matches | For what |
|---|---|---|
.text-xs |
10px | Legal notes. The smallest size in the system. |
.text-sm |
11px | Microcopy, captions under graphics. |
.text-1, .text-2 |
12-13px | Metadata, timeline dates, labels. |
.text-3 |
base |
The paragraph size. The same as
.text-base.
|
.text-base |
base | Resets back to the base size - useful inside an element that already changed the scale. |
.text-4 - .text-8 |
H5 → H1 |
Headings. .text-8 matches H1,
.text-4 matches H5.
|
.text-9 - .text-12 |
up to 9rem | Hero text, huge numbers, the 404 page. |
Size is not the same as meaning
<h1>-<h6> tags already
have their own sizes and don't need
classes. Use .text-* classes when you
want to change appearance, not hierarchy - e.g.
giving an H2 the size of an H4 because it sits in a narrow
column. Never the other way around: don't pick
<h3> over <h1> just
because it's smaller.
2. Weights and typeface
| Class | Weight | For what |
|---|---|---|
.fw-light |
300 | Secondary text, captions. |
.fw-normal |
400 | The default text weight. |
.fw-medium |
500 | A light emphasis: labels, menu items. |
.fw-semibold |
600 | Headings on marketing pages. The token existed from the start; the class was missing until 1.7.32. |
.fw-bold |
700 | Headings, in-text emphasis. |
.fw-black |
900 | Hero text, large dashboard numbers. |
| Class | What it does |
|---|---|
.text-uppercase |
UPPERCASE. Also .text-lowercase and
.text-capitalize.
|
.text-decoration-none |
Removes the underline - typically from a link meant to look like a button. |
.text-decoration-underline |
Adds an underline. |
.text-decoration-line-through |
Strikethrough - e.g. an old price. |
.text-nowrap |
Text does not wrap to a new line, e.g. an amount with its currency in a narrow table column. |
.text-start |
Alignment: .text-center,
.text-end, .text-justify, plus
the .text-md-start,
.text-md-center,
.text-md-end variants.
.text-left and .text-right
(plus .text-md-left /
.text-md-right) are
aliases of .text-start /
.text-end - they exist so code pasted in
from elsewhere doesn't silently lose its alignment.
Prefer the start/end spelling
in new markup.
|
3. Colors
Three families with a shared naming scheme:
text- for text, bg- for
background, border- for a border. Plus
-subtle (a dimmed background) and
-hover (change on hover) variants.
| Family | Variants | Notes |
|---|---|---|
.text-primary |
.text-secondary, .text-success,
.text-danger, .text-warning,
.text-info, .text-dark,
.text-light, .text-white
|
.text-dark and .text-light
flip in dark mode - see pitfall #1.
|
.text-main |
.text-muted |
Semantic content colors: primary and dimmed. Usually a
better choice than .text-dark.
|
.bg-primary |
.bg-secondary, .bg-success,
.bg-danger, .bg-warning,
.bg-info, .bg-dark,
.bg-light, .bg-body,
.bg-surface, .bg-transparent
|
Full backgrounds, at full saturation. |
.bg-primary-subtle |
.bg-secondary-subtle,
.bg-success-subtle,
.bg-danger-subtle,
.bg-warning-subtle,
.bg-info-subtle,
.bg-dark-subtle,
.bg-light-subtle,
.bg-body-subtle,
.bg-surface-subtle,
.bg-white-subtle
|
A background at a few percent opacity - for text in the same color. Typical for status badges. |
.text-hover-*,
.bg-hover-*,
.border-hover-*
|
Each family has ten colors:
primary, secondary,
success, danger,
warning, info,
dark, light,
surface, body - e.g.
.text-hover-primary,
.bg-hover-danger,
.border-hover-success.
|
The scheme is WHAT-hover-COLOR,
not the other way around. Don't add them to
.btn - see pitfall #3.
|
When to use -subtle
A full .bg-danger shouts and requires white
text. .bg-danger-subtle gives a gentle
background against which .text-danger works -
more readable in a table with dozens of such markers. Use
the full color where you really want to grab attention.
4. Text effects
They all animate only properties computed by the GPU. Three of them need data from the markup - without it they have nothing to show.
| Class | Effect | Requires |
|---|---|---|
.hover-underline |
An underline sliding in from the left. | - |
.hover-underline-center |
The same, but spreading from the center. | - |
.text-highlight |
A highlighter marker sliding under the text on hover. | - |
.hover-text-wipe |
A color washing over the text from the left. | - |
.text-gradient-animated |
A gradient sliding across the letters. |
Colors: --gradient-color-1,
-2, -3.
|
.text-clip-bg |
A photo visible through the shape of the letters. |
--clip-img - without it, the
letters are empty.
|
.typewriter |
Text typed out character by character. |
The molique-text-effects.js module (auto-loaded).
|
Text cutting through a background
The letters act as a window onto the photo underneath. The
effect doesn't rely on clipping the background to the letters
- it uses mix-blend-mode: the container has the
photo, and the text has a color that the blend mode turns
into transparency. That's why the colors in these
classes are literal and must not be changed - they're
what drives the mechanism.
<div class="bg-knockout-wrapper" style="background-image: url(photo.jpg)">
<h2 class="text-knockout-light text-12 fw-black text-center">MOLIQUE</h2>
</div>
| Class | What it does |
|---|---|
.bg-knockout-wrapper |
The container with the photo. Pass the image via
background-image.
|
.text-knockout-light |
A white background, transparent letters. For light photos. |
.text-knockout-dark |
A black background, transparent letters. For dark photos. |
5. Pitfalls
1
.text-dark on a photo
--dark is the color that
contrasts with the background, not
"dark." In dark mode it flips to light - and
.text-dark along with it. Used on an
element sitting on a photo, whose background doesn't
change, this gives white text on a light photo.
<!-- WRONG - in dark mode the text disappears on the photo -->
<p class="text-dark">Caption on a photo</p>
<!-- RIGHT - a color independent of the theme -->
<p class="text-white">Caption on a photo</p>
For regular content, use .text-main and
.text-muted - they're semantic and are
meant to flip.
2 Choosing a tag by its size
Picking <h3> over
<h1> because it's "too big" breaks the
document structure: screen readers build a table of
contents from headings, and search engines read the
hierarchy from them. Pick the tag by
meaning, set the size with a
.text-* class.
<!-- WRONG - a lower level just for the look -->
<h3>Page title</h3>
<!-- RIGHT - the level stays, the size changes -->
<h1 class="text-6">Page title</h1>
3 An inverted hover class name
The scheme is WHAT-hover-COLOR:
text-hover-primary,
bg-hover-danger,
border-hover-success. The reversed order
(hover-text-primary) won't work - such
classes existed in older releases and were removed in
1.7.0 precisely because they broke the scheme.
A separate issue: don't add these classes to
.btn. A button has its own hover
color from its variant, so the two rules compete.
Change --primary-hover instead.
4 Changing colors in knockout classes
In .text-knockout-light and
-dark, the colors are literal
(white/black), and they're what drives the
effect - the blend mode turns one of them into
transparency. Swapping it for a brand color means the
letters stop being a window onto the photo and become
plain text instead.