Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to compile scss files (that uses compass mixins/features) into css in php using these two libraries?
    primarykey
    data
    text
    <p>I have a lot of scss files that are neatly organised into folders and linked to each other via @import and I need to compile them into css on the server side in php on the fly. One of the files [application.scss] links to all the files which then link to all the other scss files via lots of @import. So I just need to pass application.scss to these two libraries and they should do the rest.</p> <p>I have been using this <a href="https://github.com/leafo/scssphp" rel="nofollow">https://github.com/leafo/scssphp</a> PHPSCSS and it was working perfectly fine until I started coming across errors "undefined mixin X/Y/Z", but then I realised that scss files I am using have been written using compass which then led me into using this <a href="https://github.com/leafo/scssphp-compass" rel="nofollow">https://github.com/leafo/scssphp-compass</a> PHPSCSS-COMPASS with this piece of code/example working perfectly fine:</p> <pre><code>require "compass.inc.php"; require "scss.inc.php"; $scss = new scssc(); new scss_compass($scss); echo $scss-&gt;compile(' @import "compass"; .shadow { @include box-shadow(10px 10px 8px red); } '); </code></pre> <p>The problem is, its not practical nor feasible for me to pass all scss code as a string in the place of <code>.shadow {@include box-shadow( 10px 10px 8px red); }</code> I need to pass in application.scss file not scss code snippet. I tried doing this but it didnt work:</p> <pre><code>require "compass.inc.php"; require "scss.inc.php"; $scss = new scssc(); new scss_compass($scss); echo $scss-&gt;compile(' @import "compass"; "application.scss" '); </code></pre> <p>This did not work either:</p> <pre><code>$scss = new scssc(); new scss_compass($scss); $server = new scss_server("sass",null,$scss); $server-&gt;serve(); </code></pre> <p>Nor did this:</p> <pre><code>$scss = new scssc(); new scss_compass($scss); $scss-&gt;setImportPaths("sass/"); echo $scss-&gt;compile('@import "compass"'); echo $scss-&gt;compile('@import "application.scss"'); </code></pre> <p>Could anyone help ?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload