Token validations
Validation runs after SET_CONFIG and before the configurable theme is rendered. A rejected
canonical override is removed independently and its resolved default or legacy value remains.
Rendering continues.
| Diagnostic | Behavior |
|---|---|
INVALID_OVERRIDE | The incompatible value or property is discarded |
INSUFFICIENT_CONTRAST_AAA | The value is applied, but improving its contrast is recommended |
UNKNOWN_TOKEN | The unknown token, category or typography property is ignored |
LEGACY_OVERRIDE | The legacy value is applied and a migration warning is emitted |
LEGACY_NO_EFFECT | The accepted legacy key does not affect rendering |
Diagnostics are grouped under the [Consents Theme] console prefix and are not repeated while the
same issue remains active. If it is fixed and later occurs again, it is emitted again.
Type compatibility
Each scalar domain token accepts only paths from the matching DS branch.
| Domain type | Accepted paths |
|---|---|
| Color | DS tokens compatible with the usage; valid CSS colors are also accepted |
| Spacing | style.semantic.spacing.* and style.primitives.spacing.*, up to 4xl or 80px |
| Radius | style.semantic.radius.* and style.primitives.size.*, except full values |
| Border | style.semantic.border.* and style.primitives.stroke.* |
| Size | style.primitives.size.{400,500,600,800} |
| Shadow | shadow.light.* and shadow.dark.* |
Paths for another type, raw numeric values and arbitrary strings are not accepted by the canonical API. Direct CSS values are supported only for color.
Configuration may use the short references shown by the editor, such as primary, sm, 400,
thin or md. Compatible fully qualified DS paths remain accepted.
Color and shadow paths are normalized to the active theme mode. A light semantic path in a dark theme resolves through its corresponding dark path when available.
Typography compatibility
A canonical typography override selects one complete style. The object form accepts only style,
family, desktop and mobile; breakpoint objects accept style and family. Size, weight,
line height and letter spacing always come from the selected style.
Available styles depend on the domain token:
title-typography:h1throughh6styles.footer-button-typography:base,mdandxsbutton styles.- Other public tokens:
base-*,md-*,sm-*andxs-*body styles.
The family accepts only the Inter and Menlo primitives. An incompatible property or style is
discarded independently and the previously resolved value remains.
Contrast
Contrast checks run when either side of one of these canonical pairs is overridden:
| Foreground | Background | Rule |
|---|---|---|
title-color | header-background-color | Large text |
description-color | header-background-color | Normal text |
language-selector-text-color | language-selector-menu-background-color | Normal text |
parent-statement-text-color | parent-statement-background-color | Normal text |
parent-statement-description-color | parent-statement-background-color | Normal text |
footer-button-text-color | footer-button-background-color | Normal text |
footer-button-text-color | footer-button-hover-background-color | Normal text |
footer-button-text-color | footer-button-pressed-background-color | Normal text |
validation-alert-text-color | validation-alert-background-color | Normal text |
validation-alert-icon-color | validation-alert-background-color | UI/large |
dialog-text-color | dialog-background-color | Normal text |
Normal text must meet WCAG AA 4.5:1. Large text and UI uses must meet 3:1. If a pair does not
meet AA, the foreground canonical override is discarded when present; otherwise the background
override is discarded. If it meets AA but not AAA, the value is applied and
INSUFFICIENT_CONTRAST_AAA is emitted. Validation then runs again until no failing configured pair
remains.
Common opaque CSS formats are supported, including hexadecimal, rgb(), hsl() and named colors.
A translucent foreground is composited over an opaque background before contrast is calculated.
Decorative borders are not blocked by contrast validation.
Legacy validation
Legacy categories keep their previous accepted raw values and sanitizer behavior so existing payloads continue to work. They are adapted to domain tokens after legacy resolution.
The compatibility-only legacy rules are:
- All five former typography properties remain accepted. Font size must be between
14pxand40px, and line height cannot be lower than font size. spacing-dialog-padding,spacing-dialog-padding-xandspacing-dialog-padding-ymust be at least8px.spacing-statement-help-icon-sizeaccepts12pxthrough40pxand cannot exceed the lower configured line height ofbody-mediumandbase-medium.
In the canonical API, statement-help-icon-size accepts only 400, 500, 600 and 800
(16px through 32px) and does not depend on legacy line height.
Do not use those broader legacy value rules for new configuration. They are retained only for
backwards compatibility and do not expand the values accepted by design.tokens.