Skip to content

css/named-color

enforce named colors

  • 🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

📖 Rule Details

This rule aims to apply consistent use of named colors.

This rule was inspired by Stylelint's color-named rule.

Now loading...

🔧 Options

json
{
  "css/named-color": ["error",
    "always", // or "never"
    {
      "ignoreProperties": []
    }
  ]
}
  • "always" ... Require always use named colors, if can use named colors. This is default.
  • "never" ... Disallow use named colors.
  • ignoreProperties ... You can specify property names or patterns that you want to ignore from checking.

📚 Further reading

🚀 Version

This rule was introduced in eslint-plugin-css v0.4.0

🔍 Implementation