Menu

Post image 1
Post image 2
1 / 2
0

The Stylelint Rule That Was Silently Rewriting Our SCSS Colors

DEV Community: angular·Sanket Bhor·3 days ago
#ekjpxnnb
Reading 0:00
15s threshold

A colleague flagged something odd in a PR review — our SCSS colors had changed. Not broken, just different. rgba(0, 0, 0, 0.7) had quietly become rgb(0, 0, 0, 0.7) across dozens of files. The a was just gone. Nobody on the team had touched those lines. No error. No warning. Just silent rewrites on every save. Took us a while to trace it back, but it was one line in .stylelintrc . The rule "color-function-notation" : "legacy" Enter fullscreen mode Exit fullscreen mode My first thought was — okay, "legacy" means keep the old syntax. That's literally what the word means. And technically it does enforce the older comma-separated format, so that part tracks. The issue was our codebase had gotten inconsistent. Some files had already picked up modern rgb() syntax through updated dependencies. The rest still used rgba() . When Stylelint's auto-fix kicked in, it just... normalised everything. Aggressively. Didn't ask, didn't warn. Hundreds of color changes in commits that had nothing to do with colors.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More