Tokens

The few values every component shares: the colours, the border width and the radius. Redeclare one and the whole kit follows.

How tokens work

Each token is a --margo-* custom property, and the components read it directly. To change one, redeclare it after the kit's import:

css
/* after @import "margo-ui/css" */
:root {
  --margo-color-primary: #4f8cff;
  --margo-color-primary-darken: #2f6ad9;
  --margo-radius: 0.75rem;
}

.dark {
  --margo-color-primary: #7aa9ff;
  --margo-color-primary-darken: #4f8cff;
}

Colours

Colours are named by role, not by hue: main is the page, on-main is what sits on it.

tokenvalue
--margo-color-main#f3f3f3light#151515darkpage background
--margo-color-on-main#151515light#f3f3f3darktext and icons on main
--margo-color-neutral#fffffflight#000000darkthe far end of the theme: white in light, black in dark
--margo-color-on-neutral#000000light#ffffffdarktext and icons on neutral
--margo-color-primary#9c0ea3light#57e550darkthe accent: active and focused states, glows
--margo-color-primary-darken#7d0b82light#45b93fdarkthe darker accent, and the other end of primary gradients
--margo-color-lowon-main 3.5% in mainlighton-main 2.5% in maindarkquiet fills, like the background of Item and Input
--margo-color-low-alphaon-main 3.5%, translucentlighton-main 2.5%, translucentdarkthe same fill, for surfaces other than main
--margo-color-medium#808080light#999999darkmuted text and icons at rest
--margo-color-border#cececelight#2c2c2cdarkborders

Border and radius

There is one border width and one radius. The kit derives three smaller corners from the radius, so changing it moves every corner and keeps the proportions.

tokenvalue
--margo-border1.5pxthe width of every border in the kit
--margo-radius0.5remthe largest corner; the smaller ones follow
--margo-radius-sm0.375remradius × 3/4; derived
--margo-radius-xs0.25remradius / 2; derived
--margo-radius-mc0.125remradius / 4; derived

Light and dark

The light values are declared on :root, the dark ones on .dark. Components turn dark when .dark is on them or on an ancestor, usually the html element. When you change a colour, change it in both blocks.