Generate data from design-tokens.json that can be used for custom Stylelint rules
Categories
(Developer Infrastructure :: Lint and Formatting, task)
Tracking
(firefox143 fixed)
| Tracking | Status | |
|---|---|---|
| firefox143 | --- | fixed |
People
(Reporter: hjones, Assigned: jooliver)
References
(Blocks 1 open bug)
Details
(Whiteboard: [recomp][acorntractors])
Attachments
(1 file)
design-tokens.json is our source of truth for everything design tokens related. We use Style Dictionary to transform it into various CSS files, and we also use it to generate tokens-storybook.mjs, which provides the data for our design tokens table.
Ideally we can use design-tokens.json as the source of truth for our custom Stylelint rules too, so that the variables the rules are checking for will get updated automatically when we rename/add/remove tokens. This could take the form of either adding a new Style Dictionary format, or possibly just refactoring and renaming tokens-storybook.mjs to something more generic that can work for multiple purposes. I have a POC commit demonstrating this latter approach here.
Here's the tentative list of rules I think we'll want/be able to add, which should inform the data structure (I'm open to suggestions and feedback on this):
- background-color
- border-color (likely includes some
outlinevalues) - border-radius
- border-width (less sure about this/lower priority)
- font-size
- font-weight
- opacity
- size
- space
- text-color
- icon-color (might be hard to determine if it's actually getting applied to an icon or not)
- icon-size (might be hard to determine if it's actually getting applied to an icon or not)
- box-shadow
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
Comment 1•1 year ago
|
||
Renames tokens-storybook.mjs to tokens-table.mjs and updates usage.
This work is a prerequisite for upcoming work to create custom style lint rules.
Comment 4•1 year ago
|
||
Backed out for causing node design failures
Backout link: https://hg-edge.mozilla.org/integration/autoland/rev/e017d715b3469da7d9af5baee947dda4afa878b5
Log link: https://treeherder.mozilla.org/logviewer?job_id=521943147&repo=autoland&lineNumber=417
Comment 6•1 year ago
|
||
| bugherder | ||
Description
•