Closed Bug 1838298 Opened 2 years ago Closed 4 months ago

Introduce CSS lint rule to prevent base design tokens from being used directly

Categories

(Toolkit :: Themes, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
132 Branch
Tracking Status
firefox132 --- fixed

People

(Reporter: hjones, Assigned: hjones)

References

(Blocks 3 open bugs)

Details

(Whiteboard: [recomp])

Attachments

(2 files)

With the landing of Bug 1508369 we now have stylelint enabled for linting CSS files. We should try take advantage of this to implement a custom linter rule to warn or prevent people from using our base token values directly. Currently there's no way to know the intended use of those variables without reading this comment.

Whiteboard: [fidefe-reusable-components]
Whiteboard: [fidefe-reusable-components] → [recomp]

This patch lays the foundation for a Mozilla-specific Stylelint plugin that we can continue to expand on with new rules as needed. For the first rule I've implemented a simple check to ensure our color tokens are being used as intended.

Assignee: nobody → hjones
Status: NEW → ASSIGNED
Attachment #9425687 - Attachment description: WIP: Bug 1838298 - custom stylelint rule to prevent using color tokens directly → Bug 1838298 - Part 2: fix color token usage in line with new Stylelint rule r=#desktop-theme-reviewers
Blocks: css-linting
Blocks: 1861526
Pushed by hjones@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f4e625378c9e Custom Stylelint plugin to prevent color tokens from being used directly r=Standard8,frontend-codestyle-reviewers,desktop-theme-reviewers,dao https://hg.mozilla.org/integration/autoland/rev/53cefe94a9f5 Part 2: fix color token usage in line with new Stylelint rule r=desktop-theme-reviewers,settings-reviewers,reusable-components-reviewers,home-newtab-reviewers,dao,thecount
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 132 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: