Description
It seems that all current transpilation steps happen before any of the custom transforms, but the renaming of idents from CSS modules happening after custom transforms.
I don't know how viable it is, but the way I'd expect it to work:
- Entry custom transforms.
- Built-in transpilation, CSS Modules idents.
- Exit custom transforms.
This way it would be possible to adjust things both before the built-in transpilation, and after CSS Modules.
Use cases:
-
Using a custom
env()
visitor to replace it with some value which is then statically transpiled. Example: doing something likecolor-mix(in srgb, env(--my-color), transparent)
. Right now this will not transpile thecolor-mix
as it will be done before the custom transforms, even though we could expand theenv()
into a static color. -
Adjusting the ident names for CSS Modules. This could allow to work around things like More control over CSS modules dashed-idents naming #315.
If it is not possible to achieve with the custom setup, I wonder what could be the alternatives?