-
Notifications
You must be signed in to change notification settings - Fork 4
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
Style: css tokens #85
Conversation
@@ -75,7 +76,8 @@ | |||
"build-dist": "sh ./scripts/build-dist.sh", | |||
"build-storybook": "storybook build", | |||
"lint": "eslint --ext .ts,.tsx \"src/**/*.{ts,tsx}\"", | |||
"lint:fix": "eslint --ext .ts,.tsx \"src/**/*.{ts,tsx}\" --quiet --fix" | |||
"lint:fix": "eslint --ext .ts,.tsx \"src/**/*.{ts,tsx}\" --quiet --fix", | |||
"tokens-to-css": "npx style-dictionary build --config ./style-dictionary.json" |
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.
bringing back the recently removed code 😮💨
@@ -1,6 +1,498 @@ | |||
:root { |
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 is the generated file
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.
Nice!
src/utils/GetGlobalToken.ts
Outdated
@@ -0,0 +1,29 @@ | |||
// From https://ant.design/docs/react/customize-theme | |||
// Run this script and copy the globalToken into /design/GlobalToken.json | |||
|
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.
currently its a little hacky to run this, im copy/pasting it into the button story, so that the code runs inside the ant context.
if you have an idea [that only takes ~ 5 mins to implement] its worth a shot to make this more push-button-get-json
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.
Tried some alternatives with using npx ts-node
or compiling the code with tsc
and running it through Node but none of them worked seamlessly, so I guess we keep using the copy approach
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 do have one more idea, creating a story that runs the code. perhaps then chromatic would alert on changes in design tokens as well
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.
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.
Nice!
src/styles/readme.md
Outdated
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.
praise docs 👏🏼
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.
lgtm
|
||
const globalToken = wrapValuesInObject(getDesignToken(useTheme())) | ||
|
||
return <>{JSON.stringify(globalToken, null, 1)}</> |
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.
tried wrapping on <pre><code></code></pre>
but it didn't work well 😞
🎉 This PR is included in version 1.6.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Instructions
main
Summary
Testing Plan
Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)