Skip to content

Search Feitio

↵ opens the first↑↓ chooseEsc closes

Tokens

The names of every Feitio value: where they come from, how to use them in CSS and TypeScript, and the full list.

On this page

What they are

Every Feitio value (color, space, type, corner, duration) is a named token. Nobody writes a value by hand: you write the name, and the value comes from the theme and mode.

Where they come from

How to use

CSS

CSS
.minha-area {
  padding: var(--feitio-space-5) var(--feitio-space-4);
  border-radius: var(--feitio-radius);
  background: var(--feitio-color-surface-raised);
}

TypeScript

js/tokens.ts exports every name with its variable, and the TokenName type: a wrong name does not compile.

TypeScript
import { tokens, type TokenName } from '@feitio/core/js/tokens.ts';

const gap: TokenName = 'space.4';
element.style.gap = tokens[gap];   // 'var(--feitio-space-4)'

The base tokens

The same in every theme and mode.

TokenValueGroup
--feitio-font-text"Alegreya", "Georgia", serifType
--feitio-font-ui"Alegreya Sans", "Gill Sans", sans-serifType
--feitio-font-weight-regular400Type
--feitio-font-weight-medium500Type
--feitio-font-weight-bold700Type
--feitio-font-weight-heavy800Type
--feitio-font-size-small1remType
--feitio-font-size-body1.25remType
--feitio-font-size-h31.5remType
--feitio-font-size-h22remType
--feitio-font-size-h12.75remType
--feitio-font-size-display4remType
--feitio-line-height-text1.6Line height
--feitio-line-height-heading1.08Line height
--feitio-space-10.25remSpace
--feitio-space-20.5remSpace
--feitio-space-31remSpace
--feitio-space-41.5remSpace
--feitio-space-52.5remSpace
--feitio-space-64remSpace
--feitio-space-76remSpace
--feitio-measure-reading46remMeasure
--feitio-radius-top-left6pxCorners
--feitio-radius-top-right10pxCorners
--feitio-radius-bottom-right6pxCorners
--feitio-radius-bottom-left8pxCorners
--feitio-border-width1pxStroke
--feitio-focus-width3pxFocus
--feitio-focus-offset3pxFocus
--feitio-duration-place260msDuration
--feitio-duration-change320msDuration
--feitio-easing-placecubic-bezier(0.2, 0.9, 0.3, 1.25)Easing
--feitio-easing-changecubic-bezier(0.3, 0, 0.2, 1)Easing

The color roles

The home theme values, by day and at night. A facade fills the same names with other values.

TokenDayNight
--feitio-color-surfaceoklch(96% 0.018 80)oklch(22% 0.016 55)
--feitio-color-surface-raisedoklch(92.5% 0.026 76)oklch(27.5% 0.02 55)
--feitio-color-surface-topoklch(98.5% 0.01 85)oklch(31% 0.022 55)
--feitio-color-textoklch(26% 0.022 55)oklch(93% 0.022 80)
--feitio-color-text-softoklch(46% 0.025 55)oklch(76% 0.03 72)
--feitio-color-accentoklch(54% 0.165 40)oklch(54% 0.165 40)
--feitio-color-accent-strongoklch(50% 0.16 38)oklch(77% 0.15 52)
--feitio-color-on-accentoklch(97% 0.015 80)oklch(97% 0.015 80)
--feitio-color-lineoklch(26% 0.022 55 / 0.15)oklch(93% 0.022 80 / 0.15)
--feitio-color-shadowoklch(26% 0.022 55 / 0.9)oklch(12% 0.01 55 / 0.95)
--feitio-color-okoklch(45% 0.09 140)oklch(78% 0.1 140)
--feitio-color-ok-surfaceoklch(91% 0.04 135)oklch(30% 0.04 140)
--feitio-color-warnoklch(50% 0.1 85)oklch(83% 0.11 88)
--feitio-color-warn-surfaceoklch(92% 0.06 90)oklch(32% 0.05 85)
--feitio-color-erroroklch(45% 0.15 15)oklch(76% 0.12 15)
--feitio-color-error-surfaceoklch(91% 0.04 15)oklch(31% 0.06 15)

Rules

Top