Pattern
Fill empty or reserved areas with hatch, dots, grid, or checker. The lines are a quiet mix of the foreground color, so they fit light and dark.
pattern-hatch pattern-gap-2Install
Add the utility's CSS with the CLI, your coding agent, or by hand. It has no JavaScript.
Usage
Put the class on the area to fill. Change the distance with pattern-gap-<n>, and the color with --pattern-color.
Patterns
Four fills. Each one reads the same color and gap variables, so one set of options tunes them all.
- Hatch
pattern-hatchReserved, blocked, or not bookable time and space.
- Dots
pattern-dotsCanvas and drop zones: an area that waits for content.
- Grid
pattern-gridEditors and boards. A darker line every 5 cells helps the eye.
- Checker
pattern-checkerBehind a see-through image or color, so the alpha shows.
Color
With no value, the lines are a quiet mix of the foreground color, so they fit light and dark. Set --pattern-color for a colored fill.
- Default: the foreground mix
- Blue
- Green
- Red
Grid majors
On a grid, a darker line marks every few cells, like graph paper. Set the step, or remove it.
pattern-grid-major-4pattern-grid-major-8pattern-grid-major-none
Options
The modifier classes and the variables of the utility. Set a variable with an arbitrary property, such as [--pattern-color:var(--primary)].
| Name | Kind | Default | Description |
|---|---|---|---|
pattern-gap-<n> | class | 6 · 8 · 16px | The distance from one line, dot, or cell to the next: n steps of the spacing scale. The default differs per pattern. |
pattern-grid-major-<n> | class | 5 | A darker grid line every n cells. pattern-grid-major-none removes it. |
--pattern-color | variable | foreground mix | The line, dot, or cell color. With no value, a quiet mix of the foreground color. |
--pattern-major-color | variable | foreground mix | The color of the darker grid line. |
--pattern-checker-color | variable | 12% · 16% | The checker cell color, in light and dark. Stronger in dark, so a see-through color still reads. |
- Materials
material-brushed-aluminumMetal, glass, stone, and cloth surfaces that catch the light.
- Shape
shape-zigzagCut the edges or corners of any box: zigzag, scallop, notch.
- Glow
glowA soft halo in the element's own color, for bars and lines.
- Typeset
typesetOne class styles the plain HTML of an article or a page.
- Shimmer
shimmerA light sweep for skeletons and loading text, in sync.
- Scroll Fade
scroll-fadeFade the edges of a scroll area, only where it can scroll.