-
-
Notifications
You must be signed in to change notification settings - Fork 349
Add Open Props emitter (<host>-open-props.css) #106
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomersjavascriptPull requests that update javascript codePull requests that update javascript codetransformExtends the remix/transformation axisExtends the remix/transformation axis
Description
Activity
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomersjavascriptPull requests that update javascript codePull requests that update javascript codetransformExtends the remix/transformation axisExtends the remix/transformation axis
Add a new emitter that writes Open Props (https://open-props.style) CSS custom properties from the extracted DTCG tokens. Mirrors the existing emitters in
src/formatters/.Why
Open Props is a popular zero-runtime CSS variables library and a natural fit for designlang's output. Adding it means users can plug an extraction straight into an Open Props project without a manual translation step.
What to build
src/formatters/open-props.jsexportingformatOpenProps(design)that returns a string of@layerblocks following the Open Props conventions:Wire it up
formatOpenPropsto the extract command's emit loop inbin/design-extract.js(search for whereformatTailwindis written).website/lib/build-files.jsso the web extractor includes it too.tests/formatters.test.js(use the existingmockDesignfixture; assert the output contains--brand-1and a known value).Acceptance
npx designlang stripe.comwritesstripe-com-open-props.cssalongside the other outputs.node --test tests/formatters.test.jspasses including the new test.Scope
~60 lines of code plus a test. The closest reference implementation is
src/formatters/css-vars.js.