Skip to content

Commit 08e8f0b

Browse files
authored
Index tests (#1)
* add tests for index file * fix types * readme fixes
1 parent 62157ed commit 08e8f0b

File tree

4 files changed

+400
-7
lines changed

4 files changed

+400
-7
lines changed

readme.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,20 @@ import { css_to_tokens } from '@projectwallace/css-design-tokens'
1616
let 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
1920
import { analyze } from '@projectwallace/css-analyzer'
2021
import { 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

0 commit comments

Comments
 (0)