-
Notifications
You must be signed in to change notification settings - Fork 556
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: recursively expand nested composite tokens (#1244)
* feat: recursively expand nested composite tokens * fix: expand object type check, maintain ref if possible * fix: handle multi-value object tokens like shadows --------- Co-authored-by: Abel van Beek <abel.van.beek@tromsfylke.no> Co-authored-by: jorenbroekema <joren.broekema@gmail.com>
- Loading branch information
1 parent
c856761
commit 904d6b2
Showing
4 changed files
with
178 additions
and
11 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,10 @@ | ||
--- | ||
'style-dictionary': minor | ||
--- | ||
|
||
Some fixes for Expand utility: | ||
|
||
- Array values such as `dashArray` property of `strokeStyle` tokens no longer get expanded unintentionally, `typeof 'object'` check changed to `isPlainObject` check. | ||
- Nested object-value tokens (such as `style` property inside `border` tokens) will now also be expanded. | ||
- When references are involved during expansion, the resolved value is used when the property is an object, if not, then we keep the reference as is. | ||
This is because if the reference is to an object value, the expansion might break the reference. |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.