Skip to content

Fix false positives for variables and color functions in color-function-notation #5671

Closed
@cascornelissen

Description

Clearly describe the bug

A follow-up from #5638, where the original issue was fixed correctly in my tests but more advanced scenarios still result in false positives, e.g. when using Sass' color.mix within rgba().

Which rule, if any, is the bug related to?

color-function-notation

What code is needed to reproduce the bug?

@use 'sass:color';

$color: rgba(color.mix(#000, #fff, 35%), 0.6);

What Stylelint configuration is needed to reproduce the bug?

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

Which version of Stylelint are you using?

14.0.1 as well as main from commit e2c3473.

How are you running stylelint: CLI, PostCSS plugin, Node.js API?

stylelint \"src/**/*.scss\"

Does the bug relate to non-standard syntax (e.g. SCSS, Less etc.)?

Yes, SCSS color functions

What did you expect to happen?

No errors

What actually happened (e.g. what warnings or errors did you get)?

 25:27  ✖  Expected legacy color-function notation  color-function-notation

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions