Skip to content

Colour

The three layers of colour in Silkware, every semantic token with its role, and the rules that keep crimson to one job per screen.

Colour is black and white with one crimson. The system holds it in three layers in app/globals.css, and components read only the middle one. That is what lets a client brand change every colour in the system by editing one file.

ShippedDraftSite BresciaLate

Updated by the ERP at 09:40.

One crimson mark per screen

The three layers

LayerLives inExampleWho reads it
1. Brand primitives:root--ink, --crimson, --fogLayer 2 only. Components never use them.
2. Semantic tokens:root and .light for light, .dark for dark--background, --primary, --brandComponents, through layer 3.
3. Tailwind utilities@theme inlinebg-primary, text-muted-foregroundEvery class in your code.

Write bg-primary, never bg-[#0a0a0a] or bg-ink. A hex value in a .tsx file is a defect: it will not follow a rebrand and it will not follow dark mode.

Brand primitives

--ink 
--white 
--fog 
--mist 
--silver 
--ash 
--seal 
--iron 
--slate 
--graphite 
--crimson 
--crimson-pale 
--crimson-deep 
--crimson-light 
--pine 
--pine-light 
--amber 
--amber-light 
--cobalt 
--cobalt-light 

The greys have names here (fog, mist, silver, ash, seal, iron, slate, graphite) that the brand source gives only by role. Two crimsons are derived and are not in the brand source: --crimson-deep darkens crimson until error text passes 4.5:1 on a pale crimson fill, and --crimson-light lightens it until the same text passes on ink and on the dark surfaces. The brand's own crimson gives about 4.0:1 on ink. The six status primitives (--pine, --amber, --cobalt and their -light versions for dark) are derived too: the brand has no green, amber or blue, so they were set beside crimson for feedback only. See Status colours.

Semantic tokens

Every token below is a Tailwind colour. A -foreground token is the text colour for its fill, and the two are checked as a pair.

Surfaces and text

--background 
--foreground 
--card 
--card-foreground 
--popover 
--popover-foreground 
--muted 
--muted-foreground 
--accent 
--accent-foreground 
TokenRolePair
--background, --foregroundThe page ground and all running text.Each other
--card, --card-foregroundCards and alerts: white in light, a tone step off the ground in dark.Each other
--popover, --popover-foregroundMenus, selects, popovers and dialogs.Each other
--muted, --muted-foregroundQuiet surfaces (tab lists, skeletons, table hover) and the grey for notes.--muted-foreground on --background or --muted
--accent, --accent-foregroundHover and focus fill of menu items.Each other

Actions

--primary 
--primary-foreground 
--secondary 
--secondary-foreground 

--primary is ink in light and white in dark: the primary button is a black button on white and a white button on black. --secondary is one tone step off the ground.

Edges

--border 
--input-edge 
--input 
--ring 

--border is the hairline: ink at 10% in light, white at 12% in dark. --input-edge is the border of form controls: inputs, selects, checkboxes and radios. It is a derived grey, darker than the brand's own line, so that the edge holds 3:1 on every surface in both modes. --input is the tone of control fills: the off switch track, and the translucent ground of inputs and outline buttons in dark. The border-input utility reads the edge and bg-input reads the fill. --ring is the focus colour, ink in light and white in dark.

Brand and the dark field

--brand 
--brand-foreground 
--field 
--field-foreground 
--field-muted 
--selection 
--selection-foreground 
TokenRole
--brand, --brand-foregroundCrimson and the white that sits on it.
--field, --field-foreground, --field-mutedThe dark field: footer and full-width dark bands. Text on it, and its notes.
--selection, --selection-foregroundText selection. Pale crimson with ink in light, crimson with white in dark.

Status

--destructive 
--destructive-foreground 
--success 
--success-foreground 
--warning 
--warning-foreground 
--info 
--info-foreground 

Charts

--chart-1 
--chart-2 
--chart-3 
--chart-4 
--chart-5 
--sidebar 
--sidebar-foreground 
--sidebar-primary 
--sidebar-primary-foreground 
--sidebar-accent 
--sidebar-accent-foreground 
--sidebar-border 
--sidebar-ring 

The sidebar sits one tone step off the page, so it needs no border. Use these tokens inside the Sidebar component and nowhere else.

Utilities

Layer 3 maps each token to the colour utilities: bg-brand, text-brand, border-border, ring-ring, bg-field, text-field-muted, bg-success, text-info-foreground, and so on for every name above. Opacity modifiers work (bg-destructive/10), and upstream components use them, which is why the contrast check covers those composites too.

One crimson

--brand marks the action and at most one more thing on a screen: the square that waits on a person, or the words that carry the page's one accent. Never a background behind a section, never body text, never decoration. The one crimson surface in the brand is a board's accent tile, with white text on it.

Luca has to confirm the supplier before order BRV-2042 can ship.

Do

Let the primary action carry the screen, and the square mark what waits.

Purchasing this week

Four orders across three sites, all in crimson.

Don’t

Don’t paint a whole panel crimson to make it stand out.

Brand and destructive

Crimson has two jobs, as in the brand: --brand is the accent and --destructive is an error. They are separate tokens so a client brand can split them. In the Silkware theme --destructive is not the brand crimson: it is --crimson-deep in light and --crimson-light in dark, so that small error text passes 4.5:1 on every surface where upstream components draw it.

Use --destructive for errors, invalid fields and actions that remove data. Use --brand for the accent. Do not use one for the other's job, even though they look related.

Muted is for notes

Running text is --foreground. --muted-foreground is for notes: dates, legal lines, the quiet half of a statement.

Giulia checked the quantities and sent the order to Luca in purchasing.

Updated by the ERP at 09:40.

Do

Set the text people came to read in ink and keep grey for the note under it.

Giulia checked the quantities and sent the order to Luca in purchasing.

Updated by the ERP at 09:40.

Don’t

Don’t set a paragraph in muted grey.

Upstream components do set some readable text in muted: card, dialog and field descriptions. That is why --muted-foreground passes 4.5:1 on the page, on a card and on a muted surface, but it is still the wrong colour for your own paragraphs.

Status colours

Silkware is black and white first. Three functional colours sit beside crimson for feedback, and only for feedback: --success (pine green), --warning (amber) and --info (cobalt blue), each with a -foreground for text on a solid fill. Crimson stays the accent and the error colour, --destructive. None of them is a second brand palette: never a section background, never decoration, never a heading colour.

--success 
--success-foreground 
--warning 
--warning-foreground 
--info 
--info-foreground 
--destructive 
--destructive-foreground 
  • Inspection QI-319Passed
  • Gommarda seals, lot 7745Low stock
  • Tornival machined partsNew supplier
  • Non-conformity NC-44Rejected
TokenLightDarkMeans
--success--pine, #146c43--pine-light, #74d39dAn action worked or a check passed.
--warning--amber, #984700--amber-light, #f6b35cSomething needs care before it goes wrong.
--info--cobalt, #1d5bb8--cobalt-light, #9cc2ffA neutral notice worth knowing.
--destructive--crimson-deep, #b8184e--crimson-light, #ff99b4Something failed, or an action removes data.

The hues are muted and matched in weight: in light each is dark enough for white text on its fill, at about the same contrast as --crimson-deep; in dark each is a pale tint at about the same lightness as --crimson-light. So no status shouts louder than another, and none outshines crimson.

Pairing rules

Each status works the way upstream uses destructive, and the contrast check holds every pair:

  • As text on its own tint: bg-success/10 text-success in light, /20 in dark, and /20 on hover. This is the status badge and the rich toast.
  • As text on the card: bg-card text-success, with the description at 90%. This is the status alert.
  • As a solid fill: bg-success text-success-foreground.
  • As a mark: an icon in the status colour, at 3:1 or more on the page.

Colour is never the only signal. Every status use carries a word that says the outcome and the icon of the status: CircleCheckIcon for success, TriangleAlertIcon for warning, InfoIcon for info, CircleAlertIcon or OctagonXIcon for an error.

The components that carry status are Alert and Badge, through their success, warning, info and destructive variants, and Toast, whose typed toasts colour their icon from the same tokens.

Status colour and the state square

The state square says where an item stands in its flow, in the brand's ink, crimson and grey; a status colour says how a check or an event turned out, and never fills a square.

The square is ink when done, crimson when it waits on a person, an empty outline when plain, grey when off. Use StateSquare from @/components/brand/state-square for orders, tasks and documents moving through a process, and always pair it with a word, because a square alone is colour as the only signal. Use a status colour for the result of a check, a save or a sync.

  • ShippedDelivered to the Brescia site
  • Waiting on LucaSupplier to confirm
  • DraftedNot sent yet
  • PausedProduction line 3 is stopped

A screen shows one crimson square at most, and status colours sparingly: colour only the rows that need attention.

ReceivedAwaiting approval
Do

Show where an order stands with the square and a word.

InspectionQI-319

Don’t

Don’t let a colour say the outcome on its own.

For a client brand

A client theme can change the three hues by editing --pine, --amber and --cobalt and their -light versions, or by pointing --success, --warning and --info at its own primitives. Keep each one at 6:1 or more against white in light and 10:1 or more against ink in dark, and run pnpm check:contrast: the tints on a floating panel are the tightest pairs.

The dark field

--field is ink in light and graphite in dark: the dark field stays dark in both themes. Paint the band with bg-field and put data-theme="dark" on its content, so that text, surfaces and hairlines inside resolve to their dark values. Text on it is text-field-foreground, its notes text-field-muted.

Talk to an engineer

Your engineer learns how Brevia works before building anything.

Replies within one working day.

Modes covers nesting in detail.

Charts

--chart-1 to --chart-5 are an ink ramp from the brand greys: ink, iron, seal, ash and silver in light, reversed in dark. Crimson is not in the ramp. Keep --brand for the one series you want to point at. The palest steps fall below 3:1 against the page, so tell series apart by order, direct labels and a legend, not by colour alone.

Contrast

pnpm check:contrast reads app/globals.css, resolves every var() and checks 229 pairs in light and dark: 4.5:1 for text, 3:1 for rings, borders and marks. It includes the translucent composites that upstream classes produce, such as bg-destructive/10 under text-destructive. It currently passes.

PairLightDark
--foreground on --background19.8019.80
--muted-foreground on --background5.077.70
--muted-foreground on --muted4.666.61
--brand-foreground on --brand4.924.92
--destructive on --background6.409.87
--field-muted on --field7.706.61
Crimson square on the page4.924.03
--success, --warning, --info on --background6.45 to 6.4910.86 to 10.91
Status text on its tint (/10 light, /20 dark) on the page5.57 to 5.597.44 to 7.46
Status text on its /20 tint on a floating panel, the tightest pair4.774.92 to 4.94
--success-foreground on --success, and the same for warning and info6.45 to 6.4910.86 to 10.91

On ink, crimson is about 4.0:1. On dark grounds use it for squares, marks and large type, not for small text.

  • Modes for light, dark and nested regions.
  • Theming to change these values for a client.