File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,23 @@ The default import path is `array("")`, which means the current directory.
6666 echo $scss->compile('@import "mixins.scss"');
6767 ```
6868
69+ Besides adding static import paths, it's also possible to add custom import
70+ functions. This allows you to load paths from a database, or HTTP, or using
71+ files that SCSS would otherwise not process (such as vanilla CSS imports).
72+
73+ ```php
74+ <?php
75+ require "scssphp/scss.inc.php";
76+ $scss = new scssc();
77+ $scss->addImportPath(function($path) {
78+ if (!file_exists('stylesheets/'.$path)) return null;
79+ return 'stylesheets/'.$path;
80+ });
81+
82+ // will import `stylesheets/vanilla.css'
83+ echo $scss->compile('@import "vanilla.css"');
84+ ```
85+
6986### Output Formatting
7087
7188It's possible to customize the formatting of the output CSS by changing the
You can’t perform that action at this time.
0 commit comments