CSS variables
Every value in Iris CSS comes from a --i- custom property. Change one and everything that reads it follows.
Classes have no prefix, but custom properties are global and inherited. The
--i- prefix keeps them clear of your own variables and of other
libraries.
Change a value everywhere
Set the variable on :root in your own stylesheet. It wins over Iris without !important, see cascade layers.
:root {
--i-border-radius: 0.5rem;
--i-spacing: 1.25rem;
--i-font-family: "Inter", var(--i-font-sans);
}
Change a value in one place
Set it on any element. Only that element and its children see the new value.
Theme colors
Colors that change with the theme are light-dark() pairs. Override
them with a pair of your own, or with one value to use it in both themes. See
themes for the full list.
:root {
--i-color-primary: light-dark(#6d28d9, #a78bfa);
}
Naming
- Owner first
--i-{owner}-{part}-{state}-{property}, for example--i-navbar-brand-font-sizeor--i-table-row-hover-color-background. Part and state are optional.- Colors end in a role
color-text,color-background,color-borderorcolor-outline, for example--i-input-color-border.- Global tokens start with a category
--i-color-primary,--i-font-family,--i-spacing,--i-border-radius. Many elements read them.- Private variables
- Names that start with
--_switch values inside one element. They are not part of the API and can change at any time.
Global variables
The tokens below are read across the framework. Each element and component page ends with a table of its own variables.
Typography
| Variable | Default |
|---|---|
--i-font-emojiFont stacks: each platform's system font, then generic fallbacks | "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Twemoji Mozilla", "Noto Color Emoji" |
--i-font-sans | system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", sans-serif, var(--i-font-emoji) |
--i-font-mono | ui-monospace, "Cascadia Mono", SFMono-Regular, Menlo, Consolas, "Roboto Mono", "Liberation Mono", "Courier New", monospace, var(--i-font-emoji) |
--i-font-family | var(--i-font-sans) |
--i-line-heightBase text. The root size starts at the size the user set in the browser and grows to 112.5% between a 576px and a 1280px wide viewport. | 1.5 |
--i-font-weight | 400 |
--i-font-size | clamp(100%, 89.75% + 0.285svw, 112.5%) |
--i-text-underline-offset | 0.125em |
Spacing
| Variable | Default |
|---|---|
--i-spacing | 1rem |
--i-typography-spacing | 1rem |
--i-section-spacing-block | var(--i-spacing) |
--i-section-spacing-inline | var(--i-spacing) |
Borders
| Variable | Default |
|---|---|
--i-border-radius-smallBorder radius scale | 0.125rem |
--i-border-radius | 0.25rem |
--i-border-radius-medium | 0.375rem |
--i-border-radius-large | 0.5rem |
--i-border-radius-xlarge | 0.75rem |
--i-border-radius-pill | 9999px |
--i-border-widthBorder widths | 0.0625rem |
--i-focus-ring-width | 0.125rem |
Motion
| Variable | Default |
|---|---|
--i-durationTransitions | 0.2s |
--i-easing | ease-in-out |
Icons
SVG data URIs with the color baked in. Replace the whole value to change an icon or its color.
| Variable | Default |
|---|---|
--i-svg-checkmark | url("data:image/svg+xml,…") |
--i-svg-chevron-down | url("data:image/svg+xml,…") |
--i-svg-close | url("data:image/svg+xml,…") |
--i-svg-dash | url("data:image/svg+xml,…") |
--i-svg-date | url("data:image/svg+xml,…") |
--i-svg-invalid | url("data:image/svg+xml,…") |
--i-svg-loading | url("data:image/svg+xml,…") |
--i-svg-menu | url("data:image/svg+xml,…") |
--i-svg-search | url("data:image/svg+xml,…") |
--i-svg-time | url("data:image/svg+xml,…") |
--i-svg-valid | url("data:image/svg+xml,…") |