Closed Bug 1988862 Opened 2 months ago Closed 1 month ago

Add a Stylelint rule to enforce using space tokens

Categories

(Developer Infrastructure :: Lint and Formatting, task)

Tracking

(firefox146 fixed)

RESOLVED FIXED
146 Branch
Tracking Status
firefox146 --- fixed

People

(Reporter: hjones, Assigned: dwhisman)

References

(Blocks 3 open bugs)

Details

(Whiteboard: [recomp][acorntractors])

Attachments

(1 file)

We should add a Stylelint rule to enforce only using --space-* tokens for any margin-*, padding-*, *-gap, and inset-* properties. This rule may be autofixable, but it'll take some doing since we'll often be going from hardcoded px values to rem based values. That being said it might be nice to have a mapping with the values specified in comments here, so that we can autofix 8px to --space-small, for example. This work will include documentation, tests, and adding an entry to our rollouts file, but will not include expanding our token offerings or fixing any existing errors.

Out of all the rules we're adding this one feels like the one where we're most likely to introduce visual regressions when we start fixing it due to font size differences across platforms.

No longer depends on: 1988860
Blocks: 1988872
Assignee: nobody → dwhisman
Status: NEW → ASSIGNED
  • Add tests for margin shorthand
  • Add tests for padding shorthand
  • Add tests for inset shorthand
  • Add tests for gap shorthand
  • Add tests for margin/padding block/inline shorthand
  • Add tests for margin/padding longhand properties
  • Remove tokens-table values from auto-fixable list
  • Add tests for inset block/inline, plus top, left, right, and bottom
  • Add tests for column-gap and row-gap
  • Add tests for keywords
  • Add files to be ignored for rollout
Blocks: 1993108
Pushed by oarnesto@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/36d5a96930b1 https://hg.mozilla.org/integration/autoland/rev/0260a6a2bfcb Add a Stylelint rule to enforce using space tokens r=frontend-codestyle-reviewers,hjones
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 146 Branch
Blocks: 1996683
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: