File tree Expand file tree Collapse file tree 4 files changed +400
-7
lines changed Expand file tree Collapse file tree 4 files changed +400
-7
lines changed Original file line number Diff line number Diff line change @@ -16,16 +16,20 @@ import { css_to_tokens } from '@projectwallace/css-design-tokens'
1616let tokens = css_to_tokens (` .my-design-system { color: green; }` )
1717
1818// Or if you already have done CSS analysis with @projectwallace/css-analyzer:
19+ // NOTE: it is important that `useLocations` is true
1920import { analyze } from ' @projectwallace/css-analyzer'
2021import { analysis_to_tokens } from ' @projectwallace/css-design-tokens'
2122
22- let analysis = analyze (` .my-design-system { color: green; }` )
23- let tokens = css_to_tokens (analysis)
23+ let analysis = analyze (` .my-design-system { color: green; }` , {
24+ useLocations: true // MUST be true
25+ })
26+ let tokens = analysis_to_tokens (analysis)
2427```
2528
2629## Acknowledgements
2730
28- - ColorJS.io powers all color conversions necessary for grouping
31+ - [ CSSTree] ( https://github.com/csstree/csstree ) does all the heavy lifting of parsing CSS
32+ - [ ColorJS.io] ( https://colorjs.io/ ) powers all color conversions necessary for grouping and sorting
2933
3034## Related projects
3135
You can’t perform that action at this time.
0 commit comments