-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
How to compile sass loop ? #1214
Comments
I'm not sure. With Anyway, this is all the info I have - I hope it helps - but I'm not sure what the problem is. |
At my starts with tailwind and webpack, I had this advice: https://discord.com/channels/486935104384532500/1101153891619459094/1102906464907046922 But I don't know how to do this kind of thing with webpack. Have any tips about it ? |
It doesn't look like I have access to that Discord or the message is missing. But sorry, I'm not sure I have any more info. |
Copy of th emessage: In your build pipeline, run sass and output to a temporary file, then run tailwind on that temporary file to generate your final CSS file (most likely through postcss) |
Can you provide a reproducer ? It might be easier to debug this. |
Hi. What is it ? My files are here: https://gitlab.com/themes-d9/starter-d9-2022.git branch: tailwindcss3-dev |
you are importing a |
you are talking about the |
but you cannot import your Sass files from your CSS file if you want them to be processed by the Sass loader. You need an import managed by webpack for than, not an import managed by postcss-import |
So nobody use tailwind + sass + webpack encore ? :/ The only info source I found is: https://www.yourigalescot.com/fr/blog/comment-integrer-tailwindcss-v3-a-un-projet-symfony-avec-webpack-encore |
Well, if you want to use Sass + tailwind, you have to make your entrypoint a Sass file, as you need to compile Sass before running postcss (Sass files gets processed by the stack of loaders configured for CSS files after the sass-loader itself, so postcss will run on them). |
Agree. But technically, does exist example or explanation about what to do this ? I never use webpack encore or tailwind before 3 month ago... :D |
don't import a SCSS file from a CSS file. That's the rule. If you want to use Sass, you need to make your main entrypoint a Sass file. |
ok, so I need to rewrite my scss files, then I will look if sccs and tailwind are compiled right or not, as this test say :
|
First test with this loop:
and compiled css give:
the final class isn't added to the first option. Syntax error or settings error ? it has worked well when I done it with gulp. |
When I take your input and compile it with Sass (without applying tailwind after that), I don't get any selector that nest
which first option are you talking about ? |
Hello, The result would be : |
Another example with:
which result is:
|
Feedback. my mixin file is compiled with no warning by webpack but...the compiled code miss the mixins as it create this:
and when I try to use a mixin in a scss file, I get this error:
|
Please provide a proper reproducer. My guess is that once again, you are trying to use CSS and not a Sass file (and so you only process things with postcss, not with Sass) |
Files are still in the same place: #1214 (comment)
Perhaps I need to add this one too: https://github.com/csstools/postcss-sass |
I don't see any |
I understand. |
Well, is that mixing actually defined ? I don't see any import of a Sass file that would define it. So to me, the Sass error is legitimate. My suggestion is that you should validate that the Sass compilation alone works (by running |
The sass file that define the mixin is: |
@webmasterpf in https://gitlab.com/themes-d9/starter-d9-2022/-/blob/00d7cd50f1bf858d3fcd14c954ebb0dbee144ff8/css/src/tailwind.scss#L8, the import of that mixin file is commented. |
Yes. I uncomment locally as it doesn't work yet. So uncomment in tailwind.scss and idem as #1214 (comment) |
Thank you for this issue. |
Hello,
I've this kind of loop for my sass files (scss) and webpack encore doesn't compile them.
the result is:
I'm using post-css, tailwind and plugins likethis: postcss config files
webpack config file:
What can I do more to get it compiled as the other scss code ?
Thanks
The text was updated successfully, but these errors were encountered: