Skip to content

css/color-hex-style

enforce hex color style

  • ⚙️ This rule is included in "plugin:css/standard".
  • 🔧 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 a consistent hex color style.

This rule was inspired by Stylelint's color-hex-length rule.

Now loading...

🔧 Options

json
{
  "css/color-hex-style": ["error",
    "RGB", // "RRGGBB"
  ]
}
  • "RGB" ... Enforce RGB(A) style. This is default.
  • "RRGGBB" ... Enforce RRGGBB(AA) style.

📚 Further reading

🚀 Version

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

🔍 Implementation