Open ehoogeveen-medweb opened 1 day ago
Hi @ehoogeveen-medweb,
Sounds good to add this!
We have a similar section here: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-design-tokens#syntax
It's a bit lengthy and includes things not really relevant for postcss-rewrite-url
, but maybe a good starting point.
I was examining our (somewhat neglected) Stylelint config recently and found declaration-property-value-no-unknown, which IIUC may be enabled by default soon. Enabling this rule turned out to be very helpful for us, finding a number of bugs in our CSS :)
However, it took me a while to figure out how to make it work with
rewrite-url()
. Eventually I came up with this (thefunction-no-unknown
exception is included for completeness):This extends
<url>
to also acceptrewrite-url()
type values, which may be somewhat overly broad but works like a charm for us. Technicallyurl()
takesurl( <string> <url-modifier>* )
but I wasn't sure ifrewrite-url()
supports these (theoretical?) modifiers.What do you think?