AndyOGo / stylelint-declaration-strict-value

Specify properties for which a variable, function, keyword or value must be used.
MIT License
134 stars 10 forks source link

Support regex for "ignoreVariables" #200

Open asos-tomp opened 2 years ago

asos-tomp commented 2 years ago

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!

AndyOGo commented 2 years ago

Thank you for your request.

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).