Open Bug 1979098 (stylelint-design-tokens) Opened 1 year ago Updated 25 days ago

[meta] Add custom Stylelint rules to encourage/enforce design token usage

Categories

(Developer Infrastructure :: Lint and Formatting, task)

Tracking

(Not tracked)

People

(Reporter: hjones, Unassigned)

References

(Depends on 9 open bugs, Blocks 1 open bug)

Details

(Keywords: meta, Whiteboard: [recomp][acorntractors])

I think we should be able to leverage custom Stylelint rules to drive design token adoption and automate a lot of the checks and education that currently come from manual code reviews. See this proposal for more details on the rationale and tentative implementation plan.

Depends on: 1979109
Depends on: 1979117
Alias: stylelint-design-tokens
Blocks: 1979115
No longer blocks: 1979115
Depends on: 1979115
Depends on: 1979118
Depends on: 1984177
Depends on: 1988856
Depends on: 1988859
Depends on: 1988860
Depends on: 1988862
Depends on: 1988863
Depends on: 1988864
Depends on: 1988028

We currently divide our tokens into a number of categories listed below. I've filed bugs for all of these except for the ones in bold. In those cases I've made a note about why.

  • background-color
  • border-color
  • border-radius
  • border-width (didn't file a bug for this since we only have a single value)
  • font-size
  • font-weight
  • opacity (we only have two tokens and they're button-specific)
  • 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

For all the linting bugs I've filed companion bugs to reassess our token scales once we can use the lint rule to help us get a list of all the values currently being used - see this bug for an example.

Depends on: 1992749
Depends on: 1993105
Depends on: 1993108
Depends on: 1994016
Depends on: 1994263
Depends on: 1995422
Depends on: 1995685
Depends on: 1996168
Depends on: 1996683
Depends on: 2001192
Depends on: 2006125
Depends on: 2007003
Depends on: 2007010
Depends on: 2010337
Depends on: 2018287
Depends on: 2022574
Depends on: 2029675
Depends on: 2067353
Depends on: 2068024
Depends on: 2068294
No longer depends on: 2068024
No longer depends on: 2067353
Depends on: 2070225
No longer depends on: 2070225
You need to log in before you can comment on or make changes to this bug.