leafo / scssphp

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

Can't import anything #172

Closed syropian closed 10 years ago

syropian commented 10 years ago

I'm using node-bourbon with Grunt, to compile my SCSS, but I'm also writing a little hack for Kirby CMS that lets the user choose an accent color for their theme, and it writes to the scss file and then scssphp compiles it.

I put:

$scss = new scssc();
$scss->addImportPath($_SERVER["DOCUMENT_ROOT"].'/node_modules/node-bourbon/assets/stylesheets/');

but I still get the error

"Fatal error: Uncaught exception 'Exception' with message 'parse error: failed at `@import "bourbon";` line: 1'"

Any idea what I'm doing wrong?

Edit: After some testing I can't actually get any imports to work. I added a file to my styles directory called _import.scss and changed the import path line to:

$scss->addImportPath($_SERVER["DOCUMENT_ROOT"].'/assets/styles/');

and I get the same error.

robocoder commented 10 years ago

Bourbon relies on sass 3.3 syntax. With the latest bourbon, when I @import "bourbon";, I get Parse error: parse error: failed at@return (stylesheets/bourbon/dist/helpers/_linear-angle-parser.scss on line 20

Where bourbon returns a list. Closing this issue as a duplicate of #146.

    @return (
      webkit-image: -webkit- + $prefix + ($offset - $num) + $suffix,
      spec-image: $image
    );