Releases: amzn/style-dictionary
v4.0.0-prerelease.37
Minor Changes
-
8450a45: Some fixes for Expand utility:
- Array values such as
dashArray
property ofstrokeStyle
tokens no longer get expanded unintentionally,typeof 'object'
check changed toisPlainObject
check. - Nested object-value tokens (such as
style
property insideborder
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.
- Array values such as
v4.0.0-prerelease.36
Minor Changes
-
39f0220: Allow not throwing fatal errors on broken token references/aliases, but
console.error
instead.You can also configure this on global/platform
log
property:{ "log": { "errors": { "brokenReferences": "console" } } }
This setting defaults to
"error"
when not configured.resolveReferences
andgetReferences
warnImmediately
option is set totrue
which causes an error to be thrown/warned immediately by default, which can be configured tofalse
if you know those utils are running in the transform/format hooks respectively, where the errors are collected and grouped, then thrown as 1 error/warning instead of multiple.Some minor grammatical improvements to some of the error logs were also done.
v4.0.0-prerelease.35
Minor Changes
- c06661d: Re-add and update example basic, fix copySync command in CLI, fix android templates to use $type for DTCG tokens.
v4.0.0-prerelease.34
Patch Changes
- ba03ee9: Fix for expand utility on platform level to adjust the token's path property.
v4.0.0-prerelease.33
v4.0.0-prerelease.32
Minor Changes
- af5cc94: Create
formatPlatform
andformatAllPlatforms
methods.
This will return the outputs and destinations from the format hook for your dictionary, without building these outputs and persisting them to the filesystem.
Additionally, formats can now return any data type instead of requiring it to be astring
anddestination
property infiles
is now optional.
This allows users to create formats intended for only formatting tokens and letting users do stuff with it during runtime rather than writing to files.
Patch Changes
v4.0.0-prerelease.31
Patch Changes
- c708325: Moving the @zip.js/zip.js dependency from a devDependency to a normal dependency.
v4.0.0-prerelease.30
Minor Changes
-
7418c97: Add a couple of utilities for converting a regular Style Dictionary tokens object/file(s) to DTCG formatted tokens:
convertToDTCG
convertJSONToDTCG
convertZIPToDTCG
v4.0.0-prerelease.29
Minor Changes
- cb94554: 'size/rem' transform to not transform tokens that already have a unit, such as
"4px"
, this should not be transformed to"4rem"
.
Patch Changes
- cb94554: Fix typeDtcgDelegate util $type property position to be allowed anywhere in the object, not just at the top.
- 0972b26: Pass SD options to fileheaders and filters, to make it easier to use and adjust according to config or options like usesDTCG.
- 4ec34fd: Pass options to all of the filter functions in our built-in transforms, to check for
usesDTCG
and$type
property. - 0972b26: Add unfilteredAllTokens property in dictionary object for formats, which is an unfiltered version of allTokens property, or a flattened version of the unfilteredTokens property.
v4.0.0-prerelease.28
Minor Changes
-
4225d78: Added the following transforms for CSS, and added them to the
scss
,css
andless
transformGroups:fontFamily/css
-> wraps font names with spaces in'
quotescubicBezier/css
-> array value, put insidecubic-bezier()
CSS functionstrokeStyle/css/shorthand
-> object value, transform to CSS shorthandborder/css/shorthand
-> object value, transform to CSS shorthandtypography/css/shorthand
-> object value, transform to CSS shorthandtransition/css/shorthand
-> object value, transform to CSS shorthandshadow/css/shorthand
-> object value (or array of objects), transform to CSS shorthand
The main intention here is to ensure that Style Dictionary is compliant with DTCG draft specification out of the box with regards to exporting to CSS, where object-value tokens are not supported without transforming them to shorthands (or expanding them, which is a different feature that was added in
4.0.0-prerelease.27
).
Patch Changes
- a5bafac: Colors that are not recognized by tinycolor2 as valid color formats (e.g.
linear-gradient(...)
) are now ignored by the builtin color transforms filter functions.