The @import rule in SASS can be used in two ways:
- As a css import rule resolving in
@import: url(url) when compiled.
- As a rule which actually imports/includes another sass or css file inside the currently compiled on.This particularly useful when your assets are managed by bower and you want to compile and minify everything into a single css file.
Here is a link explaining what I'm talking about. Some important links from there:
- The logic behind how the
@import rule works.
- The PR when this was implemented.
In the current version of scssphp the @import rule will result in the following compiled css:
@import '../other/subdir/import_me'
instead of actually importing the content of the import_me file.
After digging through the source code of scssphp I found out the solution is quite simple. One should only append $url.'.css' to the Compiler.php#L3218. Afterwards everything should work as expected in both scenarios when using @import.
The
@importrule in SASS can be used in two ways:@import: url(url)when compiled.Here is a link explaining what I'm talking about. Some important links from there:
@importrule works.In the current version of
scssphpthe@importrule will result in the following compiled css:instead of actually importing the content of the
import_mefile.After digging through the source code of
scssphpI found out the solution is quite simple. One should only append$url.'.css'to the Compiler.php#L3218. Afterwards everything should work as expected in both scenarios when using@import.