Sass content order when import CSS
See original GitHub issue- Laravel Mix Version: 6.0.6
- Node Version: 15.5.0
- NPM Version: 6.14.0
- OS: MacOs 11.1
Description:
I’m coming from Gulp and I discover it’s possible to import CSS file directly in Sass with Laravel Mix (not possible with Sass by default). But The issue is that source order are not maintained.
Example:
@import "base";
@import "button";
@import "baguettebox.js/dist/baguetteBox.min.css";
The compiled CSS files import CSS files before Sass import. In this example bagettebox will be present before base and button. Is there a workaround to fix that?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8
Top Results From Across the Web
Sass: @import
CSS files imported by Sass don't allow any special Sass features. In order to make sure authors don't accidentally write Sass in their...
Read more >Sass content order when import CSS · Issue #2735 - GitHub
I'm coming from Gulp and I discover it's possible to import CSS file directly in Sass with Laravel Mix (not possible with Sass...
Read more >reactjs - React - importing css/sass in order - Stack Overflow
I'm trying to import my css/sass files in order. Somehow my css gets messed up as my bulma framework imports, overwrites all classes...
Read more >Sass @import and Partials - W3Schools
Sass Importing Files ... Just like CSS, Sass also supports the @import directive. The @import directive allows you to include the content of...
Read more >Sass: The @import Directive - Vanseo Design
Sass extends the CSS @import rule so that it works with .scss and .sass files. It imports the file referenced and any variables...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sass can’t include CSS so they import it at the beginning which is the problem here. They shouldn’t be moving the import.
Thank a lot @thecrypticace.
Thinking again, 1 - Sass can’t include CSS so they use CSS import at beginning of file. 2 - CSS loader include the CSS
So it’s a specificity of how webpack works. It doesn’t work same on Gulp for example: I copy and rename
*.css
file to*.sass
to a vendor folder and then I import it in my main Sass file.