Restyle with CSS
The built-in styles take their colors, corners and spacing from CSS variables. Their rules have no specificity, so you never need !important. There are two levels: tokens change every style at once, and style variables change one style.
/* Every style: Forma's highlight color */
:root {
--forma-brand: #6d5cff;
}
/* One style: square cards with larger titles */
.forma--skin-default {
--forma-skin-default--radius: 0;
--forma-skin-default--title-font-size: 22px;
}
/* One layout: in that layout's Custom CSS */
selector {
--forma-skin-fade--overlay-background: rgba(0, 0, 0, .6);
}
Tokens
Set them anywhere, for example on :root, or on a dark section so its grids turn dark too.
| Token | Used for | Default |
|---|---|---|
--forma-surface | Cards, chips, page buttons | #fff |
--forma-surface-alt | Count badges, the progress track, an empty image | #e9e6e0 |
--forma-line / --forma-line-strong | Hairlines; borders on hover | #d6d2c9 / #8a867e |
--forma-ink / --forma-ink-muted | Text; meta, counts, summaries | #161614 / #5e5b55 |
--forma-ink-inverse | Text on an ink fill (active chip, current page) | #f4f2ee |
--forma-brand / --forma-on-brand | Forma’s color (highlights, focus rings) and the text on it | #ff5a3c / #fff |
--forma-radius-sm / -md / -lg | Badges; card media; card frame | 10px / 16px / 24px |
--forma-shadow | A card on hover | a soft drop shadow |
--forma-ease | The easing of hover and entrance movements | cubic-bezier(.2, .7, .2, 1) |
There is no font token. Every style uses the theme’s font, and the card styles take the theme’s text color, so a card looks like the rest of the theme with Forma’s color as the highlight.
Style variables
Each is named --forma-{kind}-{style}--{name} and defaults to the tokens. Set it on the style’s scope or anything inside it.
| Style | Scope | Variables (after --forma-{kind}-{style}--) |
|---|---|---|
| Default skin | .forma--skin-default | radius, card-padding, card-background, card-border-color, card-border-color-hover, card-shadow-hover, card-lift-hover, media-background, media-radius, zoom, filter, content-x, body-padding, body-gap, meta-color, meta-font-size, title-font-size, title-line-height, tag-color, tag-border-color, tag-radius, arrow-size, arrow-color, arrow-background, dot-color, dot-color-active, focus-color, nav-* (slider arrows) |
| Fade skin | .forma--skin-fade | radius, card-background, zoom, filter, overlay-background, overlay-padding, content-x, content-y, text-color, meta-color, meta-font-size, title-font-size, tag-background, tag-border-color, focus-color |
| Filter chips | .forma__filters | gap, count-color, count-background, count-color-active, count-background-active, chip-* |
| Filter dropdown | .forma__filters | select-* |
| Search | .forma__search | width, icon-color, placeholder-color, border-color-focus, spinner-color, spinner-track, field-* |
| Sort buttons | .forma__sort | gap, option-* |
| Sort dropdown | .forma__sort | select-* |
| Pagination | .forma__pagination | count-color, count-color-strong, progress-height, progress-color, progress-track, button-height, button-color, button-background, button-radius, button-done-color, button-done-background, focus-color, page-* |
All nine card styles work this way. Each lists its variables in templates/skins/{style}/_variables.scss, and its settings in the Skin section set them for one layout.
Pills
Every pill (chip-, select-, field-, option-, page-, nav-) has the same set of variables: height, font-size, font-weight, color, background, border-color, border-color-hover, radius, color-active, background-active, focus-color.
.forma__filters {
--forma-filter-default--chip-height: 38px;
--forma-filter-default--chip-radius: 4px;
}
Turn off Forma’s CSS
To style everything in your theme, return false from forma_default_styles, for everything or for one kind of style:
// No Forma CSS at all
add_filter( 'forma_default_styles', '__return_false' );
// Keep the controls' look, drop the card styles'
add_filter( 'forma_default_styles', fn( $load, $kind ) => 'skins' !== $kind, 10, 2 );