Skip to content

False positives for CSS2 System Color keywords in value-keyword-case #1957

@ntwb

Description

@ntwb

Describe the issue. Is it a bug or a feature request (new rule, new option, etc.)?

I came across this today in relation to CSS2 System Color keyword case:

via https://www.w3.org/TR/CSS22/ui.html#system-colors
"Although these are case-insensitive, it is recommended that the mixed capitalization shown below be used, to make the names more legible."

Based on that recommendation should these ~28 system colors cases be ignored?
(Note: CSS System Colors are deprecated in CSS3)

Possible Solutions:

  1. Add a new value-keyword-case rule option ignoreSystemColors option with the ~28 keywords added to a new systemColors keyword set.
  2. Add a new keyword set systemColors and ignore all ~28 by default.
  3. Do nothing and have users use the existing value-keyword-case rule option ignoreKeywords to manually add the ~28 system colors to a "whitelist"

Which rule, if any, is this issue related to?

value-keyword-case

What CSS is needed to reproduce this issue?

.foo {
    outline: 1px dotted ButtonText;
}

What stylelint configuration is needed to reproduce this issue?

{
  "rules": {
    "value-keyword-case": "lower",
  }
}

Which version of stylelint are you using?

7.3.1

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

n/a

Does your issue relate to non-standard syntax (e.g. SCSS, nesting, etc.)?

No

What did you expect to happen?

No warnings to be flagged.

What actually happened (e.g. what warnings or errors you are getting)?

The following warnings were flagged:

test.css
1:21  Expected "ButtonText" to be "buttontext"             value-keyword-case

Metadata

Metadata

Assignees

Labels

status: wipis being worked on by someone

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions