Closed chuckeymonkey closed 5 years ago
chdir()
to the stylesheet directory and/or use absolute import paths
Maybe it's a good idea to add an option to disable CSS @import
and throw an error when imports can't be resolved (that error would show the paths/files the compiler looked at). I've encounter issues with having the wrong import paths too and some sort of debugging option would help
An @import
that can't be resolved locally is still valid CSS, so no.
Hello, with the last version I have problems too. The @import
of compass libraries does not work properly.
I got this error message.
[2019-08-29 07:41:51] request.CRITICAL: Uncaught PHP Exception ScssPhp\ScssPhp\Exception\CompilerException: "Undefined mixin appearance: line: 1098, column: 3 Call Stack: #0 function em (unknown file) on line 1055 #1 function em (unknown file) on line 845 #2 function em (unknown file) on line 804 #3 function em (unknown file) on line 773 #4 function em /www/htdocs/w008ff72/contao4/files/layout/css/_mixins.scss on line 125 #5 function em (unknown file) on line 760 #6 function em /www/htdocs/w008ff72/contao4/files/layout/css/_mixins.scss on line 125 #7 function em (unknown file) on line 755 #8 function em /www/htdocs/w008ff72/contao4/files/layout/css/_mixins.scss on line 125 #9 function em (unknown file) on line 750 #10 function em /www/htdocs/w008ff72/contao4/files/layout/css/_mixins.scss on line 125 #11 function em (unknown file) on line 745 #12 function em (unknown file) on line 722 #13 function em /www/htdocs/w008ff72/contao4/files/layout/css/_mixins.scss on line 125 #14 function em (unknown file) on line 719 #15 function em (unknown file) on line 669 #16 function em (unknown file) on line 668 #17 function em (unknown file) on line 609 #18 function em (unknown file) on line 608 #19 function em (unknown file) on line 607 #20 function em /www/htdocs/w008ff72/contao4/files/layout/css/_mixins.scss on line 125 #21 function em (unknown file) on line 440 #22 function em /www/htdocs/w008ff72/contao4/files/layout/css/_mixins.scss on line 125 #23 function em (unknown file) on line 405" at /www/htdocs/w008ff72/contao4/vendor/scssphp/scssphp/src/Compiler.php line 4352 {"exception":"[object] (ScssPhp\\ScssPhp\\Exception\\CompilerException(code: 0): Undefined mixin appearance: line: 1098, column: 3\nCall Stack:\n#0 function em (unknown file) on line 1055\n#1 function em (unknown file) on line 845\n#2 function em (unknown file) on line 804\n#3 function em (unknown file) on line 773\n#4 function em /www/htdocs/w008ff72/contao4/files/layout/css/_mixins.scss on line 125\n#5 function em (unknown file) on line 760\n#6 function em /www/htdocs/w008ff72/contao4/files/layout/css/_mixins.scss on line 125\n#7 function em (unknown file) on line 755\n#8 function em /www/htdocs/w008ff72/contao4/files/layout/css/_mixins.scss on line 125\n#9 function em (unknown file) on line 750\n#10 function em /www/htdocs/w008ff72/contao4/files/layout/css/_mixins.scss on line 125\n#11 function em (unknown file) on line 745\n#12 function em (unknown file) on line 722\n#13 function em /www/htdocs/w008ff72/contao4/files/layout/css/_mixins.scss on line 125\n#14 function em (unknown file) on line 719\n#15 function em (unknown file) on line 669\n#16 function em (unknown file) on line 668\n#17 function em (unknown file) on line 609\n#18 function em (unknown file) on line 608\n#19 function em (unknown file) on line 607\n#20 function em /www/htdocs/w008ff72/contao4/files/layout/css/_mixins.scss on line 125\n#21 function em (unknown file) on line 440\n#22 function em /www/htdocs/w008ff72/contao4/files/layout/css/_mixins.scss on line 125\n#23 function em (unknown file) on line 405 at /www/htdocs/w008ff72/contao4/vendor/scssphp/scssphp/src/Compiler.php:4352)"} []
@jankout : compass isn't supported because it has a ruby library that extends ruby sass/scss.
I am new to scssphp and I cannot get @import to work for the life of me. I'm expecting to use it in the SASS way of including the contents of other scss files during compiling. Instead I get an @import the CSS way. I've scoured the documentation and cannot figure this out.
style.php
$css = $scss->compile( ' @import "./sass/theme/theme"; .base { color: #ddd; .sub { color: #fff; } } ' ); $filepath = get_stylesheet_directory() . '/src/style/css/style.min.css'; $file = fopen( $filepath, 'w' ); fputs ( $file, $css ); fclose ( $file );
theme.scss
.someclass { color: #000; }
Expecting in style.min.css:
.someclass{color: #000}.base{color:#ddd}.base .sub{color:#fff}
Actually getting in style.min.css
@import "./sass/theme/theme";.base{color:#ddd}.base .sub{color:#fff}
What am I missing?