-
Notifications
You must be signed in to change notification settings - Fork 0
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
Multiple configuration rules #1
Comments
Hey, I'm glad this is useful for you. I actually didn't consider this case of multiple different layers, and to be honest I'm not using the plugin myself at the moment (after I figured out browser support wasn't quite where I wanted a few years ago). I think this should be pretty straightforward to add, though. What do you think of an API like this? require('postcss-assign-layer')([
{
include: '**/styles/**.{css,scss}',
layerName: 'base',
},
{
include: '**/components/**/*.{css,scss}',
layerName: 'components',
},
]) It would be a breaking change, but I think that's fine. |
That would be great! 🙏 Yeah, now that layers have been well supported for a couple of years I'm much more comfortable using them. |
Fixes #1 This changes the config from a single object into an array of objects. This allows more flexibility if you have multiple different kinds of files that you want to wrap in layers (though if you only have a few, you should probably just add the layers to the files themselves for extra clarity when editing).
Alright, 0.2.0 is pushed up, let me know how it works for ya! |
Just the job! Thanks for such a quick response and update |
Thanks for the great plugin - especially to fix vitejs/vite#3924 when using lazy loaded components in Vite.
What's the preferred way to handle multiple rules, if possible?
To avoid another config I have my postcss set in my vite.config, which has to use the Array formatting, and this seems to work.
The text was updated successfully, but these errors were encountered: