Feature: add CSS custom properties export (--format css-vars) for native CSS consumers
Add a CLI export target for CSS variables, for example:
npx @google/design.md export --format css-vars DESIGN.md > design.tokens.css
Expected output
Generate a :root block with stable, semantic custom properties derived from tokens, e.g.:
:root {
--color-primary: #1A1C1E;
--color-secondary: #6C7278;
--spacing-sm: 8px;
--spacing-md: 16px;
--rounded-sm: 4px;
--rounded-md: 8px;
}
Optionally support:
--selector :root--prefix ds- dark-theme/media-query variants later if the spec grows there
Why this helps
- makes DESIGN.md more useful outside Tailwind ecosystems
- gives coding agents a direct artifact they can apply in native CSS codebases
- improves adoption for frameworks that want CSS variables as the implementation boundary
- complements DTCG export without requiring downstream token tooling
Current roadmap linkage refresh: issue #15 remains a direct follow-up under #29 (Token interoperability roadmap). The current canonical sequence is #30 (workspace/build reliability) first, then export-surface delivery such as #15 and #19, with #28 after those and #27 as a cross-cutting spec dependency where needed.
Reviewing this one soon!
Implemented in https://github.com/google-labs-code/design.md/pull/109 - a new --format css-vars export emits a :root { ... } block of CSS custom properties from the token set, with an optional --prefix. Scope matches the issue: core format plus prefix, dark-theme/media-query variants deferred.