Category
Named colors that tell which category a piece of data belongs to.
On this page
A category is which piece of data something belongs to: a project, a calendar, a team, a label. Master UI tells a category by one of the preset's 23 named palettes, through four roles each palette gives: a tinted surface, the text that reads on it, a decorative line and a mark for a dot or a bar. A category-<name> class sets the four roles for itself and for what it holds, and the parts that opt in read them.
Category
<span class="badge badge-category badge-dot category-teal">Design system</span><span class="badge badge-category badge-dot category-violet">Research</span><span class="badge badge-category badge-dot category-orange">Launch</span><> <span className="badge badge-category badge-dot category-teal">Design system</span> <span className="badge badge-category badge-dot category-violet">Research</span> <span className="badge badge-category badge-dot category-orange">Launch</span></><span class="badge badge-category badge-dot category-teal">Design system</span><span class="badge badge-category badge-dot category-violet">Research</span><span class="badge badge-category badge-dot category-orange">Launch</span><template> <span class="badge badge-category badge-dot category-teal">Design system</span> <span class="badge badge-category badge-dot category-violet">Research</span> <span class="badge badge-category badge-dot category-orange">Launch</span></template>#Chrome, status, category, content
Neutral chrome is the default; status colors say how something is, category colors say what it belongs to, content colors show the data as it is, and the brand color keeps its one moment.
- Status is a tone of a component, such as
badge-success: done, failing, at risk. It always comes with words that say the same. - Category is a class around the data, such as
category-blue: a project, a calendar, a tag. Red here names a category, never a danger, and a badge is one or the other, never both. - Content is a color the data is: a paint, a theme's accent, a chart's series. A swatch shows it as it is.
A button, a field, a dialog or any other chrome inside a category keeps its neutral face: only badge-category, chip-category, schedule-event-category and icon-frame-category read the roles.
#The palettes
Every palette sits at one lightness per role, so no category weighs more than another, and each role clears its contrast in Moonstone, Obsidian and Paper: the text 4.5:1 and the mark 3:1, on its own surface and on the base and raised faces. The hue and the chroma are the palette's own; a yellow's text leans toward amber, as the preset's darker steps do, instead of turning olive.
The palettes
<div class="flex flex-wrap justify-center gap-xs max-w(560)"> <span class="badge badge-category badge-dot category-stone">Stone</span> <span class="badge badge-category badge-dot category-gray">Gray</span> <span class="badge badge-category badge-dot category-zinc">Zinc</span> <span class="badge badge-category badge-dot category-neutral">Neutral</span> <span class="badge badge-category badge-dot category-slate">Slate</span> <span class="badge badge-category badge-dot category-brown">Brown</span> <span class="badge badge-category badge-dot category-orange">Orange</span> <span class="badge badge-category badge-dot category-amber">Amber</span> <span class="badge badge-category badge-dot category-yellow">Yellow</span> <span class="badge badge-category badge-dot category-lime">Lime</span> <span class="badge badge-category badge-dot category-green">Green</span> <span class="badge badge-category badge-dot category-beryl">Beryl</span> <span class="badge badge-category badge-dot category-teal">Teal</span> <span class="badge badge-category badge-dot category-cyan">Cyan</span> <span class="badge badge-category badge-dot category-sky">Sky</span> <span class="badge badge-category badge-dot category-blue">Blue</span> <span class="badge badge-category badge-dot category-indigo">Indigo</span> <span class="badge badge-category badge-dot category-violet">Violet</span> <span class="badge badge-category badge-dot category-purple">Purple</span> <span class="badge badge-category badge-dot category-fuchsia">Fuchsia</span> <span class="badge badge-category badge-dot category-pink">Pink</span> <span class="badge badge-category badge-dot category-crimson">Crimson</span> <span class="badge badge-category badge-dot category-red">Red</span></div><div className="flex flex-wrap justify-center gap-xs max-w(560)"> <span className="badge badge-category badge-dot category-stone">Stone</span> <span className="badge badge-category badge-dot category-gray">Gray</span> <span className="badge badge-category badge-dot category-zinc">Zinc</span> <span className="badge badge-category badge-dot category-neutral">Neutral</span> <span className="badge badge-category badge-dot category-slate">Slate</span> <span className="badge badge-category badge-dot category-brown">Brown</span> <span className="badge badge-category badge-dot category-orange">Orange</span> <span className="badge badge-category badge-dot category-amber">Amber</span> <span className="badge badge-category badge-dot category-yellow">Yellow</span> <span className="badge badge-category badge-dot category-lime">Lime</span> <span className="badge badge-category badge-dot category-green">Green</span> <span className="badge badge-category badge-dot category-beryl">Beryl</span> <span className="badge badge-category badge-dot category-teal">Teal</span> <span className="badge badge-category badge-dot category-cyan">Cyan</span> <span className="badge badge-category badge-dot category-sky">Sky</span> <span className="badge badge-category badge-dot category-blue">Blue</span> <span className="badge badge-category badge-dot category-indigo">Indigo</span> <span className="badge badge-category badge-dot category-violet">Violet</span> <span className="badge badge-category badge-dot category-purple">Purple</span> <span className="badge badge-category badge-dot category-fuchsia">Fuchsia</span> <span className="badge badge-category badge-dot category-pink">Pink</span> <span className="badge badge-category badge-dot category-crimson">Crimson</span> <span className="badge badge-category badge-dot category-red">Red</span></div><div class="flex flex-wrap justify-center gap-xs max-w(560)"> <span class="badge badge-category badge-dot category-stone">Stone</span> <span class="badge badge-category badge-dot category-gray">Gray</span> <span class="badge badge-category badge-dot category-zinc">Zinc</span> <span class="badge badge-category badge-dot category-neutral">Neutral</span> <span class="badge badge-category badge-dot category-slate">Slate</span> <span class="badge badge-category badge-dot category-brown">Brown</span> <span class="badge badge-category badge-dot category-orange">Orange</span> <span class="badge badge-category badge-dot category-amber">Amber</span> <span class="badge badge-category badge-dot category-yellow">Yellow</span> <span class="badge badge-category badge-dot category-lime">Lime</span> <span class="badge badge-category badge-dot category-green">Green</span> <span class="badge badge-category badge-dot category-beryl">Beryl</span> <span class="badge badge-category badge-dot category-teal">Teal</span> <span class="badge badge-category badge-dot category-cyan">Cyan</span> <span class="badge badge-category badge-dot category-sky">Sky</span> <span class="badge badge-category badge-dot category-blue">Blue</span> <span class="badge badge-category badge-dot category-indigo">Indigo</span> <span class="badge badge-category badge-dot category-violet">Violet</span> <span class="badge badge-category badge-dot category-purple">Purple</span> <span class="badge badge-category badge-dot category-fuchsia">Fuchsia</span> <span class="badge badge-category badge-dot category-pink">Pink</span> <span class="badge badge-category badge-dot category-crimson">Crimson</span> <span class="badge badge-category badge-dot category-red">Red</span></div><template> <div class="flex flex-wrap justify-center gap-xs max-w(560)"> <span class="badge badge-category badge-dot category-stone">Stone</span> <span class="badge badge-category badge-dot category-gray">Gray</span> <span class="badge badge-category badge-dot category-zinc">Zinc</span> <span class="badge badge-category badge-dot category-neutral">Neutral</span> <span class="badge badge-category badge-dot category-slate">Slate</span> <span class="badge badge-category badge-dot category-brown">Brown</span> <span class="badge badge-category badge-dot category-orange">Orange</span> <span class="badge badge-category badge-dot category-amber">Amber</span> <span class="badge badge-category badge-dot category-yellow">Yellow</span> <span class="badge badge-category badge-dot category-lime">Lime</span> <span class="badge badge-category badge-dot category-green">Green</span> <span class="badge badge-category badge-dot category-beryl">Beryl</span> <span class="badge badge-category badge-dot category-teal">Teal</span> <span class="badge badge-category badge-dot category-cyan">Cyan</span> <span class="badge badge-category badge-dot category-sky">Sky</span> <span class="badge badge-category badge-dot category-blue">Blue</span> <span class="badge badge-category badge-dot category-indigo">Indigo</span> <span class="badge badge-category badge-dot category-violet">Violet</span> <span class="badge badge-category badge-dot category-purple">Purple</span> <span class="badge badge-category badge-dot category-fuchsia">Fuchsia</span> <span class="badge badge-category badge-dot category-pink">Pink</span> <span class="badge badge-category badge-dot category-crimson">Crimson</span> <span class="badge badge-category badge-dot category-red">Red</span> </div></template>#One category, named once
Put the class on what belongs to the category, a row, a card or an event, and every part inside that opts in reads it. A part with no category around it falls back to the neutral roles.
One category, named once
<ul class="list max-w(420) w-full"> <li class="list-row category-violet"> <span class="icon-frame icon-frame-sm icon-frame-category list-media" aria-hidden="true"> <svg class="icon" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"> <circle cx="8.75" cy="8.75" r="5.75" /><path d="M12.8159 12.8159L17.5 17.5" /> </svg> </span> <span class="list-body"> <span class="list-title">Interview notes</span><span class="list-description">12 files</span> </span> <span class="list-end"><span class="badge badge-category">Research</span></span> </li> <li class="list-row category-teal"> <span class="icon-frame icon-frame-sm icon-frame-category list-media" aria-hidden="true"> <svg class="icon" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round"> <rect x="3" y="3" width="14" height="14" rx="1.25" /><path d="M6.75 10L13.25 10" /><path d="M10 6.75L10 13.25" /> </svg> </span> <span class="list-body"> <span class="list-title">Token audit</span><span class="list-description">4 files</span> </span> <span class="list-end"><span class="badge badge-category">Design system</span></span> </li></ul>import SearchIcon from '@master/icons-react/native/20/soft/search'import SquarePlusIcon from '@master/icons-react/native/20/soft/square-plus'<ul className="list max-w(420) w-full"> <li className="list-row category-violet"> <span className="icon-frame icon-frame-sm icon-frame-category list-media" aria-hidden="true"> <SearchIcon className="icon" /> </span> <span className="list-body"> <span className="list-title">Interview notes</span><span className="list-description">12 files</span> </span> <span className="list-end"><span className="badge badge-category">Research</span></span> </li> <li className="list-row category-teal"> <span className="icon-frame icon-frame-sm icon-frame-category list-media" aria-hidden="true"> <SquarePlusIcon className="icon" /> </span> <span className="list-body"> <span className="list-title">Token audit</span><span className="list-description">4 files</span> </span> <span className="list-end"><span className="badge badge-category">Design system</span></span> </li></ul><script> import SearchIcon from '@master/icons-svelte/native/20/soft/search' import SquarePlusIcon from '@master/icons-svelte/native/20/soft/square-plus'</script><ul class="list max-w(420) w-full"> <li class="list-row category-violet"> <span class="icon-frame icon-frame-sm icon-frame-category list-media" aria-hidden="true"> <SearchIcon class="icon" /> </span> <span class="list-body"> <span class="list-title">Interview notes</span><span class="list-description">12 files</span> </span> <span class="list-end"><span class="badge badge-category">Research</span></span> </li> <li class="list-row category-teal"> <span class="icon-frame icon-frame-sm icon-frame-category list-media" aria-hidden="true"> <SquarePlusIcon class="icon" /> </span> <span class="list-body"> <span class="list-title">Token audit</span><span class="list-description">4 files</span> </span> <span class="list-end"><span class="badge badge-category">Design system</span></span> </li></ul><script setup>import SearchIcon from '@master/icons-vue/native/20/soft/search'import SquarePlusIcon from '@master/icons-vue/native/20/soft/square-plus'</script><template> <ul class="list max-w(420) w-full"> <li class="list-row category-violet"> <span class="icon-frame icon-frame-sm icon-frame-category list-media" aria-hidden="true"> <SearchIcon class="icon" /> </span> <span class="list-body"> <span class="list-title">Interview notes</span><span class="list-description">12 files</span> </span> <span class="list-end"><span class="badge badge-category">Research</span></span> </li> <li class="list-row category-teal"> <span class="icon-frame icon-frame-sm icon-frame-category list-media" aria-hidden="true"> <SquarePlusIcon class="icon" /> </span> <span class="list-body"> <span class="list-title">Token audit</span><span class="list-description">4 files</span> </span> <span class="list-end"><span class="badge badge-category">Design system</span></span> </li> </ul></template>#Tell it in words too
A color is never the only way a category is told. Write its name in the badge or the chip, or beside the dot; a reader who cannot tell teal from green, a printout in grey and a screen reader all need the words. A category color chosen by a user is not a role of the theme and has not been checked for contrast: map it to the nearest named palette, or show it as content, in a swatch.
In forced colors the system colors replace the tints: the words, the edges and a chosen filter keep their system colors, and only a swatch, whose color is its content, keeps its own.
#Retune a palette
The roles are tokens of the theme, --color-category-<name>-surface, -text, -line and -mark, so a theme retunes a palette as it retunes any color: set the four in a theme of its own and keep their contrast. To give a scope a palette of its own, set the four public properties on it.
@theme { --color-category-teal-surface: light-dark(oklch(96% .03 190), oklch(28% .04 190)); --color-category-teal-text: light-dark(oklch(45% .08 190), oklch(87% .09 190));}#Classes
| Class | Description |
|---|---|
category-stone | Sets the stone category for this element and what it holds |
category-gray | Sets the gray category for this element and what it holds |
category-zinc | Sets the zinc category for this element and what it holds |
category-neutral | Sets the neutral category for this element and what it holds |
category-slate | Sets the slate category for this element and what it holds |
category-brown | Sets the brown category for this element and what it holds |
category-orange | Sets the orange category for this element and what it holds |
category-amber | Sets the amber category for this element and what it holds |
category-yellow | Sets the yellow category for this element and what it holds |
category-lime | Sets the lime category for this element and what it holds |
category-green | Sets the green category for this element and what it holds |
category-beryl | Sets the beryl category for this element and what it holds |
category-teal | Sets the teal category for this element and what it holds |
category-cyan | Sets the cyan category for this element and what it holds |
category-sky | Sets the sky category for this element and what it holds |
category-blue | Sets the blue category for this element and what it holds |
category-indigo | Sets the indigo category for this element and what it holds |
category-violet | Sets the violet category for this element and what it holds |
category-purple | Sets the purple category for this element and what it holds |
category-fuchsia | Sets the fuchsia category for this element and what it holds |
category-pink | Sets the pink category for this element and what it holds |
category-crimson | Sets the crimson category for this element and what it holds |
category-red | Sets the red category for this element and what it holds |
#Custom properties
| Property | Default | Description |
|---|---|---|
--category-surface | The tinted surface of a category part. Set by every category-<name> class; a part without one falls back to its neutral surfaceSet on category-blue | |
--category-text | Text on the category surface; 4.5:1 against it and against the base and raised facesSet on category-blue | |
--category-line | A decorative contour around the category surface; it is never the only edge of a controlSet on category-blue | |
--category-mark | A dot or a bar that marks the category; 3:1 against the category surface and the base and raised facesSet on category-blue |
#Related
- BadgeA small chip for a status, a category or a count.
- ChipA small pill that is a filter or a removable value.
- ScheduleEvents placed in time: a day or a week as hours down a rail, a month as weeks of lanes, or an agenda.
- Icon frameA small well that holds an icon at its size beside a heading.