-
Notifications
You must be signed in to change notification settings - Fork 557
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: allow specifying platform for preprocessors * feat: allow expanding object value tokens using expand config * feat: align preprocessor API, adjust expand API
- Loading branch information
1 parent
6a6b3cb
commit 7713b43
Showing
27 changed files
with
1,736 additions
and
362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
'style-dictionary': major | ||
--- | ||
|
||
BREAKING: preprocessors must now also be explicitly applied on global or platform level, rather than only registering it. This is more consistent with how the other hooks work and allows applying it on a platform level rather than only on the global level. | ||
|
||
`preprocessors` property that contains the registered preprocessors has been moved under a wrapping property called `hooks`. | ||
|
||
Before: | ||
|
||
```js | ||
export default { | ||
// register it inline or by SD.registerPreprocessor | ||
// applies automatically, globally | ||
preprocessors: { | ||
foo: (dictionary) => { | ||
// preprocess it | ||
return dictionary; | ||
} | ||
} | ||
} | ||
``` | ||
|
||
After: | ||
|
||
```js | ||
export default { | ||
// register it inline or by SD.registerPreprocessor | ||
hooks: { | ||
preprocessors: { | ||
foo: (dictionary) => { | ||
// preprocess it | ||
return dictionary; | ||
} | ||
} | ||
}, | ||
// apply it globally | ||
preprocessors: ['foo'], | ||
platforms: { | ||
css: { | ||
// or apply is per platform | ||
preprocessors: ['foo'] | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
'style-dictionary': minor | ||
'style-dictionary': major | ||
--- | ||
|
||
BREAKING: expose getReferences and usesReference utilities as standalone utils rather than requiring them to be bound to dictionary object. This makes it easier to use. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'style-dictionary': minor | ||
--- | ||
|
||
Allow expanding tokens on a global or platform-specific level. Supports conditionally expanding per token type, or using a function to determine this per individual token. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.