-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Plugin order not respected #1786
Comments
|
Thanks @ai for the reply. I have the need to keep some of those plugins due to theming purposes, the example I provided is just a bit of an existing css theme we created. There is something I can do to keep |
Can you show me the |
Why not: @mixin bb-badge-palette black;
@mixin bb-badge-palette gray;
@mixin bb-badge-palette purple;
@mixin bb-badge-palette aqua;
@mixin bb-badge-palette green;
@mixin bb-badge-palette yellow;
@mixin bb-badge-palette red;
@mixin bb-badge-palette primary;
@mixin bb-badge-palette secondary; |
It's because I need to cycle those colors in lot of components, this is sort of a boilerplate for our projects and at every project we could have a different palette, so it's convenient to define the list of colors once and cycle in every component intead of editing it in 20+ files. |
In this case you will need to keep |
Why do you have |
Actually I can get rid of it, but issue remains with |
The big complexity of your case could hide the real issue. We need to simplify stack first. Maybe you have a simple use case of exact issue with tailwindcss/nesting, tailwindcss and autoprefixer? |
I created a repo for this issue https://github.com/giusepetroso/postcss-plugin-issue |
Sorry, it is very big project for debug.
|
Hi, finally I got some time to make the minimal debug project. Now on the master branch of the same test repo (https://github.com/giusepetroso/postcss-plugin-issue) I did some polishing. I completely removed Vuejs from the compilation. Doing a recap, this is the postcss.config.js In the /src folder there I put two css files
To make "expected.css" I first ran "npm run build" with this config then I re-ran "npm run build" (compiling the previous css result) with this config basically splitting the compilation in two phases. If you need some other explainations ask me. |
I am not getting the point since I've no |
Oops. Wrong issue. (I will look into your bug when I will finish my vacation) |
No worries man, have a nice vacation :) |
Sorry, I still can’t help here sine the test case is too complicated and big. Seems like it is better for you to separated Tailwind and other plugins. |
But the fact is I need to keep Tailwind into the postCSS plugins, it is actually the point, if I remove it there is no issue. I'm not getting your request, now the project is just the essential css, but Tailwind is part of the problem I cannot exclude it. Let me understand what do you mean please. |
There is no such thing as plugins order. They all applying to CSS in the same moment with an event system. To fix your bug, we need to do a lot of work in plugins communication. You need to report an issue to Tailwind (seems like the issue is in their event system). |
Hi guys,
I don't know if I am doing something wrong but I'm experiencing some problem figuring out why plugins seems to run not in the order I specified in postcss.config.js.
I created a new vue 3 project and installed tailwindcss, postcss and some plugins to show what I am talking about, I will try to explain some steps I'm doing to figure out.
I published it on github here
Starting with main.css
The package.json
The vite.config.js
The postcss.config.js
Now, if i run
npm run dev
with current postcss configSeems like mixin plugin is not working, ok.
I tried removing plugins until I found the config which works:
Removing those 2 plugins seemed to be working, output css is what I was expecting
Now
Trying to add only postcss-simple-vars:
Same error as above I think, I don't know if is the @each or the @mixin plugin
Trying to add only tailwindcss:
Different error but still @each or @mixin plugin not working well I think
I need all of those plugins and I'm sure if each on of those would be executed one at a time it'll be ok, but in the same process they do this mess.
I'm not sure how plugins are executed but I read that the order matters, so there are any chances that some plugin takes priority or it's been executed asynchronously?
Sorry for the long post, again, here is the repo to reproduce
https://github.com/giusepetroso/postcss-plugin-issue
I'm not sure if I should have posted this issue here, or on a specific plugin but actually I can't figure out what is going on so feel free to send me to an other appropriate repo.
Thanks a lot,
Giuse.
The text was updated successfully, but these errors were encountered: