Skip to Content
CodeUI

Colour

@codeui/inkstone v0.3.0

Palette swatches, theme tokens, and rules for using colour in Inkstone.

Colour palette

Light and Dark use one grey ramp. Blue covers primary actions and focus. Red, orange, and green cover status. Components use the CSS tokens in Theme roles. The numbered steps are for theme authors.

Shared greys

  • gray.50#ffffff
  • gray.100#fafafa
  • gray.150#f1f1f1
  • gray.250#e6e6e6
  • gray.300#dcdcdc
  • gray.350#cccccc
  • gray.400#bbbbbb
  • gray.450#aaaaaa
  • gray.550#8c8c8c
  • gray.600#666666
  • gray.650#535353
  • gray.700#373737
  • gray.750#292929
  • gray.850#252525
  • gray.900#1c1c1c
  • gray.950#111111

Accent blue

  • blue.25#f4f9ff
  • blue.50#d6e9fc
  • blue.100#b8d8f6
  • blue.200#91c6f2
  • blue.300#63b3ed
  • blue.400#3495e1
  • blue.500#0076cf
  • blue.600#0068b9
  • blue.700#004f8e
  • blue.800#053865
  • blue.900#082440
  • blue.950#011227

Danger red

  • red.25#fff6f5
  • red.50#ffdeda
  • red.100#fec3bf
  • red.200#ffa4a0
  • red.300#fc8181
  • red.400#e45857
  • red.500#c53030
  • red.600#b52b2b
  • red.700#9b2c2c
  • red.800#6b2321
  • red.900#411816
  • red.950#240706

Caution orange

  • orange.25#fff7f0
  • orange.50#ffead7
  • orange.100#fedbbd
  • orange.200#ffc999
  • orange.300#ffb570
  • orange.400#faa043
  • orange.500#f08c00
  • orange.600#d77d00
  • orange.700#bd6e00
  • orange.800#7f4b0d
  • orange.900#4a2b0a
  • orange.950#1e0d00

Success green

  • green.25#ecfef1
  • green.50#ddf3e3
  • green.100#c6ead1
  • green.200#aae1bc
  • green.300#89d6a4
  • green.400#67ca8d
  • green.500#48bb78
  • green.600#38a169
  • green.700#2f855a
  • green.800#215b3c
  • green.900#123622
  • green.950#001708
Theme roles
CSS tokenLightDark
surface.page--cui-surface-panelgray.100#fafafagray.900#1c1c1c
surface.island--cui-surface-canvasgray.150#f1f1f1gray.950#111111
surface.field--cui-surface-inputgray.250#e6e6e6gray.750#292929
surface.fieldHover--cui-surface-field-hovergray.300#dcdcdcgray.700#373737
surface.floating--cui-surface-dialoggray.50#ffffffgray.850#252525
text.default--cui-text-defaultgray.900#1c1c1cgray.150#f1f1f1
text.muted--cui-text-mutedgray.650#535353gray.450#aaaaaa
accent.focus--cui-accent-focusblue.600#0068b9blue.300#63b3ed
action.brand.base--cui-action-brand-baseblue.500#0076cfblue.500#0076cf
action.danger.base--cui-action-danger-basered.500#c53030red.500#c53030
action.danger.hover--cui-action-danger-hoverred.600#b52b2bred.600#b52b2b
action.danger.active--cui-action-danger-activered.700#9b2c2cred.700#9b2c2c
action.caution.base--cui-action-caution-baseorange.500#f08c00orange.500#f08c00
action.caution.hover--cui-action-caution-hoverorange.600#d77d00orange.600#d77d00
action.caution.active--cui-action-caution-activeorange.700#bd6e00orange.700#bd6e00
action.success.base--cui-action-success-basegreen.500#48bb78green.500#48bb78
action.success.hover--cui-action-success-hovergreen.600#38a169green.600#38a169
action.success.active--cui-action-success-activegreen.700#2f855agreen.700#2f855a
text.danger--cui-text-dangerred.500#c53030red.300#fc8181

Use colours by role

  • Build the surface hierarchy. Use --cui-surface-panel for the page, --cui-surface-canvas inside it, and --cui-surface-input for fields and tiles on the island. Use --cui-surface-dialog for floating UI.
  • Pair the surface with its text. Use --cui-text-default for titles and values. Use --cui-text-muted for descriptions and metadata.
  • Keep selected rows neutral. Use --cui-surface-field-hover and primary text. For a selected card, add an accent ring as well as the fill change.
  • Reserve a filled accent for one primary action per surface. Pair --cui-action-brand-base with --cui-action-brand-text. Use --cui-focus-color for keyboard focus.
  • Use status colours for feedback. Use --cui-action-danger-base for destructive confirmation, --cui-action-caution-base for risk, and --cui-action-success-base for a positive outcome. Pair status colour with a label or icon.
  • Check new colour pairs in both themes. Use at least 4.5:1 for normal text and 3:1 for large text, focus rings, and visual cues needed to identify controls or states.
  • Keep raw colours in theme definitions and swatch references. Use var(--cui-…) in component styles so a theme change reaches the component.

Apply the tokens in CSS

This example uses a neutral selection for an export format and a single filled export action. Use the appropriate selection semantics for the control and include a visible selected indicator.

.export-island {
	background-color: var(--cui-surface-canvas);
	color: var(--cui-text-default);
}

.export-format[aria-selected="true"] {
	background-color: var(--cui-surface-field-hover);
	color: var(--cui-text-default);
}

.export-action {
	background-color: var(--cui-action-brand-base);
	color: var(--cui-action-brand-text);
}

.export-action:focus-visible {
	outline: var(--cui-focus-width) solid var(--cui-focus-color);
	outline-offset: var(--cui-focus-offset);
}

Preview the palette

Choose Theme to see the kit’s default light or dark tokens. The preview sets data-cui-theme on its surface.

Export
Format
PNG
JPEG✓
Save image1920 × 1080 pxExport

Generate the palette and theme tokens

Gosfuig generates the ramps from packages/inkstone/tokens/inkstone.palette.json. The Inkstone build writes palette.tokens.json, then Toghen resolves the semantic aliases for each mode. The resulting @codeui/inkstone/theme.css is the default theme in the Solid kit. Gosfuig

Use @codeui/inkstone/resolver.json to work with the original DTCG data, or import @codeui/inkstone/light.json or @codeui/inkstone/dark.json for resolved roles. The DTCG colours contain OKLCH components and an sRGB hex value. The CSS theme uses the sRGB values and adds relative colour formulas for states that follow the brand base.

Fumadocs projects the same ramps into its --color-fd-* tokens. To inspect the ramp JSON in the repository, run pnpm --silent palette:generate.

Surfaces are carved

Fig. 1Surface levels
BackgroundGradient
Search themes…
Opacity
50100
Gradient✓
Colour
  1. 01Page. Behind everything.
  2. 02Island. Recessed into the page.
  3. 03Inset. The open section, back to the page colour.
  4. 04Field. Fields, tiles, hover and selection.
  5. 05Floating. Menus and dialogs, with a ring in dark mode and a shadow.
Five surfaces, no borders. Each level sits on the one below it. Only the floating menu has a shadow, because only it floats.

The dark page uses #1c1c1c. Its islands use #111111. An open section uses the page colour, and a field uses #292929.

This came from reviewing CodeImage's editor. A compact build with bordered panels was rejected because it felt fragmented. The maintainer asked for "un layout più unito e a isole", a more unified layout made of islands. Fill steps group controls without adding lines, and lines would compete with the user's content for attention.

Each surface sits only on the level directly below it. A field goes inside an island, not straight on the page.

Do
Frame64
Padding
163264
Visible
WindowmacOS
Group with islands and space. The open section sits on an inset, and rows inside it need no separators.
Don't
Frame64
Padding
163264
Visible
WindowmacOS
Frame every group with a border and divide every row with a line. Each line is one more thing competing with the user's work.

State is a step of fill

Hover raises an element's fill by one step. A selected item is also one step up. A pressed element changes its fill but keeps the same shape as when hovered. There is no underline, no thicker border and no glow.

One case needs more than fill. A selected card must differ from its island by its fill and an accent ring. In CodeImage's light mode, a card on a grey island could only be told apart by its ring, so cards had to be lifted to white.

A known weakness

The page and an island differ by about 1.1:1. On a dim or cheap screen an island can almost vanish. The layout still holds because islands are also defined by their rounded shape and their position. For the same reason, never rely on a change of fill alone to show that something can be clicked.

The token names are inverted

The kit's tokens were named before the carved layout existed. --cui-surface-canvas is the island, and --cui-surface-panel is the page. Until they are renamed, go by the table in DESIGN.md §2.1, not by the token names. The proposed names are surface-page, surface-island, surface-field and surface-floating.

Text has two working tones

Descriptions, summaries, hints and unselected navigation use --cui-text-muted. Use --cui-text-default for titles, values the user set and selected items.

This is what keeps the screen calm. A panel full of bright labels looks busy even when it has few controls. Visual weight comes from tone first, then from weight, and only then from size.

Do
LanguageMenus and labels.
ITEN
Colour modeDark, light or system.
DarkLight
Titles in the primary tone at weight 500, descriptions in the secondary tone at weight 400. The eye finds the titles first.
Don't
LanguageMenus and labels.
ITEN
Colour modeDark, light or system.
DarkLight
Everything bright and bold. When every line asks for attention, none of them gets it.

Use tertiary text for captions on the page, an island or a field. Keep the disabled tone for controls that are unavailable.

Light mode is one grey family

Both modes use the 16-step achromatic ramp shown above. The light page uses gray.100, the island uses gray.150, and the field uses gray.250. In dark mode those roles use gray.900, gray.950, and gray.750.

The switch off track uses gray.550 in light mode and gray.650 in dark mode. The thumb position also indicates the state where the track has less than 3:1 contrast against its surface.

One accent, five jobs

JobShape
Keyboard focusA 2px ring with a 2px offset
The selected cardA 2px ring
On or activeA switch track, the icon of the open section, a check, a 15% wash
New or unreadA 6–7px dot
The one primary actionA filled button

Blue appears rarely, so users notice it when it does.

  • One filled accent button per surface. If two actions both seem primary, one of them is not.
  • Selected rows stay neutral. In a list, menu, command menu or settings navigation, the selected row gets the field fill and primary text. An accent fill on every selected row would put blue all over the screen, and it would no longer stand out where it matters.
  • "On" and "do" look different. CodeImage once had a blue Play button next to a pressed, blue Animate button, and the two read as one control. Use the soft wash for "on" and the filled button for "do".
Do
Fleet Dark✓
Dracula
Night Owl
Line numbers
CopyExport
A neutral selected row with a check, one switch that is on, one filled primary action.
Don't
Fleet Dark✓
Dracula
Night Owl
Line numbers
CopyExport
A blue selected row, blue labels and two filled blue buttons. Blue stops meaning anything.
Do
▶ PlayAnimate
The pressed mode uses the soft wash. The action next to it stays the only filled button.
Don't
▶ PlayAnimate
Two filled blue buttons side by side read as one control, and the user cannot tell which one is on.

One brand blue for every fill

The shared brand fill is #0076cf in both themes. Hover uses #0068b9 and active uses #004f8e. White labels reach 4.7:1, 5.7:1, and 8.4:1 in those states.

The focus ring uses --cui-accent-focus, #63b3ed in dark mode and #0068b9 in light mode. Links and labels on the 15% wash use --cui-action-brand-soft-text, #63b3ed in dark mode and #004f8e in light mode.

The hover, active, soft, focus and selection colours follow --cui-action-brand-base through CSS relative colours. If you override the base, check contrast across the states.

Status colours

Danger, caution and success mark states the user must notice: an error, a destructive confirmation, a failed export. They do not decorate anything and are not used to label categories. Danger fills only the confirm button of a destructive dialog, and an error always pairs its colour with an icon.

Toghen resolves the status tokens from the Gosfuig ramps. Danger uses red, caution uses orange, and success uses green. Each fill uses step 500 at rest, 600 on hover, and 700 when active. Error text uses red.500 in Light and red.300 in Dark.

When you override a status base token, its hover and active colours follow through CSS relative colours.

Workflow states are not status

A task "in review" or "to test" needs nothing from the user, so it is neutral or uses the brand wash. In CodeLoom, every in-progress Jira item once had the same orange half-circle, and it read as a warning: "alcuni sembrano warning anche se sono in to test". Every state has a visible name, in a label or a tooltip, and its glyph changes shape as well as colour.

The reverse matters as much. A real warning, such as a server that needs you to sign in, always shows in the caution tone with an alert icon, and never folds into ordinary content or a collapsed group. And a finished item does not celebrate in green: it shows no status icon and keeps its time.

Lines

A line is allowed only where a fill would disappear:

  1. The inner ring of a floating surface in dark mode. A shadow does not show on a near-black page, so a 1px ring traces the edge instead.
  2. Focus and selection rings.
  3. A ring around a colour swatch, orb or avatar whose colour could match the background. Use a neutral grey at 16–35% opacity.

A split button such as Export is still a single control. Its two parts are separated by a 2px gap and 4px inner corners, not by a border.

On this page