check_token_fallbacks
Validates CSS for complete var() fallback chains and detects hardcoded colors that prevent theme switching.
Instructions
Validates consumer CSS for proper var() fallback chains and detects hardcoded colors that break theme switching. Catches var() calls without fallback values (fragile if token undefined), hardcoded hex/rgb/hsl/named colors on color properties (breaks dark mode), and named CSS colors used directly instead of tokens. Run this on any CSS that references design tokens.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| libraryId | No | Optional library ID to target a specific loaded library instead of the default. | |
| cssText | Yes | The CSS code to validate for token fallback usage. | |
| tagName | Yes | The custom element tag name to validate against (e.g. "sl-button"). |