The Stylelint Rule That Was Silently Rewriting Our SCSS…
    Neura MarketNeura Market/Stable Diffusion
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityStable DiffusionStable Diffusion
    DeepSeekDeepSeekCoPilotCoPilotMidjourneyMidjourney
    View All Directories
    OverviewPromptsBlogVideosGuidesCoursesCommunityModelsLoRAsComfyUI WorkflowsTrending
    Stable DiffusionBlogThe Stylelint Rule That Was Silently Rewriting Our SCSS Colors
    Back to Blog
    The Stylelint Rule That Was Silently Rewriting Our SCSS Colors
    angular

    The Stylelint Rule That Was Silently Rewriting Our SCSS Colors

    Sanket Bhor May 28, 2026
    0 views

    How color-function-notation silently rewrote rgba() to rgb() across our codebase — and three ways to fix it.


    title: The Stylelint Rule That Was Silently Rewriting Our SCSS Colors published: true description: How color-function-notation silently rewrote rgba() to rgb() across our codebase — and three ways to fix it. tags: angular, scss, stylelint, webdev

    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"
    

    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.

    What each value does

    ValueWhat it enforces
    "modern"rgb(0 0 0 / 0.7) — space-separated, slash for alpha
    "legacy"rgba(0, 0, 0, 0.7) — traditional comma-separated alpha syntax
    nullNothing — leaves your code exactly as you wrote it

    What we actually saw in our project was rgba() being rewritten to rgb(..., alpha) — not the standard modern space-separated conversion. More on that below.

    Worth knowing: none of this happens without auto-fix. If you're just running Stylelint normally, it warns. The actual rewrites only happen when you run stylelint --fix, have a CI step with --fix enabled, or have format-on-save turned on in your editor.

    Why this one is easy to miss

    A lot of articles about color-function-notation talk about the dramatic conversion — rgba(0, 0, 0, 0.7) turning into rgb(0 0 0 / 0.7). Space-separated, slash before alpha, completely different looking. Hard to miss.

    What we got was quieter:

    • Before: rgba(0, 0, 0, 0.7)
    • After: rgb(0, 0, 0, 0.7)

    Same commas. Same numbers. Just the a missing. In a busy PR review across dozens of files, that's almost invisible.

    And it's not purely cosmetic either. For us the issue showed up as diff noise — but depending on your setup, silent rewrites like this can have downstream effects worth watching for.

    For us honestly the bigger headache was just the diff noise. PR history full of color changes nobody made. Not ideal.

    One thing to check first

    If you're using stylelint-config-standard-scss — most Angular projects do — this rule is already on inside the preset, set to "modern". So even if you never added it yourself it might already be running. Before changing anything, figure out if it's in your own config or coming from the preset. That changes where you need to override it.

    In our case it was explicitly set in our own .stylelintrc:

    {
      "extends": ["stylelint-config-standard-scss"],
      "rules": {
        "color-function-notation": "legacy"
      }
    }
    

    Ways to fix it

    There's no one-size-fits-all here.

    Option 1 — Just turn it off

    {
      "rules": {
        "color-function-notation": null
      }
    }
    

    Stylelint leaves your color syntax alone entirely. No rewrites, no warnings.

    Good for: when you just need the noise to stop right now.

    Downside: mixed syntax sticks around forever if you never come back to it.

    Option 2 — Clean it up properly, separately

    {
      "rules": {
        "color-function-notation": "modern"
      }
    }
    

    Set it to "modern" and do one isolated cleanup PR — just this, nothing else mixed in. Audit your SCSS before running auto-fix.

    Good for: when you want consistency and have time to do it properly.

    Downside: needs some prep work. Don't just flip it and run.

    Option 3 — Scope it with overrides

    {
      "overrides": [
        {
          "files": ["**/*.scss"],
          "rules": {
            "color-function-notation": null
          }
        }
      ]
    }
    

    Keeps the rule active for CSS, disables it for SCSS only. More precise than a global disable and way cleaner than scattering /* stylelint-disable */ comments across your whole project.

    Good for: when you want enforcement on CSS but your SCSS theming files need to be left alone.

    Downside: bit more config, but honestly manageable.

    What we did

    Went with null. Stopped the noise, unblocked the team the same day. Will come back with a proper cleanup PR when things settle down. One thing at a time.

    If it's happening on every save locally

    Check VS Code before you go debugging your pipelines.

    The Stylelint extension has this:

    "stylelint.autoFixOnSave": true
    

    When that's on, --fix runs silently every single save. Seen teams spend a long time pointing fingers at CI when it was their own editor config the whole time.

    How to know if this is your issue

    • Color changes showing up in diffs nobody made
    • PR reviews catching rgba → rgb changes out of nowhere
    • Weird rendering after running stylelint --fix

    Check your .stylelintrc, .stylelintrc.json, or stylelint.config.js for color-function-notation. And check your extended presets too — it might not even be in your own config.

    tl;dr

    Stylelint auto-fix on an inconsistent codebase will rewrite things you didn't ask it to rewrite. The color-function-notation rule is one of the quieter offenders because the change it makes — rgba to rgb — is easy to overlook.

    Check your config, check your presets, and don't run auto-fix blind.


    I write about frontend problems from real projects — follow if that's useful.

    If this helped, drop a ❤️ — it helps with visibility.

    Connect with me:

    • LinkedIn: Sanket Bhor
    • Website: sanketbhor.dev

    Tags

    angularscssstylelintwebdev

    Comments

    More Blog

    View all
    Context bankruptcy: The case for strategic forgetting for AI Agentsai

    Context bankruptcy: The case for strategic forgetting for AI Agents

    Most of us have seen a coding agent fail to complete a task we know it can do. We just don't...

    J
    James O'Reilly
    Parallel Compliance Engine: Drive-to-Sheets Multi-Agent Orchestrationgooglecloud

    Parallel Compliance Engine: Drive-to-Sheets Multi-Agent Orchestration

    When building Generative AI applications, developers often encounter a massive bottleneck: sequential...

    A
    Aryan Irani
    Is It Ethical to Post and Ask About Circuits on Dev.to?discuss

    Is It Ethical to Post and Ask About Circuits on Dev.to?

    I’ve been thinking about sharing some electronic circuit posts on Dev.to — small circuits, DIY...

    C
    codebunny20
    The One-Click Exporter: AI Studio Antigravity, Probed to Its Limitsagents

    The One-Click Exporter: AI Studio Antigravity, Probed to Its Limits

    What nobody tells you about exporting your multi-agent prototype to a local workspace. Every...

    L
    leslysandra
    Guarding the till while autonomous data agents do the diggingagenticarchitect

    Guarding the till while autonomous data agents do the digging

    Autonomous agents are genuinely good at answering messy business questions. Give one an LLM and a set...

    S
    Sireesha Pulipati
    Return on Attention: Why AI Code Reviews Are Wearing Us Outai

    Return on Attention: Why AI Code Reviews Are Wearing Us Out

    PR volume went up, ticket quality didn't, and the gap got filled with LLMs on both sides of the review: bots reviewing, bots replying, bots occasionally arguing with bots about priorities that only existed in a teammate's head. Our CEO named the actual problem, and it's bigger than code review.

    C
    christine

    Stay up to date

    Get the latest Stable Diffusion prompts, rules, and resources delivered to your inbox weekly.

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for Stable Diffusion and more.

    Content Types

    • Rules
    • Prompts
    • MCPs
    • Agents
    • Guides

    Platforms

    • ChatGPT Directory
    • Claude Directory
    • Gemini Directory
    • Cursor Directory
    • Grok Directory
    • Perplexity Directory
    • DeepSeek Directory
    • CoPilot Directory
    • Stable Diffusion Directory
    • Midjourney Directory
    • All Directories

    Resources

    • Blog
    • Documentation
    • Help Center
    • Marketplace

    Legal

    • Privacy Policy
    • Terms of Service

    © 2026 Neura Market. All rights reserved.

    |

    Not affiliated with any AI platform vendors.