-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to Style Dictionary v4 #203
Conversation
ab5e757
to
6ddbba3
Compare
dist/docsite/android/dimens.xml
Outdated
<dimen name="cdr_text_default_subheadline_line_spacing">20.00dp</dimen> | ||
<dimen name="cdr_text_default_body1_size">15.00sp</dimen> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is size intended to be added to the output?
package.json
Outdated
@@ -1,6 +1,7 @@ | |||
{ | |||
"name": "@rei/cdr-tokens", | |||
"version": "12.2.0", | |||
"version": "12.3.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we expecting any breaking changes with this update?
https://rei-coop.atlassian.net/wiki/spaces/TP/pages/31031923/Cedar+Release+Checklist
style-dictionary/build.mjs
Outdated
import { colorCssTransitive } from './transforms/color/color-css-transitive.mjs' | ||
import { hex8AndroidTransitive } from './transforms/color/hex8-android-transitive.mjs' | ||
import { uiColorTransitive } from './transforms/color/uicolor-transitive.mjs' | ||
import { spTransitive } from './transforms/size/sp-transitive.mjs' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this new?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, for now to support token.attribute.category
style-dictionary/build.mjs
Outdated
import { js as jsFormat } from './formats/js.mjs' | ||
import { site } from './formats/site.mjs' | ||
import { figma as figmaFormat } from './formats/figma.mjs' | ||
import { androidColors, androidDimens, androidFontDimens } from './formats/android.mjs' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where are these coming from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the SD v4 source code, just changing the code a bit to support token.attributes.category
https://github.com/amzn/style-dictionary/blob/main/lib/common/formats.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of this code is gonna be removed when the tokens are updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you planning to update the tokens as a follow on of as part of this PR?
19ec846
to
6eb3850
Compare
README.md
Outdated
value # *required* The token value (most token values should be referenced from options) | ||
category # *required* The tokens category (used to transform values for their specific platform) | ||
$value # *required* The token value (most token values should be referenced from options) | ||
$type # *required* The tokens category (used to transform values for their specific platform) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"# required The tokens category"
to
"# required The tokens type"
README.md
Outdated
@@ -130,13 +130,13 @@ Token output of above: | |||
|
|||
Categories define how style-dictionary should transform values between platforms. | |||
|
|||
For example, a category of "size" will transform to 'rem' for SCSS/LESS but 'dp' for Android. A category of "font-size" will still transform values to 'rem' for SCSS/LESS but 'sp' for Android. | |||
For example, a category of "size" will transform to 'rem' for SCSS/LESS but 'dp' for Android. A category of "fontSize" will still transform values to 'rem' for SCSS/LESS but 'sp' for Android. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
category to type
@@ -185,19 +185,19 @@ docs: { | |||
|
|||
Deprecated tokens should be moved to a seprate file (or into the existing file) which corresponds to the release cycle in which they will be deprecated. | |||
|
|||
For example, if tokens will be considered deprecated in the "Winter 2019" release they would be moved into a file called `deprecated-2019-winter.json5` in whichever directory they currently reside. Structure for naming the file is : `deprecated-<year>-<release>` | |||
For example, if tokens will be considered deprecated in the "Winter 2019" release they would be moved into a file called `deprecated-2024-summer.json5` in whichever directory they currently reside. Structure for naming the file is : `deprecated-<year>-<release>` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Q4 2024"
deprecated-2024-Q2.json
README.md
Outdated
'on-dark': { | ||
value: '{options.color.heart-of-darkness}', | ||
category: 'color', | ||
'deprecated-2019-winter': { // <-------- `deprecated-<year>-<release>` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"deprecated-2024-Q4"
--cdr-text-heading-serif-strong-900-size: 3.6rem; | ||
--cdr-text-heading-serif-strong-900-height: 4.4rem; | ||
--cdr-text-heading-serif-strong-1000-family: Stuart, "Stuart fallback", Georgia, serif; | ||
--cdr-text-heading-serif-strong-1000-style: normal; | ||
--cdr-text-heading-serif-strong-1000-weight: 600; | ||
--cdr-text-heading-serif-strong-1000-spacing: 0px; | ||
--cdr-text-heading-serif-strong-1000-spacing: 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this makes me feel that there should just be a much smaller heading spacing token
--cdr-text-heading-spacing: 0;
"filePath": "tokens/web/text-heading.json5", | ||
"$extensions": { | ||
"studio.tokens": { | ||
"originalType": "letterSpacing" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this allows it to map back?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
dist/docsite/figma/figma.json
Outdated
} | ||
}, | ||
"note": { | ||
"value": "#c4b03b", | ||
"type": "color" | ||
"$value": "hsl(51, 54%, 50%)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are these converting to HSL?
grid.mjs
Outdated
'background-colors': formattedTokens | ||
} | ||
|
||
console.log(`https://contrast-grid.eightshapes.com/?${queryString.stringify(urlData)}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be super helpful to
- add documentation on confluence that informs design and product on how to access this chart
- add a GHPages directory and publish this to it so that its always available
dist/rei-dot-com/json/global.json
Outdated
} | ||
}, | ||
{ | ||
"value": "rgba(3, 3, 1, 0.9)", | ||
"$value": "rgba(3, 3, 1, 0.9)", | ||
"$type": "color", | ||
"alpha": 0.9, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do these alpha nodes do anything at this point? it looks like the alpha is included in the rgba
dist/rei-dot-com/json/global.json
Outdated
"alpha": 0.75, | ||
"category": "color", | ||
"$value": "rgba(12, 11, 8, 0.75)", | ||
"alpha": ".75,", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think the alpha should be a string?
6eb3850
to
da8ac6c
Compare
da8ac6c
to
c55dbd5
Compare
c55dbd5
to
959c43c
Compare
706f09e
to
1bd960b
Compare
0bafb87
to
c41383c
Compare
c86c90e
to
dfa04ff
Compare
0674c47
to
ebc3d8b
Compare
ebc3d8b
to
02b2ddf
Compare
This PR includes an update to SD v4 and its several configurations.
Migration guideline: https://styledictionary.com/version-4/migration/