Skip to content
Okaapiأوكابي
Framework for the code
Theme
Okaapi on GitHub

Chapter 02 Foundations

Colour

Two brand colours, three neutrals, and product shades tuned until small text reaches 7:1.

Brand

The core palette, as is: fills, the logo and large text only.

TokenValueTailwindForSample
--ui-brand-blue#0059FFbg-brand-blueLogo and large fills. Primary in product UI.
--ui-brand-red#DC4B4Bbg-brand-redLogo and large fills. Danger in product UI.
--ui-ink#0B1020bg-inkDark ground and text.
--ui-paper#F6F7FBbg-paperLight ground.
--ui-slate#586087bg-slateLabels, secondary text, borders.

Product tokens

Use these in product code, never a hex: dark mode follows.

TokenValueTailwindForSample
--ui-bg#f6f7fb · #0b1020bg-bgThe page.
--ui-surface#ffffff · #151b30bg-surfaceCards, fields, floating layers.
--ui-text#0b1020 · #f6f7fbtext-textBody text.
--ui-text-muted#454c6e · #c9cee3text-text-mutedHints and secondary text, 7:1.
--ui-border#586087 · #9fa5c0border-borderField and control edges, 3:1.
--ui-divider#e4e7f2 · #262d48border-dividerLines between rows. Not an edge.
--ui-primary#0047cc · #8fb4ffbg-primaryThe main action, links, selection.
--ui-on-primary#ffffff · #0b1020text-on-primaryText on primary.
--ui-secondary#e4e7f2 · #232a45bg-secondaryQuiet buttons, tracks.
--ui-on-secondary#0b1020 · #f6f7fbtext-on-secondaryText on secondary.
--ui-highlight#dbe6ff · #1d3a8abg-highlightSelected row, info badge.
--ui-on-highlight#0b1020 · #f6f7fbtext-on-highlightText on highlight.
--ui-focus#0047cc · #8fb4ffoutline-focusThe keyboard ring.
--ui-danger#9a1d1d · #f2a3a3bg-dangerErrors, destructive actions.
--ui-on-danger#ffffff · #0b1020text-on-dangerText on danger.
--ui-danger-soft#fdeeee · #3a1418bg-danger-softError alert and badge ground.
--ui-success#14532d · #86efacbg-successDone, saved, paid.
--ui-on-success#ffffff · #0b1020text-on-successText on success.
--ui-success-soft#e3f5e9 · #0f2e1cbg-success-softSuccess alert and badge ground.
--ui-warning#7a3a0a · #fcd34dbg-warningNeeds a look, not broken.
--ui-on-warning#ffffff · #0b1020text-on-warningText on warning.
--ui-warning-soft#fdf1dc · #33260abg-warning-softWarning alert and badge ground.
--ui-backdroprgb(11 16 32 / 0.6)bg-backdropBehind a dialog, both themes.

Contrast, measured live

Each pair measured in the theme on screen: 7:1 text, 3:1 edges.

Text on background--ui-text on --ui-bg…:1 · fails 7:1
Text on surface--ui-text on --ui-surface…:1 · fails 7:1
Muted text--ui-text-muted on --ui-surface…:1 · fails 7:1
Primary--ui-on-primary on --ui-primary…:1 · fails 7:1
Secondary--ui-on-secondary on --ui-secondary…:1 · fails 7:1
Highlight--ui-on-highlight on --ui-highlight…:1 · fails 7:1
Danger--ui-on-danger on --ui-danger…:1 · fails 7:1
Danger, soft--ui-danger on --ui-danger-soft…:1 · fails 7:1
Success--ui-on-success on --ui-success…:1 · fails 7:1
Success, soft--ui-success on --ui-success-soft…:1 · fails 7:1
Warning--ui-on-warning on --ui-warning…:1 · fails 7:1
Warning, soft--ui-warning on --ui-warning-soft…:1 · fails 7:1
Border on surface--ui-border on --ui-surface…:1 · fails 3:1
Focus ring on background--ui-focus on --ui-bg…:1 · fails 3:1

Try a primary colour

Re-brand with one token; the ratio says if small text still reads.

219°40%

One token re-colours every action

White on hsl(219 100% 40%): …:1, fails 7:1.

Angular
:root {
  --ui-primary: hsl(219 100% 40%);
  --ui-on-primary: #ffffff;
}
/* bg-primary, text-primary and every kit component follow */

Rules

  • Brand blue and red: fills and large text only, never small text.
  • Red means errors and destructive actions, nothing else.
  • No hex in product code: --ui-* tokens only.