Skip to content

Design tokens ​

Every value in @surgijs/ui/themes.css comes from the token files in packages/ui/tokens, and the same files produce the Figma token sets in packages/ui/tokens/figma. A Figma variable takes the token path as its name, so color/primary-hover is --s-color-primary-hover in CSS.

Light values apply by default. Dark values apply under data-theme="dark" or, without a data-theme on the root, when the OS prefers dark.

Typography ​

TokenValueUsed for
--s-font-familysystem-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serifText in components.
--s-font-size-sm0.875remSmall text: the sm size of components.
--s-font-size-md1remDefault text size of components.
--s-font-size-lg1.125remLarge text: the lg size of components.
--s-font-weight-medium500Button labels.

Corners ​

TokenValueUsed for
--s-radius-sm4pxSmall corners.
--s-radius-md6pxDefault corners of components.
--s-radius-lg8pxLarge corners.
--s-radius-full999pxPill-shaped corners.

Motion ​

TokenValueUsed for
--s-duration-fast120msHover and press transitions.

Color ​

TokenLightDarkUsed for
--s-color-primary #3451d1 #4263ebPrimary backgrounds.
--s-color-primary-hover #2a43b3 #3b5bdbPrimary backgrounds on hover.
--s-color-primary-active #223896 #364fc7Primary backgrounds while pressed.
--s-color-primary-text #3451d1 #91a7ffPrimary-colored text on surfaces.
--s-color-on-primary #ffffff #ffffffText on primary backgrounds.
--s-color-danger #c92a2a #c92a2aDestructive action backgrounds.
--s-color-danger-hover #a51f1f #b02525Destructive action backgrounds on hover.
--s-color-danger-active #861818 #962020Destructive action backgrounds while pressed.
--s-color-on-danger #ffffff #ffffffText on danger backgrounds.
--s-color-surface #ffffff #1f2126Neutral backgrounds.
--s-color-surface-hover #f1f3f5 #2a2d34Neutral backgrounds on hover.
--s-color-surface-active #e3e7eb #353943Neutral backgrounds while pressed.
--s-color-text #1c1f26 #e9ecefText on surfaces.
--s-color-border #c4c9d2 #4a505cOutlines.
--s-color-focus #4c6ef5 #748ffcFocus rings.

MIT License