stylelint-declaration-strict-value icon indicating copy to clipboard operation
stylelint-declaration-strict-value copied to clipboard

Support regex for "ignoreVariables"

Open TomStrepsil opened this issue 4 years ago • 1 comments

It'd be great if this plugin could be used to enforce conformance to a style-guide set of custom properties / variables.

I'd love to be able to supply a regex (as with "ignoreValues") to ensure that when a color property is used, it must take a value from a defined list of css custom properties.

Ideally would allow use of these properties within rgba(), so that a variable can represent a RGB triplet, a common technique for specifying a palette without restricting free-use of opacity.

Looks almost exactly what I need!

TomStrepsil avatar Nov 18 '21 19:11 TomStrepsil

Thank you for your request.

  • Property specific configurations are tracked here #146
  • a regex could be used to restrict the name of the variable, same for functions

This plugin does not parse CSS values, which would be necessary to check an arguments names or length.

Such a feature needs clear descriptions, examples and CSS spec conformance (+Less, Sass, etc).

AndyOGo avatar Nov 19 '21 16:11 AndyOGo