Core layer
The one doctrine every surface inherits: one colour-free token set with light and dark values, elevation by border, one radius scale, no shadow, no serif.
The doctrine — spec
Current contract: Oceanic v4.2 adoption, package 3.0.0 (OCE-3605).
@oceanic-hub/brand-system ships one visual doctrine, and this file is it. It applies to
every component and every surface, with no exceptions and no opt-in layers. The brand book
(company context, voice, imagery, logo) is the root README.md.
This file carries the why. The values themselves live in tokens.source.mjs (CI-guarded)
and the role table is generated into packages/brand-system/README.md. Never restate a value
here that the SSOT owns — state what it means.
Live reference: apps/showcase.
There used to be two.
docs/studio-layer.mddescribed an opt-in "Studio layer", an opt-in second doctrine with its own token vocabulary, its own radius scale and its own shadows, and this file called it "the one approved exception". It was not a doctrine. It was this design's dark values, split off into a second system because the designer viewed them on a/studiotab (OCE-1743). @OCE-1746 collapsed the two into one token set with light and dark values, retiredstudio-layer.mdinto this file, and deleted thedoctrineaxis from the manifest and the lint rule. If you are looking for the Studio spec: there is no Studio. There is a dark theme, and a user switch.
Opting in
There is nothing to opt into — one import gives you the whole system:
@import "@oceanic-hub/brand-system/styles"; /* fonts + tokens + base layer */Light is the :root default; dark is scoped to .dark, [data-theme="dark"]. ThemeProvider
persists the user's choice and respects prefers-color-scheme on first visit (see
Theming, below).
One vocabulary, two sets of values
Consume roles, never values: bg-app, bg-surface, text-ink, border-hairline,
bg-brand, bg-done. The generated table in packages/brand-system/README.md is the full
list with both themes' values; the groups are:
| Group | Roles | What the group is for |
|---|---|---|
| Grounds | app surface elevated surface-sunken | Four depths: the canvas, a card on it, something floating above the card, a well recessed below the canvas. |
| Ink | ink ink-soft ink-faint | Three text ranks, strongest to weakest. |
| Accent | brand brand-ink brand-foreground brand-soft accent-tint | One accent as a mark, the same accent as text, its label colour, a soft fill of it, a faint wash of it. |
| Lines | hairline hairline-strong | Ordinary separation, and the line that carries elevation. |
| Status | done working stuck info neutral done-foreground working-foreground stuck-foreground info-foreground status-ink | The generalised status layer, present in both themes, with one label colour per tone. |
| Theme-invariant | scrim scrim-muted scrim-subtle control-thumb media-placeholder | The five values that must not flip with the canvas. |
Plus a shadcn compatibility layer — background foreground card card-foreground
popover popover-foreground primary primary-foreground muted-foreground border
input ring destructive destructive-foreground. These are aliases, registered
against the same var() as the role they alias, so the two vocabularies are one system
aliased and not two systems to keep in step. That aliasing is the thing OCE-1743's
"zero overlapping token names" finding was missing.
Names are colour-free, and that is the point
ink, brand, hairline describe character, not colour. The palette is explicitly
provisional — the values are adopted from the canonical design "for now" — so a later value
swap has to be able to happen without renaming anything. A role named for a hue would have made
the swap a rename of every call site in every consumer.
Identity and roles are two layers
palette.css is the identity layer: the hues the brand book names, at the values it gives
— Oceanic Brandbook v3.1 §5, approved 2026-08-12, adopted by @OCE-2823 — for the wordmark,
the symbol, the route line, the accent rule on a deck. A hue name is correct there, because
that is what the thing is called, and it is the only place in the system where a colour word
is a token name, because a value has to be declared somewhere. They are declared as
--oc-hue-<name>; the roles are --oc-<name>, and the prefixes are separate because the
brand book names a hue surface and surface is also a role.
An identity hue is never altered to make a contrast pair pass. When a verbatim hue misses
a bar, the ROLE moves — a mix() or an alpha() of the hue, by the minimum that clears the
pair, recorded beside the role in the SSOT. That rule is what makes the palette above a
transcription rather than an interpretation.
theme.css is the role layer: what a part of the interface is for, with a light value
and a dark value each.
The second is not derived from the first, whatever palette.css's header used to say
("theme.css … is built entirely out of them"). It resolves INTO it, which is a different
claim and the one that is true: measured on Brandbook v3.1, 49 of the 58 role values reach an
identity hue and none of the eight hues is consumed by nothing. Under the palette this
replaces, one role referenced one hue, three of five were referenced by nothing at all, and
the accent was a blue that was none of them.
The converse stays false, and it is the half that matters: editing a hue re-values what is
composed from it and does not hand you a theme. elevated is pure white in light and a navy
lifted toward sonda in dark, and no pair of those is derivable from an identity palette.
The confusion had a cost worth recording, because it is what the claim buys you: a press group
lived in the identity layer — --oc-mint-press, --oc-indigo-press, "Mint at ~85%". A press
state is a role; a hue in its name is this section's rule, broken in the layer meant to hold
it. Nothing consumed either one (Button's hover has been opacity-90 since @OCE-1746), so they
were deleted rather than renamed, and check:tokens § B1 now fails on anything but the brand
book's own hues appearing in the identity layer.
A colour name is never a class name
A hue-named utility does not exist. Since @OCE-1746 that is structural, not a rule holding
a line: theme.css no longer registers the brand colours inside @theme, so Tailwind
emits nothing for those utilities. They remain --oc-hue-* in palette.css, which is where a
value belongs. (bg-surface is not an exception: it is the ROLE's utility, and the hue that
shares its word is --oc-hue-surface.)
The lint rule (eslint/no-arbitrary-styles.js) still carries the pattern, as a diagnostic
rather than the enforcement. Tailwind does not error on an unknown utility — it emits nothing
— so a colour-named class fails silently, as a missing colour that reads like a styling bug.
The rule turns that into a message naming the role to use instead. It reads the hue names from
the SSOT, so it keeps binding after a rebrand instead of guarding a palette nobody ships.
A component that writes a hue name in a class has hard-coded a value where a role belongs, so a consumer overriding roles cannot re-theme it — and "the consumer overrides the roles" is the whole promise.
The theme-invariant roles, and why they exist
Until @OCE-1745 this layer had no theme-invariant role at all. Every token flipped with the canvas, so a component needing a value that must not flip had exactly one escape hatch — the named palette — and six components took it. That is the root cause the colour-named classes were a symptom of, and it is worth stating plainly because the canonical design has the same gap: everything in it is light/dark paired. This group is an addition to the source's model, not a copy of it.
scrim / scrim-muted / scrim-subtle are one role with three steps, not three roles:
they differ in a single dimension (how much of the page below survives), and a consumer
re-theming "the scrim" expects all three to move together. The steps reuse this layer's own
weakening ladder, so the order needs no learning — scrim → -muted → -subtle is
strongest → weakest, exactly like ink → ink-soft → ink-faint.
control-thumb is the moving knob of a control; media-placeholder is the plate behind a
video or still thumbnail, which must stay dark under both themes or it reads as a broken image.
Elevation is a border
This system is shadow-free. No shadow-*, no glow, no blur, no glassmorphism. Depth comes
from a 1px border-hairline-strong and a surface shift — that is the whole vocabulary.
@OCE-1746 made this unconditional. The canonical design ships --shadow-card and
--shadow-pop in both themes; both are rejected, the tokens are deleted from the SSOT, the
five surfaces that used them carry border-hairline-strong instead, and the lint exemption
that permitted them on "Studio" files is gone along with the axis it read.
This is the rule most often broken by an agent porting a design, because almost every
reference UI on the internet elevates with a shadow. The lint rule catches it — in consumer
code and in this package's own source, where it runs as part of pnpm check. Since @OCE-1746
it also reads cva variant tables, which it never did before; those tables are where a
component's colours actually live, and skipping them is how four text-white labels survived
a rule that has had a pure-white pattern since @OCE-1734.
One honest caveat about the ban, found @OCE-1749. ring-* is implemented by the browser as a
box-shadow. The lint rule bans shadow-* by class name and treats ring- as an ordinary role
utility, so ring-2 ring-app is doctrine-legal while being, mechanically, the thing this section
forbids. Used as it is used here — a hard, offsetless, opaque line — that is honest: it is a border
that does not consume layout, which is why AvatarGroup and AvatarBadge reach for it. What the
rule would NOT stop is a blurred, offset ring in a soft colour, which is a glow wearing a permitted
name. If that appears, the fix is a pattern for offset-or-blurred rings, not a ban on ring-.
A cost worth knowing. Removing the shadows makes the border the only elevation cue, so the contrast gate now asks whether the border can be seen at all (
kind: 'edge', a 1.2:1 floor that is this system's own, not WCAG's).hairline-strongclears it on both grounds; and so does a plainhairline— 1.21 onapp, 1.30 onsurface.Corrected @OCE-1749. This paragraph used to end "a plain
hairlinedrawn directly onappdoes not, and that is acknowledged ina11y-exceptions.json". Both halves stopped being true when @OCE-1747 darkenedhairlineto#dfe2e8to clear exactly this floor, and the ledger has never held such an entry — it holds four soft-pill dots and four status marks, nothing about a hairline. Left visible as a correction rather than quietly deleted: it is the 17th claim found in this repo crediting the code with something untrue, and that pattern is worth more than a tidy sentence. The margin is 0.01, so the ratchet will catch it ifhairlineorappmoves again.
A fill that stands in for content has to survive every ground it can land on (@OCE-2250)
Skeleton fills with surface-sunken, never elevated — and the reason generalises past that
one component. elevated is #ffffff in light mode, the same fill Card variant="elevated"
paints, so a placeholder block that borrows it is invisible the instant it sits on that card:
white on white. That is exactly how the v0 reference (02-sep) shipped its skeleton, and it read
fine in isolation, on app, which is precisely why it survived a look.
The rule this leaves behind: a fill a consumer drops on unknown ground does not get to pick
the ground it looks best on — it has to be checked against every ground it can legally land
on, including the one it is easiest to forget (elevated, because most surfaces never reach
it). surface-sunken is the one ground role that differs from app, surface and
elevated in both themes, which is what makes it the only correct choice here, not a stylistic
preference. See Skeleton in skeleton.tsx for the showcase demo that checks it directly
against Card variant="elevated".
Radius — one scale
6 / 8 / 12 / 16 / 22 px, plus a pill:
| Class | Value |
|---|---|
rounded | 6px |
rounded-md | 8px |
rounded-lg | 12px |
rounded-xl | 16px |
rounded-2xl | 22px |
rounded-pill / rounded-full | 9999px — circles, avatars, badges, knobs |
Never an arbitrary literal (rounded-[20px]); rounded-3xl and up are off the scale and
rejected.
This settles OCE-1725, which was open because the SSOT declared two scales — the one that
shipped and a flatter 2/4/6px radius that nothing emitted. The canonical design settles it
with evidence, so the dead export is deleted and there is one scale again.
Extending to 16/22 is compatible with shadow-free: flat is a statement about elevation, not
about corners. Which is also why rounded-xl and rounded-2xl need no permission any more,
and why the lint rule no longer needs a per-file doctrine to decide who may use them.
Status, and the end of "no red"
The status layer is done / working / stuck / info / neutral, with one label
colour per tone — done-foreground, working-foreground, stuck-foreground,
info-foreground — on a solid fill. It is present in both themes, which is what settles
OCE-1652: the generalised layer exists, so a consumer inventing its own --color-ops-* set is
duplicating it.
The four foregrounds were ONE role, status-foreground, until @OCE-2823. Splitting it is not
a taxonomy preference: on the brand book's data colours no single label clears AA on all four
fills, and the two candidates fail at opposite ends — white measures 2.58:1 on working
(amber), the brand's own abyss measures 2.87:1 on stuck (port). A role that has to be two
values at once is two roles.
This layer replaces a doctrine that said "there is no red in this system; severity is
carried by copy" — destructive and warning were both Indigo. That was a real position and
it is now retired, because the adopted palette contains a red (stuck) and an amber
(working) and destructive aliases stuck. Two consequences:
Alert'sinfoanddestructivevariants used to render identically. They no longer do.- A form validation message carries the tone as a MARK, not as its text:
text-inkwith astuckicon (@OCE-1747).text-stuckmeasured 4.03:1 on a card — below AA for the one string on a form a user has no choice but to read — and a tone is a fill or a mark, never body text.
What survives from the old position is the part that was always right: copy carries the severity. "Delete 12 contacts permanently" is unambiguous; a red button that says "Delete" is not. The colour is now allowed to agree with the sentence, not to replace it.
Roles are named by state, never by hue, so "the red one" is a rendering detail rather than a promise. The values stopped being provisional when Brandbook v3.1 arrived (@OCE-2823) — but the naming discipline is what let that swap land without renaming a single role, which is the argument for keeping it.
Colour lives in pills, dots and meters
On any surface, chrome stays neutral and colour arrives through the status pills
(StatusPill), the accent actions, and the meters. This is one statement now; it used to be
two that contradicted each other — studio-layer.md said "colour only in pills" while this
file said "pills, dots and meters" — which was OCE-1742's finding, and it dissolves with the
imaginary layer that hosted one half of it.
A status tone is a fill and a dot. It is not text.
Added by OCE-1747, and it is the sharpest rule in this file because it was learned from a measurement rather than argued from taste.
A status tone is chosen to work as a fill. It cannot also be read as text on a pale tint
of itself, because the ground is the same hue blended toward white — so the ratio is bounded
by the alpha whatever the tone is, and no better hex fixes it. On the v0 palette that was
stark (text-working on bg-working/15 measured 1.72:1); on Brandbook v3.1's deeper data
colours it is milder and still true, working at 2.16:1.
So a soft pill splits the job:
| part | colour | why |
|---|---|---|
| the tint | bg-<tone>/15 | states the tone |
| the dot | <tone> via currentColor | states the tone; a non-text part, where hue is the point |
| the label | status-ink | has to be read, so it tracks ink |
status-ink is the sibling of the four solid-fill foregrounds, and they answer to different
grounds, which is the thing to remember about them:
- a
<tone>-foregroundsits on a solid fill, so it follows its own tone — dark on amber in both themes, white on port in both, and flipping with the fill fordoneandinfo, which darken in light for a white label and lighten in dark for anabyssone. status-inksits on a 15% tint over the surface, which is pale in light and near-surface in dark — so it does flip, by trackingink.
Never write a status tone as a text colour. If you find yourself reaching for
text-done, you want either a pill or a dot.
Since OCE-1747 that is enforced, not just stated. check:tokens walks the component
sources for text-<role> paired with bg-<role>/<pct> and fails on any combination
contrastPairs does not declare. The rule needed a gate because prose did not hold it: four
components were still painting a tone as text after the rule was written, and two of them were
invisible to the entire contrast contract — Badge secondary at 2.51:1 and Button destructive at 3.45:1 over its own hover tint. Neither was acknowledged debt; neither had ever
been measured.
The distinction the gate encodes: a pair below its bar and listed in a11y-exceptions.json is a
decision. A treatment no pair describes is an absence. The first is auditable, the second
looks identical to compliance from the outside — which is why the check reports coverage
separately from legibility.
OCE-1756 added a second arm and fixed a false negative in the first. The check now also demands
a pair for a translucent border — see § "A translucent line is measured too" below for why
that needed a schema change first. And the text arm used to read the first text- token in a
class string, which Tailwind's type scale also owns: text-xs font-semibold text-brand resolved
to xs, not a role, so the whole string was discarded and the check reported clean on the
exact treatment it exists to catch. It scans for the first token that is a role now. One pair
fell out of that fix — the AttributeFilterBuilder filter chip's accent-as-text on bg-brand/10,
4.51:1 on a card and 4.22:1 on the canvas, in a11y-exceptions.json with the repaint it
needs.
Three limits worth knowing. It reads literals only, not classes assembled through variables — the
lint rule owns that, and here a false demand would be worse than a miss. It ignores
modifier-prefixed classes (hover:bg-stuck/12), so a state fill is still declared by hand. And it
cannot tell a mark painted with a bg- utility from a container's fill, so a translucent dot
like EngagementBar's bg-ink-soft/25 is declared by hand as the foreground it actually is.
The accent is a mark AND text, and they are two roles
Added by @OCE-2823, and it is the status rule above run on the accent — with the opposite conclusion, for a reason worth stating.
Primary action and progress use the blue brand roles. brand-ink is the accent
as text and brand-foreground is its solid-fill label; each has its own measured
contrast pair. brand-hover and brand-pressed make interactive states explicit.
Human-decision context uses authority, authority-ink and authority-soft.
The contextual distinction does not create a second action system: an approval
button uses the primary action treatment. Identity artwork retains its own approved
colours. Never infer a product permission from a colour role.
Persistent chrome uses data-oc-chrome, which remaps the shared roles onto the
invariant shell tokens and establishes its own text colour. It does not change
the page theme or the theme inherited by portals. Consumers keep their existing
theme ownership model.
Type
Figtree is the single interface family, including amounts, metadata, identifiers, timestamps and code displayed in the interface (@OCE-3605). The package self-hosts the variable face; consumers import its styles once and do not add a font loader.
- Body and secondary copy: 500. Emphasis: 600. Titles: 650.
- Named sizes: page title 28, panel title 20, card title 18, navigation 16, control 15, metadata 14, short eyebrow 12. Sentence case, no extra tracking.
- Numeric columns use
tabular-numsand alignment. A number does not change family. font-mono/fonts.monoremain compatibility aliases to Figtree; new UI usesfont-sansor inherits. No serif, no italic as a hierarchy signal.- A literal family override or arbitrary font utility fails the shared lint rule.
Density — spacing tightens, copy does not shrink
One attribute, owned here rather than improvised by a consumer.
<html data-density="compact"> <!-- or on any region: a dense island in a comfortable page -->comfortable is the default and is spelled out as a no-op, so a product toggling between the
two writes a value in both directions instead of removing an attribute. compact narrows the
spacing scale to 0.8× — measured against this package's own surfaces, not picked: tighter
than that and a 4px gap between a mark and its label rounds to 3px and the two begin to touch.
Why it is the package's decision and not a consumer's side channel. Every
p-* / gap-* / m-* / h-* / size-* utility in Tailwind v4 is calc(var(--spacing) * N),
so one declaration at a consumer's root re-metrics every component here by inheritance, at a
metric this package has never looked at. That is modification at a distance: the components
change, the package cannot see it happen, and nothing is wrong until someone takes a screenshot.
Two rules decide what participates.
- Copy does not shrink. Type sizes come from
--text-*, not from--spacing, so they are untouched by construction rather than by anyone's care — the stance cannot be undone by accident. A compact surface fits more rows; it never asks anyone to read smaller words. - A control's size is not a gap. Under a bare narrowing, every field's
h-10becomes 32px, every icon'ssize-4becomes 12.8px and the status chip'sh-6becomes 19px. None of those is spacing: a control's height is a target size, an icon is content at optical parity with the text beside it, and a chip's box is its own geometry. Shorter controls are asked for per call site withsize="sm"— onInput,Textarea,NativeSelect,ButtonandStatusPill— which is a decision about one form, not about a document.
The mechanism for rule 2 is the same custom property, re-declared locally. --spacing is
inherited and every utility resolves it at the element, so restoring it on a control restores
every metric that control derives from it while the layout around it keeps the tightened
value. One property, both answers, and no second scale to keep in step.
The package restores it on svg, on input / select / textarea — element selectors, so a
consumer's own bare controls stay flush with ours — and on anything carrying
data-oc-density="fixed", which is the opt-in for a consumer's own components and which this
package puts on Button, StatusPill, DialogContent, SheetContent and PopoverContent. It
is a plain attribute on purpose: no prop, no import, and it works on a <div>.
Values: src/styles/density.css, imported by @oceanic-hub/brand-system/styles and inert until
a data-density attribute appears. Also reachable on its own as
@oceanic-hub/brand-system/styles/density.
Theming
Light is the default. Dark is the user's choice, not a product's identity.
import { ThemeProvider, ThemeScript, useTheme } from "@oceanic-hub/brand-system";
// <head>: <ThemeScript /> — apply stored/OS theme before paint
// app: <ThemeProvider>{children}</ThemeProvider>
// toggle: const { theme, toggleTheme } = useTheme()ThemeProvider is enhanced over the V0 original (which lost the theme on reload): it persists
to localStorage, respects prefers-color-scheme on first visit, defaults to light, and
ThemeScript prevents the flash. It sets data-theme on <html>.
The choice and the resolution are two different things (@OCE-1741)
'system' is a theme a caller can ask for, not just a fallback the provider samples once.
While it is the choice, a matchMedia listener is held, so an OS flip lands live; picking an
explicit theme drops the listener. Which means two fields, and reading the wrong one is the one
mistake this section exists to prevent:
| field | union | answers |
|---|---|---|
theme | light | dark | system | what did the user choose? — a settings screen ticks this |
resolvedTheme | light | dark | what am I looking at? — everything else reads this |
Anything branching on the current appearance wants resolvedTheme. theme === 'dark' is
false under 'system' on a dark OS, so a toggle testing it offers to switch to the theme it is
already showing. resolvedTheme is never 'system', by construction rather than by
convention — [data-theme="system"] matches no selector, so the value that reaches <html>
cannot be allowed to say it. toggleTheme() flips the resolved theme and therefore always
lands on an explicit choice, never back on 'system'.
First-visit behaviour is unchanged: no stored value still means sample the OS once, else
defaultTheme (still light). A product that wants live tracking from the first visit opts in
with defaultTheme="system".
The CSS keys dark on .dark, [data-theme="dark"], and the token layer is registered with
@theme inline — which means a utility resolves the raw variable at the element, so a
.dark set anywhere above it works, including on a nested wrapper. Getting a subtree in the
other theme is therefore just a .dark div.
Framework-agnostic navigation — Slot / asChild
The package depends on no framework — it never imports next/link. Navigable items render
through a Radix Slot (asChild), so the host supplies its own link; the default child is a
native <a>.
// The package renders <Slot><a href={item.href}>…</a></Slot>.
// A Next.js host injects its own <Link> by passing an href — no next dep leaks in.
<WorkspaceNav sections={[{ items: [{ id: 'campaigns', label: 'Campaigns', href: '/campaigns', active: true }] }]} />One idiom: Comp = asChild ? Slot : 'button'
Button takes asChild since @OCE-1741, which is how a button renders as a link:
<Button asChild><Link href="/sprints">Open</Link></Button>asChild changes the element; the link variant styles the text. They are orthogonal,
and conflating them is why navigation through a button was inexpressible for as long as it was —
the variant that looked like a link was still a <button>, which is the wrong element for going
somewhere.
Two things that follow, and both have already been got wrong here:
- Never wrap the body:
<Slot>{children}</Slot>around a composite discards everything but the first child. The deletedReelCarddid exactly that, silently. disabledmeans nothing on an<a>. A disabled navigable button is a<button>with anonClick, or an anchor the surface does not render. The type permits the combination becauseButtonPropsis the native button surface; this doctrine forbids it.
Prefer asChild over hand-copying buttonVariants' class string: a copy cannot follow a token
rename, and @OCE-1746 renamed most of them.
WorkspaceNav affordances
{ id, label, icon?, active?, onSelect? } plus:
href?— navigable via Slot/asChild (elseonSelectbutton).disabled?— inert placeholder (never navigates, never firesonSelect).badge?— short trailing tag.
Component slots: brand (logo zone), context (below the switcher), footer (e.g. a
SpendBar), plus the built-in client/project switcher (onSwitch).
Motion — animation stops, the mark persists
The package's degradation rule under prefers-reduced-motion, stated once here because it
binds every component:
The animation stops. The mark persists.
A moving affordance must survive being frozen. StatusPill's in-flight state is a hollow ring
with a halo pinging out of it; reduced motion removes the halo and keeps the hollow ring, so
the state is still readable. Skeleton stops pulsing and keeps its block, which still reads as
"not here yet".
The two failure modes this rules out, both of which have happened here:
- Degrading to nothing — the animation was the only carrier of the state, so reduced motion silently dropped information.
- Animating permanently — a strip of eight simultaneously pulsing cards is hostile. In-flight means this one is working now, not this component is decorative.
Corollary for new components: if you cannot describe the state without the movement, the state is not designed yet.
There are TWO motion systems, and they are governed differently (@OCE-2247)
Say this before the scale, because the tables below only make sense against it. This package moves things in two mechanically different ways, and the difference decides who owns the timing:
| Animations — a keyframe | Transitions — a property changing | |
|---|---|---|
| Vocabulary | fifteen animate-oc-* tokens | transition-* + a step of the duration scale |
| Who sets the duration | the TOKEN, pinned inside it | the CALL SITE, from the scale |
| Easing | inside the token, ease-quiet for fourteen of fifteen | ease-quiet, or the default curve for a colour fade |
| Reduced motion | the token becomes none | every --duration-* becomes 0ms |
| Used for | presence — a surface arriving or leaving | state — a colour, a width, a knob travelling |
Why an animation's duration is not yours to change and a transition's is. An animation is a whole gesture: a pop-in is 150ms because of the scale it travels, and a call site that slowed it to 500ms would not be re-timing it, it would be breaking it. A transition is the same one property moving between two values a caller chose, so the length is part of the caller's decision. Both spend the same four numbers — the animations reference the scale below — so this is a difference in who decides, not a second set of values.
Which one to reach for is not a preference. Radix's Presence reads animationName and
listens for animation events only; a transition-based enter or exit on a Radix surface does not
fire at all. Presence is animations. State is transitions.
The duration scale (@OCE-2247)
Four steps, and they are the values this package was already spending before they had names.
| Step | Value | For |
|---|---|---|
duration-instant | 0ms | Not a speed. What reduced motion sets every step to, and the honest way for a call site to say "no movement". |
duration-fast | 120ms | An exit. A dismissal is a command and latency after it reads as the interface disobeying. |
duration-base | 150ms | The default, and where a colour transition lives. Also --default-transition-duration, so a transition that names no duration still lands on the scale. |
duration-slow | 200ms | Travel — a sheet crossing the viewport, a rail changing width. |
One curve: ease-quiet. The ticket that opened the scale asked for two or three named
easings. There is one curve in the source and there has been since @OCE-1779; two more would be
vocabulary that no component chose and no line here decides between, which is how a scale stops
being one. It grows when a surface argues for a step.
A colour transition may name no easing. It then takes Tailwind's default curve, and that is
accepted rather than overlooked: a colour crossfade at 150ms has no perceptible shape, and 24
call sites were already relying on it. Anything that moves GEOMETRY must name ease-quiet —
a width, a transform, transition-all, an explicit property list. Travel has a shape, and a
shape nobody chose is the second motion system arriving again. check:tokens enforces both
halves of that sentence over src/components, and no-arbitrary-styles rejects the numeric
duration and the hand-spelled curve that used to be the alternative.
The animation scale, and the one rule for choosing from it (@OCE-1779)
Motion is a token like any other: declared in tokens.source.mjs, generated into @theme,
gated. Fifteen names, and the list is closed until an argument reopens it.
| Names | Duration | For | |
|---|---|---|---|
| Fade | animate-oc-fade-in / -out | base / fast | Scrims, and hover-summoned surfaces |
| Pop | animate-oc-pop-in / -out | base / fast | Click-summoned surfaces |
| Slide | animate-oc-slide-in-{top,right,bottom,left} and -out- | slow / base | Sheet, from its own edge |
| Height | animate-oc-expand / -collapse | slow / base | Accordion; available to Collapsible |
| Pulse | animate-oc-pulse | 1s | Skeleton |
The duration column names a step of the scale above — that is where the value comes from now,
not from a number written beside each animation. pulse is the one literal: 1s is not a
transition length, and adding it as a step would put a name on the theme for one infinite
keyframe.
Click-summoned surfaces pop. Hover-summoned surfaces fade.
A pop is the interface answering something you did — the scale change is the answer. A hover surface arrives on intent you have not committed to, and a thing that jumps at the pointer reads as a flinch rather than a response. That single line decides every case: Dialog, Popover, Select, DropdownMenu, ContextMenu and Menubar pop; Tooltip and HoverCard fade; a scrim only ever fades. @OCE-1870 settled the case that looked like an exception and is not: a right-click is still a click, so a ContextMenu pops — the rule keys on how a surface was summoned, not on which button did it. ONE surface does not obey the line yet — AlertDialog carries no motion at all — which is the last of the @OCE-1779 rollout rather than an exception to the rule; it is click-summoned and it should pop. Exits are faster than enters, everywhere — a dismissal is a command, and latency after "close" reads as the interface disobeying.
Refused, and the refusals are what keep the scale at fifteen: the eight directional nudges
(slide-in-from-top-2 and siblings), which spend eight utilities on a 2px flourish the pop
already communicates; animating a Tooltip's instant-open state, since inside the skip-delay
window the user is scanning a row of triggers and motion is friction; and any new infinite
animation. spin, ping and oc-pulse are the only three and all three carry state — an
infinite animation that carries nothing is failure mode 2 above.
Reduced motion is enforced structurally, not per component
theme.css redefines every --animate-oc-* to none inside
@media (prefers-reduced-motion: reduce). Do not write motion-reduce:animate-none on a
component. It is specificity (0,1,0) — a bare class in a media query, which contributes none —
while data-[state=open]:animate-oc-pop-in compiles to a class plus an attribute selector at
(0,2,0). The guard is outranked by the animation it exists to disable, so it looks correct and
does nothing. It works on Spinner only because animate-spin there is unvarianted.
Killing the variable sidesteps specificity altogether, and no future component can forget to opt in. It is the same move @OCE-1746 made by deregistering the brand colours: make the wrong thing unrepresentable rather than merely discouraged.
Transitions degrade the same way, since @OCE-2247. The block also redefines every
--duration-* step — and --default-transition-duration, which a transition naming no duration
falls through to — so all 47 transitions in the package stop, and so does one written in a
consumer's own code against this theme. Before that, "the animation stops" was true of the
animations only: the transitions ran at full speed with the OS switch on, and nothing said so.
THE CARVE-OUT, AND IT IS A REAL EXCEPTION TO THE BAN ABOVE. The central kill covers the
tokens this package DECLARES. Core Tailwind's own animations — animate-spin, -ping,
-pulse — are not among them and never were, so nothing kills them and they do need a
per-call-site guard. That guard also works on them, for the same reason it works on Spinner:
they are unvarianted, so both rules sit at (0,1,0) and source order decides. Read the ban above
as what it is — a ban on guarding a data-state-varianted animate-oc-*, where the guard loses
on specificity and silently does nothing.
A reader who took the ban literally would strip spinner.tsx's guard and break it. That is not
hypothetical: input-otp.tsx had the opposite half of the same misreading, rendering
animate-pulse with no guard under a docblock that claimed it degraded, and its caret pulsed
through the OS switch until @OCE-2247. Two components, one unqualified sentence, both directions
of the mistake.
This is also what makes the doctrine reachable rather than aspirational. Every hidden state
lives inside a keyframe's from, never in a base class, so killing the animation paints the
final state on the first frame — an overlay is fully open or fully gone, and presence is never
ambiguous. Had the hidden state been an opacity-0 base class with a transition over it, reduced
motion would strand the element invisible, which is failure mode 1 wearing a helpful disguise.
Pending state — the spinner joins the label (@OCE-2248)
A mutating action shows that it is working. The control disables instantly, aria-busy goes
up, and a spinner joins the label — it never replaces it, because a mark on its own says
something is happening without saying what. Button's busy prop is that rule as an API, and
it applies to every variant without exception.
The width does not change, and that is a structural claim rather than a stylistic one: a
button that grows when it starts working moves whatever sits beside it, at the exact moment a
reader is looking at the pointer. So the spinner's slot is rendered at REST too, holding its box
with nothing in it — which is why busy={false} is not the same as omitting busy. Declaring
that a control can go busy is what buys the space, and the caller who knows is the one who pays;
a control that never declares it renders no slot and keeps its former width exactly.
Two things this doctrine deliberately leaves outside the package:
- The clock. An anti-flicker floor — busy stays visible for at least a beat, so a response that lands in 40ms does not strobe — is measured against a network, and a network is not a design decision. The package gives the visual state; the host's own request hook gives the timing.
- What comes after busy. The state resolves either into the control returning with an error beside it, or into the control leaving the DOM because the thing it did is done. Both are the surface's composition, and neither is a third value of one prop.
Pending state — a dialog locks rather than closes on you (@OCE-2251)
A Dialog in flight cannot be dismissed out from under the request it started. DialogContent's
locked prop turns off every USER-initiated dismiss path at once — Escape, a backdrop click, and
the corner X — while leaving the dialog's own open/onOpenChange state exactly as the caller
wired it, so a programmatic close once the request settles still works.
The X stays visible and disabled, never hidden. A control that vanishes reads as a layout
glitch; a control that is visibly dead reads as "the system knows it is busy" — the same
distinction busy draws for a button, applied to a dialog's own close affordance. Cancel is the
caller's own button, not a package part, so it takes the same locked value directly: the
package cannot reach into a footer it does not render.
A locked dialog never closes silently on failure. That is the other half of the rule, and it
is a consequence rather than an API: nothing in locked closes the dialog, so an error the
caller renders into children — an Alert variant="destructive", typically — simply stays on
screen next to the request that produced it, instead of the dialog closing and the error
appearing nowhere the reader is still looking.
Both intercepted handlers (onEscapeKeyDown, onInteractOutside) call the caller's own handler
first and only conditionally call preventDefault() after — never a locked-keyed ternary down
to undefined. That ternary shape is this package's own known clobber (@OCE-2137, the dropdown
aria defect): an explicit undefined passed after a primitive's default still overrides it, so
"unlocked" would have silently discarded a caller's own handler rather than leaving it alone.
Corollary, and it is the § Motion rule above wearing different clothes: busy is not
unavailable. disabled fades a control to 40% because it is saying you may not; a busy control
holds its full ink and refuses the click anyway, because the spinner is already the signal and a
spinner at 40% is the faintest thing on the surface.
Pending state — a confirmed row fades, then folds shut (@OCE-2252)
A destructive action's row does not vanish the instant the server confirms it. DataTable's
exitingKeys/onExitComplete play the exit in two stages — the row's content fades, THEN its
own space collapses — because a row that is simply gone on the next frame reads as a glitch, not
as a confirmation: nothing told the reader the removal actually happened, they just have to
notice a gap. The two stages are sequenced, not simultaneous, for the same reason a dismissal
doubles as feedback elsewhere in this package: content disappearing first and the layout closing
around it afterwards is legible as one action finishing, where both at once reads as one thing
breaking.
Controlled, same as sort and expandedKeys: exitingKeys names which rows are leaving,
onExitComplete reports when the animation is done, and the package never removes a row from
rows/groups itself. That asymmetry is deliberate — "the app decides WHEN" is the whole
contract, and a package that spliced its own caller's array the moment an animation finished
would be guessing at a data model it was built specifically to never learn (DataTable's own
opening rule, this file's introduction to it above).
Not Table's <tr>. A real table row's height is intrinsic to its cells, and animating it
without measuring a pixel value in JS is exactly the problem --radix-collapsible-content-height
solves for the expandable-row pattern — reusing that machinery for every row of every table,
including ones that never exit, would cost a Collapsible instance per row for nothing. DataTable
already renders <li>s, not <tr>s, so its exit reaches for the CSS grid 1fr → 0fr track
trick instead: no JS measurement, no Radix dependency, and the wrapper mounts only around a row
actually named in exitingKeys — a table that never sets it pays nothing.
Composes with sort, grouped sections and expandable rows at once, with no exception of its own —
exitingKeys/onExitComplete sit on the base props, the same rung as selectedKey, rather than
inside either union that already makes rows/groups and select/expand mutually exclusive.
Contrast is measured, not asserted
pnpm check:tokens measures every pair the SSOT's contrastPairs contract declares, in both
themes, and fails on a new failure. Acknowledged debt lives in a11y-exceptions.json, which
ratchets.
The pairs are declared as components render them — text-done on bg-done/15 on a card,
not done on surface — because the abstract version flatters the result. @OCE-1746 widened
the gate from 6 role pairs to 37 component pairs for exactly that reason: the narrow version
reported "all clear" while a Switch thumb shipped at 1.09:1 over its own track.
Read a11y-exceptions.json before proposing a palette change. The headline finding is that the
status quartet are four bright mid-tones chosen to work as fills, and a bright mid-tone
cannot also serve as text on a pale tint of itself — so the soft StatusPill measures 1.94:1
(done) and 1.72:1 (working) in light. That needs a value that does not exist yet, and it is
a design decision rather than a cleanup.
A translucent line is measured too
Declare the alpha the component writes, on whichever side it writes it. A pair takes
bgAlpha for a translucent fill and, since OCE-1756, fgAlpha for a translucent mark or line.
That second field was missing for two releases, and the shape of its absence is worth keeping,
because it is not the shape a missing feature usually has. It did not look like a hole — it looked
like a treatment nobody had declared. A pair could say bg-done/15; it could not say
border-done/40. So every tone border in the package sat outside the contract, and the only
declaration the schema did permit was the solid tone, which for border-stuck/40 on a card
reports 3.55:1 where the rendered line is 1.63:1. A contributor closing the gap the obvious
way would have produced a green gate on a number two to three times the truth. Silence is a known
unknown; a flattering pass is a false record, and the second is worse.
Which bar a border answers to is the real question, and it is not settled by the fact that it is a border. The test:
If this line were invisible, what information would be lost?
- Nothing — the tint, an icon and the copy all say the same thing → the line is
delineating, which is
hairline's job, sokind: 'edge'and this system's own 1.2:1 floor. - The state itself → the line is stating, WCAG 1.4.11 binds,
kind: 'ui'and 3:1.
Both answers are live in this package, from two tickets, and neither overrules the other:
| resolution | why | |
|---|---|---|
Button destructive (OCE-1747) | border went solid border-stuck | the label had moved to ink, so the border was the button's only colour signal — it could not be the one thing the contract cannot see |
Alert, Toaster, Badge, filter chip (OCE-1756) | 14 pairs at kind: 'edge', all passing at 1.38:1+ | a 10–12% tint of the same hue, a per-variant icon and the copy each carry the state, so 1.4.11's "not the sole means of conveying" exemption applies rather than being worked around |
Holding those fourteen to 3:1 would have meant repainting six components to satisfy a criterion that does not bind, or ledgering fourteen failures — which records a design decision as debt and is how a ledger stops being read.
One measurement detail that follows from "pairs are declared as components render them": a
translucent border composites over the component's own fill, not over the ground behind it.
background-clip defaults to border-box, so bg-info/12 paints under border-info/40, both
are the same hue, and the true ratio is lower than the same border over a bare surface — 1.41:1
against 1.47:1. The bare-surface number is the flattering one. Take the other.
Porting a shadcn component means porting ALL of it
Added by OCE-1747 on Javi's instruction, and it is the sibling of the promotion bar below: that one governs whether a component enters, this one governs how completely.
When a component in core derives from shadcn, its whole surface comes with it — every
sub-component and every variant of the upstream original. Not the subset the current design
happens to draw.
Why this needs saying
Because the opposite already happened, and the mechanism is worth knowing. 16 of the 25 core
components are genuine ports, and those inherited their sub-components wholesale — 21 of 25 have
full export parity with upstream. The ones that drifted are precisely the hand-written leaves
with no Radix primitive underneath (alert, card, input, label, table, textarea,
sonner): nobody had upstream source open, so each got only what the v0 mock drew. That is how
Alert shipped without AlertAction and Card without CardAction, and why nobody noticed —
see OCE-1749 for the full inventory.
So the rule bites hardest exactly where there is no file to copy from. A leaf component is the one you have to check deliberately.
The two constraints on it
1. Doctrine wins, and a refusal must be written down. This file overrides shadcn. A variant
that needs a shadow does not arrive — elevation is a border is not negotiable — and neither
does a treatment that paints a tone as text. But a refusal is only legitimate if it is
recorded with the line of this file that excludes it, in the component's
*.contract.test-d.ts. Silence is drift; an argued refusal is a decision. OCE-1755's refusals
are the model: Badge ghost, Badge link, Button xs, TabsList variant, each with its
citation.
2. Port from the generation we are on, not from the current docs. shadcn has re-based since
this package was built. There are now three primitive bases (radix, base, aria) and the
docs default flipped to Base UI, which is a different library from the Radix our components
use. There are also two Radix generations — new-york is the forwardRef one we match, while
new-york-v4 is the current data-slot one. Reading the wrong one imports a base migration
wearing the costume of a variant addition. State which URL and which generation you read, and
the date.
Being a deliberate superset is fine and expected — Alert carries four variants where
upstream has two, and Card three where upstream has none. The rule is a floor, not a mould.
The base library is an implementation detail, not a breaking change (@OCE-1782)
Decision, 2026-08-15: stay on Radix. The migration to Base UI is optional forever.
This was measured, not argued. A spike built Accordion and Select twice — a straight Base port,
and a compat-grammar shim keeping our Radix-shaped surface (type="single"|"multiple", asChild,
array values) with Base UI underneath as the engine. Select was nominated as the component most
likely to break the shim and did not.
The proof that mattered: the contract assertions from the shipped accordion.contract.test-d.ts
and select.contract.test-d.ts were lifted verbatim, with one line changed — the import
pointing at the Base-backed shim — and both compiled unmodified, including the
@ts-expect-error pins that keep Base's own spellings illegal on our surface.
So the engine can move at any time, or never, without a single consumer call site changing. That is why the base question did not gate the 1.0.0 cut, and does not gate any future one.
The one real narrowing, found only by building it: Radix's collapsible={false} — the single
open item cannot be closed — has no Base equivalent; Base's single accordion is always
collapsible. A shim can accept the prop and cannot honour false.
Tripwires that reopen this: Radix misses a React major, or ships nothing for roughly two quarters; an accessibility defect upstream declines to fix; a primitive we need exists only in Base.
Two rules the spike leaves behind, both of which cost something to learn:
- For a cross-generation fact, read the installed
.d.ts, not a snapshot of anyone's docs. The harvested guidance claimed Base requires anitemsprop and needs a sentinel for the placeholder. Both false against@base-ui/react1.7.0 — and believing them would have produced "Select cannot be shimmed", the exact opposite of the truth. - Never re-derive the existing components with
shadcn add. Measured on real output: it still emitsring-ring/50,animate-accordion,shadow-*,rounded-lganddata-slot— and abg-accentin Select that emits nothing in our theme, which ships a highlighted item that is invisible on a green build. The doctrine tax is engine-independent.
The full write-up, including the rendered three-arm comparison, is on OCE-1782. The spike branch itself was throwaway by design and is not merged — nothing in it belongs in the package.
When a component belongs in this package
The bar, from CONTRIBUTING.md, is deliberately high:
"This comes up in ≥3 Oceanic surfaces and a custom build keeps drifting. Don't add
Carouselbecause it's nice."
That bar was stated and never enforced, which is how the package accumulated 19 components carrying one product's domain model. The reason it went unenforced is structural, not cultural: counting surfaces is a judgment call, and a judgment call needs a reviewer holding the whole picture. So since @OCE-1730 it is backed by a mechanical test that needs no judgment at all:
No business nouns in the public API. ButtonProps, AppShellProps, KPIStatProps,
SparklineProps, DataTableColumn pass. ContactRow, Deal, ReelStatus fail — a design
system that names a CRM's entities has stopped being a design system. A table that takes column
definitions belongs here; a table that takes ContactRow[] belongs in the product.
pnpm check:nouns (inside pnpm check) is that rule as code. It reads every public name out of
the generated component manifest — exported types and their members, components, constants and
functions, and every declared prop — splits each into word segments, and fails on a noun listed
in business-nouns.json. Props are read as well as type names on purpose: a ConfirmDialog
that still takes contactName hides the coupling behind a neutral name, which is worse than an
honest domain component.
A violation has three honest fixes, in order: genericise (ContactsTable → DataTable),
delete (if no product imports it, it is not a design-system component — check with a grep,
not with intuition), or acknowledge in business-nouns.json with the ticket and what
removes it, which is only legitimate when a consumer imports it today and the rename is that
consumer's work. The list ratchets: a new violation fails, and so does an acknowledgement whose
debt has been paid.
Where the gate cannot reach: a STRING is not a name. check:nouns reads public names out of
the manifest, so a business noun sitting in a string literal passes it cleanly. @OCE-1741 found
two — aria-label="Replies per day over the last 30 days" and aria-label="Revenue by month",
hard-coded inside the shared SVG charts, where no consumer could correct them. A false sentence
read to a screen reader is a worse leak than a badly named type, and the gate was green over
both for the whole life of the components. There is no mechanical fix in sight (a check that
grepped every string literal for a noun would fire on demo data and prose), so the rule is
carried by hand:
A shared component never authors the words a caller's user reads. An accessible name, an empty-state sentence, a unit, a currency: each is a prop, required if the component asserts it anyway. A default is legitimate only when it names no domain — and "generic but useless" is not a default, it is the same defect with the volume turned down.
The three tiers are core (these primitives), patterns (the generic composites — the reason
a shared package exists) and domain (what is on its way out). The boundary is the manifest's
layer field, decided in one place, and it is also the source of the
@oceanic-hub/brand-system/core and /patterns subpath exports. There is no /domain
subpath, deliberately.
layer is now the manifest's only axis. It sat next to doctrine (core |
a second, product-named value), and the two were described as orthogonal — layer answering should this be
in the package at all, doctrine answering which visual rules apply. The second question no
longer has two answers, so @OCE-1746 deleted the field, its studioTokens evidence array and
the lint exemption that read it. layer survives because its question is real and no amount of
token unification settles it.
So, in order: use what the package exports → compose product-specific things locally, which is ordinary product code and not a violation → send a genuinely missing primitive upstream. Never block a ticket on someone else's release.
Refusals
The fastest way to protect a brand is to know what to refuse. These are rules, not preferences.
- No wave illustrations, ocean photography, boats, fish or nautical icons. The metaphor is in the words and the colours; a literal wave next to "Oceanic" is the obvious move, and obvious is the enemy.
- No decorative gradients. No mesh, no noise, no glassmorphism.
- No drop shadows, glows, blur or neon. Anywhere. Flat, deep, confident.
- No pure black or pure white as a class —
bg-white,text-black,bg-black/45are rejected. Reach for the role that carries the job (bg-app,bg-surface,text-ink,bg-scrim,bg-control-thumb). Note this is now a statement about class names only: the adopted palette'selevatedandbrand-foregroundare#ffffffin light, where the retired one used Pearl. That is a consequence of adopting the design's values, it was already true of the shipped second layer before the collapse, and it is flagged rather than smuggled. (surfaceheld white too until @OCE-1874 stepped it down to#fafbfdso the light grounds would climb in one direction — same point, one role over.) - No serif, no italic.
- No arbitrary radius literal, and nothing off the 6/8/12/16/22 scale.
- No emoji in the package.
- No stock photography. If we need an image we make one.
The reviewer list in CONTRIBUTING.md is the enforceable subset; this list is the doctrine
behind it.