We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 90e9017 commit b144555Copy full SHA for b144555
docs/index.md
@@ -83,6 +83,23 @@ $scss->addImportPath(function($path) {
83
echo $scss->compile('{% raw %}@{% endraw %}import "vanilla.css";');
84
{% endhighlight %}
85
86
+### Preset Variables
87
+
88
+You can set variables before compilation by using the `setVariables($vars)`
89
+method. To override a variable already defined in your scss source, use
90
+the `!default` flag.
91
92
+{% highlight php startinline=true %}
93
+use Leafo\ScssPhp\Compiler;
94
+-
95
+$scss = new Compiler();
96
+$scss->setVariables(array(
97
+ 'var' => 'false',
98
+));
99
100
+echo $scss->compile('$var: true !default;');
101
+{% endhighlight %}
102
103
### Output Formatting
104
105
It's possible to customize the formatting of the output CSS by changing the
0 commit comments