calm-tokens

Implements the Calm design token set as Dart ThemeExtensions with hand-authored ColorSchemes and contrast gates.

Updated Sep 2, 2026
One-click install
npx skills add https://github.com/zakariaf/Odova --skill calm-tokens-zakariaf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: calm-tokens
Source: https://github.com/zakariaf/Odova/tree/main/.claude/skills/calm-tokens
Command: npx skills add https://github.com/zakariaf/Odova --skill calm-tokens-zakariaf

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Porting a hand-tuned CSS design system into Flutter without losing its intent is error-prone: seed algorithms flatten deliberate chroma ramps, CSS blur and em units convert incorrectly, and raw hex values leak into widget code where they silently hardcode one brightness. This Skill defines the complete contract for expressing the Calm token set in Dart so every colour, radius, duration and font size traces back to the design source. ## Core Features & Use Cases - Two-tier token architecture: Tier-1 primitives named by measured OKLCH lightness confined to one file, with semantic slots on five ThemeExtensions (CalmColors, CalmType, CalmSpace, CalmShapes, CalmMotion) that widgets read. - Hand-authored ColorScheme mapping: A full 24-role M3 mapping for both brightnesses, with measured evidence for why ColorScheme.fromSeed cannot reproduce Calm's warm ramp, plus deliberately neutral parked roles. - Enforcement scripts and audits: Shell gates that fail CI on raw values outside lib/theme/calm/ or on ThemeExtension fields missing from copyWith/lerp, plus a measured WCAG contrast audit with seven documented findings. - Use Case: When adding a new status colour to a Flutter app, use this Skill to place the hex in the palette file, expose it as a four-rung CalmRamp slot, wire it through copyWith and lerp, and verify the contrast pair in the unit test. ## Quick Start Ask the assistant to add a new semantic colour token to the Calm theme following the calm-tokens rules, including its dark-mode value and contrast check.

Frequently Asked Questions about calm-tokens

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

FAQPage Schema
How do I convert CSS design tokens to Flutter ThemeExtensions?

Define one ThemeExtension per token group (colours, type, spacing, shapes, motion) with an asserting of(context) accessor, and carry every field through copyWith and lerp. Convert CSS blur radius with (cssBlur / 2 - 0.5) / 0.57735 and em tracking with fontSize multiplied by the em value.

Why should I avoid ColorScheme.fromSeed for a custom palette?

ColorScheme.fromSeed builds neutrals from the seed's hue at a fixed chroma, so it cannot reproduce a hand-tuned ramp whose chroma rises across surfaces. Seeding on a brand colour at hue 47 degrees regenerates warm paper surfaces as rosy pink, so the scheme must be hand-authored role by role.

How do I enforce design token usage in a Flutter codebase?

Confine all colour, duration, radius and font-size literals to a single theme directory and run a grep-based CI gate that fails on raw values elsewhere. A second script can verify every ThemeExtension field appears in both copyWith and lerp, catching fields the compiler cannot see.

Does CSS box-shadow blur radius map directly to Flutter BoxShadow?

No. CSS blur radius is 2 sigma while Flutter converts blurRadius with r * 0.57735 + 0.5, so pasting the CSS number ships shadows 1.2 to 1.65 times too soft. The correct conversion is blurRadius = (cssBlur / 2 - 0.5) / 0.57735.

How do I test colour contrast compliance in Flutter?

Declare a list of foreground, background and minimum-ratio triples and walk them over both light and dark theme instances in a unit test that fails the build. This turns WCAG 4.5:1 text and 3:1 non-text thresholds into a CI gate rather than a review opinion.

When should a status colour not be used as text colour?

When its measured contrast on the surface is below 4.5:1, such as an amber due colour at 3.44:1. Structure status families as a four-rung ramp where base is the graphic dot, ink is text on tint, tint is the fill, and edge is the boundary, so widgets cannot pick an illegal pairing.