File tree Expand file tree Collapse file tree 1 file changed +27
-2
lines changed Expand file tree Collapse file tree 1 file changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -56,13 +56,38 @@ It's available on PyPI_, so you can install it using :program:`pip`:
56
56
57
57
.. _example :
58
58
59
- Example
60
- -------
59
+ Examples
60
+ --------
61
+
62
+ Compile a String of SASS to CSS
63
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61
64
62
65
>>> import sass
63
66
>>> sass.compile(string = ' a { b { color: blue; } }' )
64
67
'a b {\n color: blue; }\n'
65
68
69
+ Compile a Directory of SASS Files to CSS
70
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71
+
72
+ >>> import sass
73
+ >>> import os
74
+ >>> os.mkdir(' css' )
75
+ >>> os.mkdir(' sass' )
76
+ >>> scss = """ \
77
+ ... $ theme_color: # cc0000;
78
+ ... body {
79
+ ... background- color: $ theme_color;
80
+ ... }
81
+ ... """
82
+ >>> with open (' sass/example.scss' , ' w' ) as example_scss:
83
+ ... example_scss.write(scss)
84
+ ...
85
+ >>> sass.compile(dirname = (' sass' , ' css' ), output_style = ' compressed' )
86
+ >>> with open (' css/example.css' ) as example_css:
87
+ ... print (example_css.read())
88
+ ...
89
+ body{background-color:#c00}
90
+
66
91
67
92
User's Guide
68
93
------------
You can’t perform that action at this time.
0 commit comments