-
Notifications
You must be signed in to change notification settings - Fork 3
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
Replace Theo with Style Dictionary #967
Conversation
|
Note there is one bit of code that I'd like to DRY up — at the top of most of the design token story files (see Since I'm being pulled back to client work tomorrow and this PR is already pretty big, I decided to leave the code as-is for now. Assuming @tylersticka is okay with it, I'll file a followup ticket to come back and DRY that up. (Note if someone else is interested, the "definitive" version of that code can be found in |
@calebeby I tagged you in this as an FYI since we were talking about the JSX code not working. Don't feel obligated to review, though. |
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's nice that Style Dictionary doesn't require as much up-front logic as Theo did. But I'll be honest, this doesn't feel like an upgrade in its current state:
- As mentioned in the PR description, we're now requiring repetitive code across the story documentation that we weren't before. This will make it more difficult for contributors to make new token groups.
- Previously, you would
@import
a category once and then refer to it by that name. Now, every token is output to a single monolithictokens
object, increasing the number of characters you need to type to refer to them. This will also make looping over tokens more difficult than it would be otherwise, something we've had to hack around in a different project. - Although we already have a dependency for defining JS build scripts (Gulp) and triggering it on file changes (also Gulp), this PR uses a bare Node script and a new Chokidar dependency. This feels like an artifact of a different project and confuses the organization of this specific project.
While I support this change long-term, my feelings haven't changed since Monday: If this will take more than a couple of hours to resolve, it's probably best to create an issue and return to it after more of our user-facing tasks have been addressed.
* v-next: (156 commits) Update dependency js-yaml to v4 (#1119) Update dependency @whitespace/storybook-addon-html to v4 (#1105) Update Storybook and Storybook Addons Update dependency @cypress/webpack-preprocessor to v5.6.0 Update babel monorepo to v7.12.17 Update dependency css-loader to v5.0.2 Update dependency @changesets/cli to v2.14.1 Update babel monorepo to v7.12.16 Object: Bunch (#1130) Update dependency sass to v1.32.5 Update dependency postcss-loader to v4.2.0 Update dependency mini-css-extract-plugin to v1.3.5 Update dependency @changesets/cli to v2.14.0 Update dependency cypress to v6.3.0 Update dependency @wordpress/block-library to v2.27.2 Update dependency @rollup/plugin-node-resolve to v11.1.0 Update dependency @changesets/cli to v2.13.1 Update dependency @changesets/changelog-github to v0.2.8 Update dependency storybook-mobile to v0.1.29 Update dependency sass to v1.32.2 ...
The danger of walking away from a PR of this scope for six months is that the merge conflicts when you come back will take a full day to reconcile. I've now got this PR updated and I'll tackle the changes @tylersticka requested shortly. |
* v-next: Add Sky Nav Behavior (#748)
@tylersticka I've addressed your feedback, and I think you'll be much happier with the current state of this PR, especially the new token groupings, which allows for using the Sass tokens in almost exactly the same way as before. The Sass The one thing I'm unhappy with in this PR is the Story files for the tokens. Previously, these were automatically generated by Theo. Now they're manually created, and still have the duplicate code issue. However, I think the rest of the changes are beneficial enough to warrant merging this as-is and filing a new issue to address that. It should be possible to generate the Story files with Style Dictionary, but this PR is already quite large. Unless you see any reason we shouldn't move forward with Style Dictionary, I'd like to merge this and start working on that ticket as a follow-up. Let me know if you'd like to talk about this PR with voices. CC'ing @Paul-Hebert as a reviewer since he's had hands on Style Dictionary recently for a client project and may have insight or feedback. |
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 awesome. I love the changes to naming conventions, the config for categories seems intuitive to me, I dig the use of the modular functions instead of custom transform types, and overall the outputs seem like the best of both worlds now.
The only thing stopping me from marking "Approve" is that I have not had time to do a pass for regressions in the patterns. If someone else is able to do so, that would be swell!
I should be able to do a regression pass this afternoon 👍 |
Added a new issue for DRYing the design token story files up, or auto-generating them with Style Dictionary: #1143 |
Doing a regression pass now (not planning to review the code since it sounds like Tyler has already but if you'd like code review as well lemme know) |
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.
@spaceninja I did a regression test and I spotted no differences on components, utilities, etc.
I did notice that for some reason on the preview deploy the Prism docs page is missing. I also see an error in the console:
Unexpected error while loading ./vendor/prism/prism.stories.mdx: ReferenceError: Prism is not defined
I'm not sure what the deal is... I don't see any obvious changes that would have broken this but I also didn't do a deep dive on the code. Any idea what's going on there?
Okay, I fixed the Prism error. No idea why that broke on my branch, but the fix was simple enough. |
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.
🚢
Overview
This PR changes the tool we use to manage our design tokens from Theo to Style Dictionary. We're making this change because we've used it on several other projects and been impressed with the flexibility it gives us.
Testing
Review the preview environment, and confirm there are no visual changes other than the color values changing from RGB to hex values.
npm ci
andnpm run storybook
Code Review
Apologies for the size of this changeset. You'll probably want to break your code review up by file type: