Tokens
Drive consistency through color – Apply colors to maintain visual harmony and brand recognition.
Accessibility
WCAG 2.1 AA governs this design system, with one substitution: contrast is measured with APCA, not with the WCAG contrast ratio.
Everything on this page is theme-wide — it holds for every component unless that component's own page says otherwise. Component pages carry only what is true about that one component; they do not restate any of this.
Contrast uses APCA
APCA replaces exactly two success criteria:
| Replaced | By |
|---|---|
| 1.4.3 Contrast (Minimum) | the Lc thresholds below |
| 1.4.11 Non-text Contrast | the Lc thresholds below |
Everything else in WCAG 2.1 AA applies unchanged. "We use APCA" is a statement about contrast only — it is not a licence to skip labels, keyboard support or focus order.
The reason for the swap is that the WCAG 2.x ratio is direction blind. It scores a pair identically whether the text is dark on light or light on dark, and it misjudges both mid-tones and dark mode. APCA models polarity and perceived lightness, and is the model developed for WCAG 3.
A pair that meets its Lc threshold is approved even if it would fail 1.4.3. Contrast ratio is not a second opinion here.
Thresholds
Read against the absolute value of Lc:
| |Lc| | Required for |
|---|---|
| 90 | Preferred for fluent body text and columns of text |
| 75 | Minimum for columns of body text |
| 60 | Minimum for content text that is not body, column or block text |
| 45 | Minimum for headlines |
| 30 | Minimum for non-text elements that carry information — icons, state indicators, control boundaries |
| 15 | Absolute floor; below this an element is not discernible |
Purely decorative elements have no contrast requirement.
The threshold comes from the role the element plays, not from a font-size and weight lookup. The lookup table in the APCA reference implementation is advisory and is deliberately not used here.
Two consequences worth keeping in mind:
- A positive Lc means dark on light, a negative one light on dark. Compare the absolute value against the table.
- Light and dark are measured separately. APCA uses different exponents per polarity, so one pair does not score the same in both schemes. A value taken in light mode says nothing about dark mode — which is why the tables on Color list both columns instead of one plus an inversion rule.
Focus is keyboard-only
theme.focusRing is 'auto', and the ring is drawn with the browser outline
rather than a box-shadow, so it follows the element's own shape. mc-design.css
sets one colour for every focus ring in the system — --mantine-color-blue-6 — and
gives buttons and links a 3px outline-offset so the ring clears the fill.
A pointer click must never draw the ring; Tab always must. That takes two
mechanisms, because :focus-visible alone is not enough:
- Buttons, icon buttons and similar controls suppress the ring with
:focus:not(:focus-visible). The browser heuristic gets these right on its own. - Text fields are the exception. Browsers always match
:focus-visibleon a text input regardless of how focus arrived, since the field keeps taking key input.useFocusModality()records how focus last moved asdata-focus-modalityon the root element, andinput.module.cssreads that attribute to suppress the ring on pointer focus.
useFocusModality is exported from the package and must be called once, near the
root of a consuming application. Without it, text fields draw a focus ring on
mouse click.
Do not remove a focus ring on the grounds that it looks wrong. If it looks wrong, that is a styling bug on the component.
Disabled
A disabled button-like control — Button, ActionIcon, SegmentedControl —
drops to 50% opacity and keeps its fill. It is not recoloured, so its shape and
identity stay readable.
Text inputs are the deliberate exception. They carry the disabled state through
colour alone and keep opacity: 1, because dimming would lighten the design system
colours rather than mute them.
Opacity alone does not explain why something is unavailable. A user who cannot see the dimming, or who can see it but not the reason for it, is left guessing. Put the reason in text near the control, or use a Tooltip in addition to the dimmed state — never instead of it.
Labelling
- Every
ActionIconneeds anaria-label, and so does every searchTextInput. An icon on its own is not an accessible name. - Name the thing acted on, not the action. In a list where every row has its
own delete button,
aria-label="Slett"is ambiguous to someone tabbing through twenty identical controls. Build the label from the row's own data —aria-label={`Slett ${rad.navn}`}. - A Tooltip is not a substitute for the accessible name. It helps a sighted user who hovers, but the name still has to live on the control itself; not every input method or assistive technology exposes tooltip content the same way.
- Form inputs use the
labelprop, which renders a real<label>tied to the input. An unlabelled control with text next to it is not the same thing. - Colour is never the only carrier of meaning. A status that is only a hue is invisible to a large group of users — pair it with a label, an icon or a shape.
Clickable elements that are not buttons
A div that responds to a click is a button to everyone except a keyboard and a
screen reader. Give it the whole set — role, tabIndex, onKeyDown for both
Enter and Space, and a label naming the thing it acts on:
function getClickableProps(
onClick: () => void,
ariaLabel: string,
): React.HTMLAttributes<HTMLDivElement> {
return {
onClick,
role: 'button',
tabIndex: 0,
onKeyDown: (e: React.KeyboardEvent) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
onClick();
}
},
'aria-label': ariaLabel,
};
}
Two things this pattern is not for:
- Not a table row.
role="button"overrides the<tr>'s implicitrowrole, which detaches its cells and degrades the row and column navigation a screen reader relies on in a data table.DataTablehas noonRowClickfor exactly this reason. - Not an element that contains its own controls.
buttonis one of the ARIA roles with presentational children: every descendant loses its semantics in the accessibility tree, so a checkbox or an icon button inside the clickable element stops being a checkbox or a button.e.stopPropagation()on the nested control stops the double activation, but it cannot hand the child its role back.
Both cases have the same fix: leave the container inert and put the interaction on
a real control inside it. A large pointer target may then be layered on top —
onClick on the container, with no role, tabIndex or key handler — but only
once the real control carries the keyboard path on its own.
What else applies unchanged
- Keyboard navigation works for every critical flow, and focus is always visible.
- 1.4.13 Content on Hover or Focus — hoverable content must stay reachable.
This is why
Tooltipisinteractiveglobally in the theme: a pointer can travel from the trigger into the tooltip without it closing underneath. - Semantic markup throughout: Mantine components over raw HTML, and no
hand-written
<table>. - Form inputs have associated labels, and error text is tied to the field rather than floating near it.
A note for projects built on this system
This is a design system, and the APCA substitution above is its own rule. A project subject to forskrift om universell utforming av IKT-løsninger is bound to WCAG 2.1 AA as written, which is ratio-based. Such a project has to decide for itself whether to add the contrast ratio as an additional floor on top of the Lc thresholds. That decision belongs to the project, not to this page.