Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better (or configurable) order of built-in transpilation vs custom transforms vs CSS modules #893

Open
kizu opened this issue Jan 13, 2025 · 0 comments

Comments

@kizu
Copy link

kizu commented Jan 13, 2025

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:

  1. Entry custom transforms.
  2. Built-in transpilation, CSS Modules idents.
  3. Exit custom transforms.

This way it would be possible to adjust things both before the built-in transpilation, and after CSS Modules.

Use cases:

  1. Using a custom env() visitor to replace it with some value which is then statically transpiled. Example: doing something like color-mix(in srgb, env(--my-color), transparent). Right now this will not transpile the color-mix as it will be done before the custom transforms, even though we could expand the env() into a static color.

  2. 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant