-
Notifications
You must be signed in to change notification settings - Fork 8
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
Import design tokens from Figma instead of XD #1175
Comments
# Pull Request ## 🤨 Rationale This started as [a joke to modify some token values](https://60e89457a987cf003efc0a5b-fftmbqhrah.chromatic.com/?path=/story/tests-button--button-theme-matrix) but turned into refactoring how we source our design tokens when I wrapped my head around the problems with our current approach: 1. our documentation describes importing tokens from Adobe XD and using the Design System Provider but those processes no longer work 2. our Style Dictionary configuration and build scripts were in the `dist` directory when they should be source 3. the process to generate Style Dictionary output (the platform specific token files) was manual and the build output was checked into source The new approach is to remove DSP, make Style Dictionary JSON files in this repo our source of truth for design token values, and generate token output as part of the build. The changes I'm making here should make #1175 easier too. (The Figma plugin linked in that issue can output Style Dictionary JSON files). ## 👩💻 Implementation 1. Remove everything about storing tokens in XD and Design System Provider. The source of truth is now Style Dictionary JSON files. 2. Move Style Dictionary build configuration to the `source` directory. This required some changes to get lint to pass since some of these files weren't previously linted. (See comments in PR) 3. Generate Style Dictionary output as part of `npm run build` instead of checking it in to source 4. Update CONTRIBUTING docs to describe the current process 5. Pull token values for base tokens story from JS build output instead of JSON source. This changed the order of the tokens in the story. ## 🧪 Testing Made token changes and verified that the built components uptake them. ## ✅ Checklist <!--- Review the list and put an x in the boxes that apply or ~~strike through~~ around items that don't (along with an explanation). --> - [x] I have updated the project documentation to reflect my changes or determined no changes are needed. --------- Co-authored-by: rajsite <[email protected]>
I researched this during innovation days last week. You can see progress in this branch. Takeaways:
We decided we still want to do this but it might make sense to wait a little while for our Figma usage to stabilize. Right now we're still filling in a lot of missing tokens/components and figuring out the right organization. |
Brandon mentioned at team meeting today that he's considering renaming the meaning of tokens in Figma. A lot of the colors like "Black15" aren't actually "black at 15% opacity". It could be good to take this opportunity to make their names match their values. This will be a bigger breaking change but could be worthwhile to do as part of the transition. |
It doesn't seem like a high priority to align on naming conventions, token hierarchies, etc between design and dev. It'll also be costly to adopt tooling to export/import tokens. Closing this as low ROI. |
🧹 Tech Debt
Our documented process to get colors and sizes into
nimble-tokens
is to import them from Adobe XD. However the tooling for that process stopped working and we're moving away from XD towards Figma.The Figma components spec has token values in it too: we should figure out how to import values from there instead. One option to consider is this design tokens Figma plugin.
The text was updated successfully, but these errors were encountered: