rt-tools-styling-tokens

Validates design tokens, dark theme completeness, and contrast pairs in Angular UI kit styles.

1|Updated Jan 14, 2024
One-click install
npx skills add https://github.com/Eyhenij/rt-tools --skill rt-tools-styling-tokens-eyhenij
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rt-tools-styling-tokens
Source: https://github.com/Eyhenij/rt-tools/tree/main/.claude/skills/rt-tools-styling-tokens
Command: npx skills add https://github.com/Eyhenij/rt-tools --skill rt-tools-styling-tokens-eyhenij

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Styling tokens in a themeable Angular UI kit silently break when references are undeclared, dark theme overrides are forgotten, or generated style files are edited by hand. This Skill encodes the rules and checks that keep the token graph, dark theme, and built styling layer consistent. ## Core Features & Use Cases - Token graph validation: Runs pnpm run check:tokens-graph to classify every token name as declared, a consumer handle, or a dead reference, using tools/tokens-handles.json and an allowlist. - Dark theme and contrast auditing: Runs pnpm run check:tokens-theme to verify every light color assignment is either overridden in the dark theme or marked /* rt-theme-shared: reason */, and checks contrast pairs at a 4.5:1 threshold. - Generated styling layer discipline: Enforces editing tokens.source.mjs instead of built files, verified by pnpm run check:tokens-build and the generator tools/build-tokens-v2.mjs. - Use Case: When adding a new color token to the UI kit, declare it in the source file with its dark answer, rebuild, and let the three checks confirm no dead references, missing dark overrides, or contrast regressions. ## Quick Start Ask the assistant to add a new styling token to the UI kit and verify it with the token graph, theme, and build checks.

Frequently Asked Questions about rt-tools-styling-tokens

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a new design token to an Angular UI kit?

Declare the token in projects/ui-kit-v2/src/styles/tokens.source.mjs next to its dark theme answer, then rebuild with the generator. Run pnpm run check:tokens-graph and check:tokens-build to confirm the reference resolves and built files match.

How do I check dark theme completeness for CSS custom properties?

Run pnpm run check:tokens-theme, which parses the value graph and reports missing dark overrides. Every light color assignment must either be overridden in the dark theme or marked with an rt-theme-shared comment giving a reason.

Why is my CSS variable not applying even though the rule exists?

The token is likely a dead reference: it is referenced but never declared and not listed as a consumer handle in tools/tokens-handles.json. The check:tokens-graph command detects these cases, since the CSS rule applies but the value silently does nothing.

Can I edit the generated token stylesheets directly?

No. Built style files are regenerated from tokens.source.mjs by tools/build-tokens-v2.mjs, so in-place edits are lost on the next build. The check:tokens-build audit flags any divergence between source and built output.

What contrast ratio is required for theme color pairs?

All pairs listed in tools/tokens-contrast-pairs.json must meet a single 4.5:1 threshold. The list is maintained by hand, and reviewers are responsible for ensuring no pair is forgotten.