design-system
design-system copied to clipboard
[NO-TICKET] Update token build scripts to use JSON source
Summary
Along with the Figma migration, we're implementing a new token storage method based on JSON (see this pull request for background info). Our previous scripts for exporting our token data into CSS, SCSS, CSV, and JSON are therefore outdated and need to be rewritten to take the new JSON format as input.
- Removed support for exporting tokens to CSV
- This was helpful when we didn't have any other tools for viewing token data in table format, but now we have Figma's variable editor tables, and they are actually really handy. We can always re-implement this in the future if we need it.
- Removed support for exporting tokens to JSON
- Our tokens are now natively in JSON, and we were previously exporting to this format to make it easier to import them into Sketch. We don't need to support that old Sketch code anymore.
- Rewrote the exporters for CSS and SCSS to use the JSON tokens as input
- Updated Figma-syncing code to support peculiarities with translating between CSS-based dimensional units and Figma's generic number type
- Updated the package README and included an explanation of our token structure from a high-level standpoint
How to test
- Instructions on how to test the changes in this PR.
Checklist
- [ ] Prefixed the PR title with the Jira ticket number as
[WNMGDS-####] Title
or [NO-TICKET] if this is unticketed work. - [ ] Selected appropriate
Type
(only one) label for this PR, if it is a breaking change, label should only beType: Breaking
- [ ] Selected appropriate
Impacts
, multiple can be selected. - [ ] Selected appropriate release milestone