Skip to content
This repository was archived by the owner on Dec 28, 2022. It is now read-only.

Commit 4a8e73a

Browse files
author
Florian Torres
committed
Refacto color variables + add Shadows variables
1 parent 9c102ac commit 4a8e73a

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Tokens supported for tailwind exporter :
123123
- [x] Color definitions
124124
- [ ] Text Styles
125125
- [ ] Gradients
126-
- [ ] Shadows
126+
- [x] Shadows
127127
- [ ] Borders
128128
- [ ] Radii
129129
- [ ] Measures
Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
module.exports = {
22
'colors': {
3-
{[ let allColorsToken = @ds.tokensByType("Color") /]}
4-
{[ let groups = @js.getGroups(allColorsToken.sorted()) /]}
5-
{[ for group in groups ]}
6-
{[ let tokensByGroup = @js.getTokensByGroup(allColorsToken, group) /]}
7-
'{{ group }}': {
8-
{[ for token in tokensByGroup ]}
3+
{[ const colorGroup = @ds.tokenGroupTreeByType("Color") /]}
4+
{[ traverse colorGroup property subgroups into subgroup ]}
5+
{[ if @boolean.not(subgroup.isRoot) ]}
6+
'{{ subgroup.name.lowercased() }}' : {
7+
{[ const tokens = @ds.tokensByGroupId(subgroup.id) /]}
8+
{[ for token in tokens ]}
99
{[ let tokenName = token.name.replacing("$", "") /]}
1010
'{{ @boolean.ternaryValue(@compare.equals(tokenName, "main"), "DEFAULT", tokenName) }}': 'var(--{[ inject "rendered-name" context token /]})', {[ inject "rendered-description" context token /]}
11-
{[/]}
11+
{[/]}
1212
},
1313
{[/]}
14+
{[/]}
15+
},
16+
'boxShadow': {
17+
{[ const shadowTokens = @ds.tokensByType("Shadow") /]}
18+
{[ for token in shadowTokens ]}
19+
{[ let tokenName = token.name.replacing("$", "") /]}
20+
'{{ @boolean.ternaryValue(@compare.equals(tokenName, "main"), "DEFAULT", tokenName) }}': 'var(--{[ inject "rendered-name" context token /]})', {[ inject "rendered-description" context token /]}
21+
{[/]}
1422
}
1523
}

0 commit comments

Comments
 (0)