Check a Candor brand file
theme_checkCheck a brand file (candor-brand.css, or any CSS that sets Candor's tokens) the way npx candor-ui theme check does: colour contrast of every text and edge pairing in light, dark and high contrast, each with its ratio and the ratio it needs; then the --cd-motion-* and --cd-sound-* values against the motion manifest; then token names and data-slot selectors against the token manifest, as warnings that don't fail the check (a --cd-* name the kit doesn't read, with the nearest one it does; a value outside a token's range; an internal --cd-* name a brand file shouldn't set; a [data-slot] selector no component renders). Call it with the file's contents after you edit candor-brand.css, and fix what it reports before you say the theme is done. Returns a short summary (failures first, with a suggested lightness that would pass; findings with file, line and the fix), then the findings as JSON (ok, motionChecked, counts, themes with every pairing, suggestions, motionAndSound.findings, tokens.findings). Anything it can't read (a color-mix(), a var(), a sound file) is reported as not measured, never as a pass. Sound files are not measured here: the server can't see your public/ folder, so npx candor-ui theme check in the project does that. It checks against the current kit; an older @candor-kit in the file is checked against the current names, with a note. It reads only the CSS you send, follows no @import and fetches nothing. At most 256 KB. Example arguments: { "css": ":root { --primary: oklch(0.55 0.2 260); --cd-motion-pop-dur: 140ms; }", "filename": "candor-brand.css" }
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"css": "<css>"
},
"name": "theme_check"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| css | Yes | The CSS to check: the whole text of candor-brand.css (at most 256 KB). | |
| filename | No | What to call it in findings (default candor-brand.css). |