leafo / scssphp

SCSS compiler written in PHP
MIT License
1.34k stars 214 forks source link

Ignoring files in sub-directories #711

Closed mzubairharoon closed 4 years ago

mzubairharoon commented 4 years ago

Hi, scssphp works great, except when the files are in the sub-directories, I tried addImportPath but still couldn't include those sub-directory files, here is my scss code.

.my-parent-container { background-color: $body-background; @import './base/reset'; @import './abstracts/placeholders'; @import './base/typography'; @import './layout/header'; @import './components/buttons'; @import ./'components/switch_button'; }

PHP code

$scss = new \Leafo\ScssPhp\Compiler(); $scss_path = base_path('public/assets/tmpl-scss/style.scss'); $scss->setVariables($colors); $css = $scss->compile('@import "'.$scss_path.'"');

the files such as reset, placeholders, typography,header,buttons and switch_button are not added.

Thank you

robocoder commented 4 years ago

You're missing a semi-colon in your scss.

$css = $scss->compile('@import "'.$scss_path.'";');