This guide explains how to use libsass with the Flask
<http://flask.pocoo.org/> web framework. sassutils
<#module-sassutils> package provides several tools that can be
integrated into web applications written in Flask.
- Directory layout
- Defining manifest
- Building Sass/SCSS for each request
- Building Sass/SCSS for each deployment
Imagine the project contained in such directory layout:
Sass/SCSS files will go inside myapp/static/sass/
directory. Compiled CSS files will go inside myapp/static/css/
directory. CSS files can be regenerated, so add myapp/static/css/
into your ignore list like .gitignore or .hgignore.
The sassutils <#module-sassutils> defines a concept
named manifest. Manifest is the build settings of Sass/SCSS. It
specifies some paths related to building Sass/SCSS:
- The path of the directory which contains Sass/SCSS source files.
- The path of the directory which the compiled CSS files will go.
- The path, exposed to HTTP (through WSGI), of the directory that will
contain the compiled CSS files.
Every package may have its own manifest. Paths have to be relative
to the path of the package.
For example, in the above project, the package name is
myapp. The path of the package is myapp/. The path of the
Sass/SCSS directory is static/sass/ (relative to the package
directory). The path of the CSS directory is static/css/. The exposed
path is /static/css.
These settings can be represented as the following manifests:
{
'myapp': ('static/sass', 'static/css', '/static/css')
}
As you can see the above, the set of manifests are represented in
dictionary, in which the keys are packages names and the values are tuples
of paths.
See also:
In development, manually building Sass/SCSS files for each change
is a tedious task. SassMiddleware
<#sassutils.wsgi.SassMiddleware> makes the web application build
Sass/SCSS files for each request automatically. It's a WSGI middleware, so
it can be plugged into the web app written in Flask.
SassMiddleware <#sassutils.wsgi.SassMiddleware> takes
two required parameters:
- The WSGI-compliant callable object.
- The set of manifests represented as a dictionary.
So:
from flask import Flask
from sassutils.wsgi import SassMiddleware
app = Flask(__name__)
app.wsgi_app = SassMiddleware(app.wsgi_app, {
'myapp': ('static/sass', 'static/css', '/static/css')
})
And then, if you want to link a compiled CSS file, use the
url_for()
</usr/share/doc/python-flask-doc/html/api.html#flask.url_for>
function:
<link href="{{ url_for('static', filename='css/style.scss.css') }}"
rel="stylesheet" type="text/css">
Note:
The linked filename is style.scss.css, not just
style.scss. All compiled filenames have trailing .css
suffix.
Note:
This section assumes that you use setuptools
<https://pypi.org/pypi/setuptools/> for deployment.
See also:
If libsass is installed in the site-packages (for example,
your virtualenv), the setup.py script also gets a new command
provided by libsass: build_sass
<#sassutils.distutils.build_sass>. The command is aware of the
sass_manifests option of setup.py and builds all Sass/SCSS
sources according to the manifests.
Add these arguments to setup.py script:
setup(
# ...,
setup_requires=['libsass >= 0.6.0'],
sass_manifests={
'myapp': ('static/sass', 'static/css', '/static/css')
}
)
The setup_requires option makes sure that libsass is
installed in site-packages (for example, your virtualenv) before the
setup.py script. That means if you run the setup.py script and
libsass isn't installed in advance, it will automatically install libsass
first.
The sass_manifests specifies the manifests for libsass.
Now setup.py build_sass will compile all Sass/SCSS files in
the specified path and generates compiled CSS files inside the specified
path (according to the manifests).
If you use it with sdist or bdist commands, the
packed archive will also contain the compiled CSS files!
$ python setup.py build_sass sdist
You can add aliases to make these commands always run the
build_sass command first. Make setup.cfg config:
[aliases]
sdist = build_sass sdist
bdist = build_sass bdist
Now it automatically builds Sass/SCSS sources and include the
compiled CSS files to the package archive when you run setup.py
sdist.
Released on January 6, 2024.
- Follow up the libsass upstream: 3.6.6 --- See the release notes of LibSass
3.6.6 <https://github.com/sass/libsass/releases/tag/3.6.6>. [452
<https://github.com/sass/libsass-python/issues/452> by Anthony
Sottile]
Released on November 12, 2022.
- Remove python 2.x support [373
<https://github.com/sass/libsass-python/issues/373> by anthony
sottile].
- Remove deprecated sassc cli [379
<https://github.com/sass/libsass-python/issues/379> by anthony
sottile].
Released on May 20, 2021.
- Fix build on OpenBSD. [310
<https://github.com/sass/libsass-python/issues/310> by Denis
Fondras].
- Produce abi3 wheels on windows. [322
<https://github.com/sass/libsass-python/issues/322> by Anthony
Sottile]
- Make the manpage build reproducible. [319
<https://github.com/sass/libsass-python/issues/319> by Chris
Lamb]
- Follow up the libsass upstream: 3.6.5 --- See the release notes of LibSass
3.6.5 <https://github.com/sass/libsass/releases/tag/3.6.5>. [344
<https://github.com/sass/libsass-python/issues/344> by Anthony
Sottile]
Released on August 27, 2020.
- (no changes, re-releasing to test build automation)
Released on May 1, 2020.
- Produce abi3 wheels on macos / linux [307
<https://github.com/sass/libsass-python/issues/307> by Anthony
Sottile]
- Follow up the libsass upstream: 3.6.4 --- See the release notes of LibSass
3.6.4 <https://github.com/sass/libsass/releases/tag/3.6.4>. [313
<https://github.com/sass/libsass-python/issues/313> by Anthony
Sottile]
Released on November 3, 2019.
- Follow up the libsass upstream: 3.6.3 --- See the release notes of LibSass
3.6.3 <https://github.com/sass/libsass/releases/tag/3.6.3>. [304
<https://github.com/sass/libsass-python/issues/304> by Anthony
Sottile]
Released on October 5, 2019.
- Follow up the libsass upstream: 3.6.2 --- See the release notes of LibSass
3.6.2 <https://github.com/sass/libsass/releases/tag/3.6.2>. [302
<https://github.com/sass/libsass-python/issues/302> by Anthony
Sottile]
Released on June 16, 2019.
- Follow up the libsass upstream: 3.6.1 --- See the release notes of LibSass
3.6.1 <https://github.com/sass/libsass/releases/tag/3.6.1>. [298
<https://github.com/sass/libsass-python/issues/298> by Anthony
Sottile]
Released on May 18, 2019.
- Re-release of 0.19.0 with windows python2.7 wheels [297
<https://github.com/sass/libsass-python/issues/297> by Anthony
Sottile]
Released on May 18, 2019.
- Follow up the libsass upstream: 3.6.0 --- See the release notes of LibSass
3.6.0 <https://github.com/sass/libsass/releases/tag/3.6.0>. [295
<https://github.com/sass/libsass-python/issues/295> by Anthony
Sottile]
Release on March 13, 2019
- Add support for previous import path to importer callbacks [287
<https://github.com/sass/libsass-python/issues/287> 291
<https://github.com/sass/libsass-python/issues/291> by Frankie
Dintino]
Release on January 03, 2019
- Fix .sass in WsgiMiddleware (again) [280
<https://github.com/sass/libsass-python/issues/280> by Anthony
Sottile]
Released on November 25, 2018.
- Fix compilation on macos mojave [276
<https://github.com/sass/libsass-python/issues/276> 277
<https://github.com/sass/libsass-python/issues/277> by Anthony
Sottile]
- Fix .sass in WsgiMiddleware for strip_extension=True
[278 <https://github.com/sass/libsass-python/issues/278> by Anthony
Sottile]
Released on November 13, 2018.
- Use -lc++ link flag when compiling with clang [270
<https://github.com/sass/libsass-python/issues/270> by Christian
Thieme 271 <https://github.com/sass/libsass-python/issues/271> by
Anthony Sottile]
- Honor strip_extension in SassMiddleware [274
<https://github.com/sass/libsass-python/issues/274> by Anthony
Sottile]
- Follow up the libsass upstream: 3.5.5 --- See the release notes of LibSass
3.5.5 <https://github.com/sass/libsass/releases/tag/3.5.5>. [275
<https://github.com/sass/libsass-python/issues/275> by Anthony
Sottile]
Released on September 24, 2018.
- Fix setup.py sdist (regressed in 0.15.0) [267
<https://github.com/sass/libsass-python/issues/267> by Anthony
Sottile]
Released on September 16, 2018.
- Fix invalid escape sequences [249
<https://github.com/sass/libsass-python/issues/249> by Anthony
Sottile]
- Add code of conduct [251
<https://github.com/sass/libsass-python/issues/251> by Nick
Schonning]
- Add support for python3.7 and remove testing for python3.4 [254
<https://github.com/sass/libsass-python/issues/254> by Anthony
Sottile]
- Add strip_extension option for wsgi / distutils builder [55
<https://github.com/sass/libsass-python/issues/55> 258
<https://github.com/sass/libsass-python/issues/258> by Anthony
Sottile 260 <https://github.com/sass/libsass-python/issues/260> by
Morten Brekkevold]
- Deprecate sassc (replaced by pysassc). [262
<https://github.com/sass/libsass-python/issues/262> by Anthony
Sottile]
- Import abc classes from collections.abc to remove
DeprecationWarning [264
<https://github.com/sass/libsass-python/issues/264> by Gary van der
Merwe 265 <https://github.com/sass/libsass-python/issues/265> by
Anthony Sottile]
Released on April 25, 2018.
- Follow up the libsass upstream: 3.5.4 --- See the release notes of LibSass
3.5.4 <https://github.com/sass/libsass/releases/tag/3.5.4>. [247
<https://github.com/sass/libsass-python/issues/247> by Anthony
Sottile]
Released on April 24, 2018.
- Add ability to specify imports for custom extensions. This provides a way
to enable imports of .css files (which was removed in 3.5.3).
Specify --import-extensions .css to restore the previous behavior.
[246 <https://github.com/sass/libsass-python/issues/246> by Samuel
Colvin]
Released on April 23, 2018.
- Follow up the libsass upstream: 3.5.3 --- See the release notes of LibSass
3.5.3 <https://github.com/sass/libsass/releases/tag/3.5.3>. [244
<https://github.com/sass/libsass-python/issues/244> by Anthony
Sottile]
Released on March 16, 2018.
- Follow up the libsass upstream: 3.5.2 --- See the release notes of LibSass
3.5.2 <https://github.com/sass/libsass/releases/tag/3.5.2>. [243
<https://github.com/sass/libsass-python/issues/243> by Anthony
Sottile]
Released on March 12, 2018.
- Follow up the libsass upstream: 3.5.1 --- See the release notes of LibSass
3.5.1 <https://github.com/sass/libsass/releases/tag/3.5.1>. [242
<https://github.com/sass/libsass-python/issues/242> by Anthony
Sottile]
Released on March 6, 2018.
- Follow up the libsass upstream: 3.5.0 --- See the release notes of LibSass
3.5.0 <https://github.com/sass/libsass/releases/tag/3.5.0>. [241
<https://github.com/sass/libsass-python/issues/241> by Anthony
Sottile]
- SassList type gained an additional option bracketed=False to
match the upstream changes to the sass_list type. [184
<https://github.com/sass/libsass-python/issues/184> by Anthony
Sottile]
Released on February 5, 2018.
- Follow up the libsass upstream: 3.4.9 --- See the release notes of LibSass
3.4.9 <https://github.com/sass/libsass/releases/tag/3.4.9>. [232
<https://github.com/sass/libsass-python/issues/232> by Anthony
Sottile]
Released on January 19, 2018.
- libsass-python has moved to the sass organization!
Released on January 11, 2018.
- Follow up the libsass upstream: 3.4.8 --- See the release notes of LibSass
3.4.8 <https://github.com/sass/libsass/releases/tag/3.4.8>. [228
<https://github.com/sass/libsass-python/issues/228> by Anthony
Sottile]
Released on November 14, 2017.
- Follow up the libsass upstream: 3.4.7 --- See the release notes of LibSass
3.4.7 <https://github.com/sass/libsass/releases/tag/3.4.7>. [226
<https://github.com/sass/libsass-python/issues/226> by Anthony
Sottile]
Released on October 11, 2017.
- Sort input files for determinism [212
<https://github.com/sass/libsass-python/issues/212> by Bernhard M.
Wiedemann]
- Include LICENSE file in distributions [216
<https://github.com/sass/libsass-python/issues/216> by Dougal J.
Sutherland]
- Add a pysassc entry to replace sassc [218
<https://github.com/sass/libsass-python/issues/218> by Anthony
Sottile]
- Enable building with dynamic linking [219
<https://github.com/sass/libsass-python/issues/219> by Marcel
Plch]
- Follow up the libsass upstream: 3.4.6 --- See the release notes of LibSass
3.4.6 <https://github.com/sass/libsass/releases/tag/3.4.6>. [221
<https://github.com/sass/libsass-python/issues/221> by Anthony
Sottile]
Released on June 14, 2017.
- Always add cwd to import paths [208
<https://github.com/sass/libsass-python/issues/208> by Anthony
Sottile]
Released on June 8, 2017.
- Follow up the libsass upstream: 3.4.5 --- See the release notes of LibSass
3.4.5 <https://github.com/sass/libsass/releases/tag/3.4.5>. [207
<https://github.com/sass/libsass-python/issues/207> by Anthony
Sottile]
Released on June 7, 2017.
- Use getfullargspec when available in python 3. [188
<https://github.com/sass/libsass-python/issues/188> by Thom
Wiggers]
- Use sass_copy_c_string instead of strdup for portability
[196 <https://github.com/sass/libsass-python/issues/196> by Anthony
Sottile]
- Use -std=gnu++0x to fix installation under cygwin [195
<https://github.com/sass/libsass-python/issues/195> 197
<https://github.com/sass/libsass-python/issues/197> by Anthony
Sottile]
- Correct source map url [201
<https://github.com/sass/libsass-python/issues/201> 202
<https://github.com/sass/libsass-python/issues/202> by Anthony
Sottile]
- Remove --watch [203
<https://github.com/sass/libsass-python/issues/203> by Anthony
Sottile]
- Follow up the libsass upstream: 3.4.4 --- See the release notes of LibSass
3.4.4 <https://github.com/sass/libsass/releases/tag/3.4.4>. [205
<https://github.com/sass/libsass-python/issues/205> by Anthony
Sottile]
Released on January 7, 2017.
- Follow up the libsass upstream: 3.4.3 --- See the release notes of LibSass
3.4.3 <https://github.com/sass/libsass/releases/tag/3.4.3>. [178
<https://github.com/sass/libsass-python/issues/178> by Anthony
Sottile]
Released on January 5, 2017.
- Follow up the libsass upstream: 3.4.2 --- See the release notes of LibSass
3.4.2 <https://github.com/sass/libsass/releases/tag/3.4.2>. [176
<https://github.com/sass/libsass-python/issues/176> by Anthony
Sottile]
Released on December 20, 2016.
- Follow up the libsass upstream: 3.4.1 --- See the release notes of LibSass
3.4.1 <https://github.com/sass/libsass/releases/tag/3.4.1>. [175
<https://github.com/sass/libsass-python/issues/175> by Anthony
Sottile]
Released on December 10, 2016.
- Follow up the libsass upstream: 3.4.0 --- See the release notes of LibSass
3.4.0 <https://github.com/sass/libsass/releases/tag/3.4.0>. [173
<https://github.com/sass/libsass-python/issues/173> by Anthony
Sottile]
Released on October 24, 2016.
- Drop support for python2.6 [158
<https://github.com/sass/libsass-python/issues/158> by Anthony
Sottile]
- Deprecate --watch [156
<https://github.com/sass/libsass-python/issues/156> by Anthony
Sottile]
- Preserve line endings [160
<https://github.com/sass/libsass-python/issues/160> by Anthony
Sottile]
- Follow up the libsass upstream: 3.3.6 --- See the release notes of LibSass
3.3.6 <https://github.com/sass/libsass/releases/tag/3.3.6>. [167
<https://github.com/sass/libsass-python/issues/167> by Anthony
Sottile]
Released on April 22, 2016.
- Follow up the libsass upstream: 3.3.5 --- See the release notes of LibSass
3.3.5 <https://github.com/sass/libsass/releases/tag/3.3.5>. [148
<https://github.com/sass/libsass-python/issues/148> by Anthony
Sottile]
Released on March 23, 2016.
- Follow up the libsass upstream: 3.3.4 --- See the release notes of LibSass
3.3.4 <https://github.com/sass/libsass/releases/tag/3.3.4>. [144
<https://github.com/sass/libsass-python/issues/144> by Anthony
Sottile]
- Expose libsass version in sassc --version and
sass.libsass_version [142
<https://github.com/sass/libsass-python/issues/142> 141
<https://github.com/sass/libsass-python/issues/141> 140
<https://github.com/sass/libsass-python/issues/140> by Anthony
Sottile]
- Fix warning about unused enum on switch [127
<https://github.com/sass/libsass-python/issues/127> 131
<https://github.com/sass/libsass-python/issues/131> by Anthony
Sottile]
- Sourcemaps no longer imply source comments [124
<https://github.com/sass/libsass-python/issues/124> 130
<https://github.com/sass/libsass-python/issues/130> by Tim
Tisdall]
- Add --source-comments option to sassc [124
<https://github.com/sass/libsass-python/issues/124> 130
<https://github.com/sass/libsass-python/issues/130> by Anthony
Sottile]
- Improve formatting of CompileError under python3 [123
<https://github.com/sass/libsass-python/issues/123> by Anthony
Sottile]
- Raise when compiling a directory which does not exist [116
<https://github.com/sass/libsass-python/issues/116> 119
<https://github.com/sass/libsass-python/issues/119> by Anthony
Sottile]
Released on January 29, 2016.
- Follow up the libsass upstream: 3.3.3 --- See the release notes of LibSass
3.3.3 <https://github.com/sass/libsass/releases/tag/3.3.3>. [by
Anthony Sottile]
- Allow -t for style like sassc [98
<https://github.com/sass/libsass-python/issues/98> by Anthony
Sottile]
Released on December 15, 2015.
- Support custom import callbacks [81
<https://github.com/sass/libsass-python/issues/81> by Alice
Zoë Bevan–McGregor, Anthony Sottile]
- Disallow arbitrary kwargs in compile() [109
<https://github.com/sass/libsass-python/issues/109> by Anthony
Sottile]
Released on December 03, 2015.
- Support "indented" Sass compilation [41
<https://github.com/sass/libsass-python/issues/41> by Alice
Zoë Bevan–McGregor]
- Fix wheels on windows [28
<https://github.com/sass/libsass-python/issues/28> 49
<https://github.com/sass/libsass-python/issues/49> by Anthony
Sottile]
Released on November 12, 2015.
- Follow up the libsass upstream: 3.3.2 --- See the release notes of LibSass
3.3.2 <https://github.com/sass/libsass/releases/tag/3.3.2>. [by
Anthony Sottile]
- Require VS 2015 to build on windows [99
<https://github.com/sass/libsass-python/issues/99> by Anthony
Sottile]
Released on October 29, 2015.
- Follow up the libsass upstream: 3.3.1 --- See the release notes of LibSass
3.3.1 <https://github.com/sass/libsass/releases/tag/3.3.1>. [by
Anthony Sottile]
Released on October 28, 2015.
- Fix a bug with writing UTF-8 to a file [72
<https://github.com/sass/libsass-python/issues/72> by Caleb
Ely]
- Fix a segmentation fault on ^C [87
<https://github.com/sass/libsass-python/issues/87> by Anthony
Sottile]
- Follow up the libsass upstream: 3.3.0 --- See the release notes of LibSass
3.3.0 <https://github.com/sass/libsass/releases/tag/3.3.0>. [96
<https://github.com/sass/libsass-python/issues/96> by Anthony
Sottile]
Released on August 2, 2015.
- Follow up the libsass upstream: 3.2.5 --- See the release notes of LibSass
3.2.5 <https://github.com/sass/libsass/releases/tag/3.2.5>. [79
<https://github.com/sass/libsass-python/issues/79>, 80
<https://github.com/sass/libsass-python/issues/80> by Anthony
Sottile]
- Fixed a bug that *.sass files were ignored. [78
<https://github.com/sass/libsass-python/issues/78> by Guilhem
MAS-PAITRAULT]
Released on May 19, 2015.
- Follow up the libsass upstream: 3.2.4 --- See the release notes of LibSass
3.2.3 <https://github.com/sass/libsass/releases/tag/3.2.3>, and
3.2.4 <https://github.com/sass/libsass/releases/tag/3.2.4>. [69
<https://github.com/sass/libsass-python/issues/69> by Anthony
Sottile]
- The default value of SassMiddleware
<#sassutils.wsgi.SassMiddleware>'s error_status parameter was
changed from '500 Internal Server Error' to '200 OK' so that
Mozilla Firefox can render the error message well. [67
<https://github.com/sass/libsass-python/issues/67>, 68
<https://github.com/sass/libsass-python/issues/68>, 70
<https://github.com/sass/libsass-python/issues/70> by zxv]
Released on May 14, 2015.
- Fixed a bug that there was no 'expanded' in
sass.OUTPUT_STYLES <#sass.OUTPUT_STYLES> but
'expected' instead which is a typo. [66
<https://github.com/sass/libsass-python/issues/66> by
Triangle717]
- Fixed broken FreeBSD build. [65
<https://github.com/sass/libsass-python/issues/65> by Toshiharu
Moriyama]
Released on May 3, 2015.
- Follow up the libsass upstream: 3.2.2 --- See the release notes of LibSass
3.2.0 <https://github.com/sass/libsass/releases/tag/3.2.0>, 3.2.1
<https://github.com/sass/libsass/releases/tag/3.2.1>, and 3.2.2
<https://github.com/sass/libsass/releases/tag/3.2.2>. [61
<https://github.com/sass/libsass-python/issues/61>, 52
<https://github.com/sass/libsass-python/issues/52>, 56
<https://github.com/sass/libsass-python/issues/56>, 58
<https://github.com/sass/libsass-python/issues/58>, 62
<https://github.com/sass/libsass-python/issues/62>, 64
<https://github.com/sass/libsass-python/issues/64> by Anthony
Sottile]
- Compact and expanded output styles [37
<https://github.com/sass/libsass-python/issues/37>]
- Strings and interpolation closer to Ruby Sass
- The correctness of the generated sourcemap files
- Directive buddling
- Full support for the @at-root directive
- Full support for !global variable scoping
- Now underscored files are ignored when compiling a directory. [57
<https://github.com/sass/libsass-python/issues/57> by Anthony
Sottile]
- Fixed broken FreeBSD build. [34
<https://github.com/sass/libsass-python/issues/34>, 60
<https://github.com/sass/libsass-python/issues/60> by Ilya
Baryshev]
- SassMiddleware <#sassutils.wsgi.SassMiddleware> became to log
syntax errors if exist during compilation to
sassutils.wsgi.SassMiddleware logger with level ERROR. [42
<https://github.com/sass/libsass-python/issues/42>]
Released on March 6, 2015.
Anthony Sottile contributed to the most of this release. Huge
thanks to him!
- Follow up the libsass upstream: 3.1.0 --- See the release note
<https://github.com/sass/libsass/releases/tag/3.1.0> of LibSass. [38
<https://github.com/sass/libsass-python/issues/38>, 43
<https://github.com/sass/libsass-python/issues/43> by Anthony
Sottile]
- Custom functions and imports
- Decrementing in @for loops
- @debug and @error
- not operator
- nth() for maps
- inspect()
- feature-exists()
- unique-id()
- random()
- Added custom functions support. [13
<https://github.com/sass/libsass-python/issues/13>, 44
<https://github.com/sass/libsass-python/issues/44> by Anthony
Sottile]
- Added sass.SassFunction <#sass.SassFunction> class.
- Added custom_functions parameter to sass.compile()
<#sass.compile> function.
- Added data types for custom functions:
- sass.SassNumber <#sass.SassNumber>
- sass.SassColor <#sass.SassColor>
- sass.SassList <#sass.SassList>
- sass.SassMap <#sass.SassMap>
- sass.SassError <#sass.SassError>
- sass.SassWarning <#sass.SassWarning>
- Added precision parameter to sass.compile()
<#sass.compile> function. [39
<https://github.com/sass/libsass-python/issues/39> by Andrea
Stagi]
- sassc has a new -p/--precision option. [39
<https://github.com/sass/libsass-python/issues/39> by Andrea
Stagi]
Released on November 25, 2014.
Although 0.6.0--0.6.1 have needed GCC (G++) 4.8+, LLVM Clang 3.3+,
now it became back to only need GCC (G++) 4.6+, LLVM Clang 2.9+, or Visual
Studio 2013 Update 4+.
- Follow up the libsass upstream: 3.0.2 --- See the release note
<https://github.com/sass/libsass/releases/tag/3.0.2> of libsass. [33
<https://github.com/sass/libsass-python/issues/33> by Rodolphe
Pelloux-Prayer]
- Fixed a bug that sassc --watch crashed when a file is not
compilable on the first try. [32
<https://github.com/sass/libsass-python/issues/32> by Alan Justino
da Silva]
- Fixed broken build on Windows.
Released on November 6, 2014.
- Follow up the libsass upstream: 3.0.1 --- See the release note
<https://github.com/sass/libsass/releases/tag/3.0.1> of
LibSass.
- Fixed a bug that SassMiddleware
<#sassutils.wsgi.SassMiddleware> never closes the socket on some
WSGI servers e.g. eventlet.wsgi.
Released on October 27, 2014.
Note that since libsass-python 0.6.0 (and libsass 3.0) it requires
C++11 to compile. Although 0.6.2 became back to only need GCC (G++) 4.6+,
LLVM Clang 2.9+, from 0.6.0 to 0.6.1 you need GCC (G++) 4.8+, LLVM Clang
3.3+, or Visual Studio 2013 Update 4+.
- Follow up the libsass upstream: 3.0 --- See the release note
<https://github.com/sass/libsass/releases/tag/3.0> of LibSass.
- Decent extends support
- Basic Sass Maps Support
- Better UTF-8 Support
- call() function
- Better Windows Support
- Spec Enhancements
- Added missing partial import
<https://sass-lang.com/documentation/file.SASS_REFERENCE.html#partials>
support. [27 <https://github.com/sass/libsass-python/issues/27> by
item4]
- SOURCE_COMMENTS <#sass.SOURCE_COMMENTS> became
deprecated.
- sass.compile() <#sass.compile>'s parameter
source_comments now can take only bool instead of
str. String values like 'none', 'line_numbers', and
'map' become deprecated, and will be obsolete soon.
- build_directory() <#sassutils.builder.build_directory>
function has a new optional parameter output_style.
- build() method has a new optional parameter
output_style.
- Added --output-style/-s option to build_sass
<#sassutils.distutils.build_sass> command. [25
<https://github.com/sass/libsass-python/issues/25>]
Released on September 23, 2014.
- Fixed a bug that SassMiddleware
<#sassutils.wsgi.SassMiddleware> yielded str
</usr/share/doc/python3-doc/html/library/stdtypes.html#str> instead
of bytes
</usr/share/doc/python3-doc/html/library/stdtypes.html#bytes> on
Python 3.
- Fixed several Unicode-related bugs on Windows.
- Fixed a bug that build_directory()
<#sassutils.builder.build_directory>, SassMiddleware
<#sassutils.wsgi.SassMiddleware>, and build_sass
<#sassutils.distutils.build_sass> don't recursively build
subdirectories.
Released on June 6, 2014.
- Follow up the libsass upstream: 2.0 --- See the release note
<https://github.com/sass/libsass/releases/tag/v2.0> of LibSass.
- Added indented syntax support (*.sass files).
- Added expanded selector support (BEM).
- Added string functions.
- Fixed UTF-8 support.
- Backward incompatibility: broken extends.
Released on May 29, 2014.
- Version scheme changed to use periods (.) instead of hyphens
(-) due to setuptools seems to treat hyphens special.
- Fixed malformed packaging that doesn't correctly preserve the package name
and version.
Released on May 28, 2014.
- Follow up the libsass upstream: cd3ee1cbe34d5316eb762a43127a3de9575454ee
<https://github.com/sass/libsass/commit/cd3ee1cbe34d5316eb762a43127a3de9575454ee>.
Released on May 22, 2014.
- Fixed build failing on Mac OS X 10.8 or earlier. [19
<https://github.com/sass/libsass-python/issues/19>]
- Fixed UnicodeEncodeError
</usr/share/doc/python3-doc/html/library/exceptions.html#UnicodeEncodeError>
that Manifest.build_one()
<#sassutils.builder.Manifest.build_one> method rises when the input
source contains any non-ASCII Unicode characters.
Released on May 20, 2014.
- Fixed UnicodeEncodeError
</usr/share/doc/python3-doc/html/library/exceptions.html#UnicodeEncodeError>
that rise when the input source contains any non-ASCII Unicode
characters.
Released on May 6, 2014.
- sassc has a new -w/--watch option.
- Expose source maps support:
- sassc has a new -m/-g/--sourcemap option.
- SassMiddleware <#sassutils.wsgi.SassMiddleware> now also
creates source map files with filenames followed by .map
suffix.
- Manifest.build_one() <#sassutils.builder.Manifest.build_one>
method has a new source_map option. This option builds also a
source map file with the filename followed by .map suffix.
- sass.compile() <#sass.compile> has a new optional parameter
source_comments. It can be one of sass.SOURCE_COMMENTS
<#sass.SOURCE_COMMENTS> keys. It also has a new parameter
source_map_filename which is required only when
source_comments='map'.
- Fixed Python 3 incompatibility of sassc program.
- Fixed a bug that multiple include_paths doesn't work on
Windows.
Released on February 21, 2014.
- Added support for Python 3.3. [7
<https://github.com/sass/libsass-python/issues/7>]
- Dropped support for Python 2.5.
- Fixed build failing on Mac OS X. [4
<https://github.com/sass/libsass-python/issues/4>, 5
<https://github.com/sass/libsass-python/issues/5>, 6
<https://github.com/sass/libsass-python/issues/6> by Hyungoo
Kang]
- Now the builder creates target subdirectories recursively even if they
don't exist yet, rather than silently failing. [8
<https://github.com/sass/libsass-python/issues/8>, 9
<https://github.com/sass/libsass-python/issues/9> by Philipp
Volguine]
- Merged recent changes from libsass 1.0.1: 57a2f62--v1.0.1
<https://github.com/sass/libsass/compare/57a2f627b4d2fbd3cf1913b241f1d5aa31e35580...v1.0.1>.
- Supports variable arguments
<https://sass-lang.com/docs/yardoc/file.SASS_CHANGELOG.html#variable_arguments>.
- Supports sourcemaps.
Released on December 4, 2012.
- Added sassc CLI executable script.
- Added sass.OUTPUT_STYLES <#sass.OUTPUT_STYLES> constant
map.
- Merged recent changes from libsass upstream: e997102--a84b181
<https://github.com/sass/libsass/compare/e9971023785dabd41aa44f431f603f62b15e6017...a84b181a6e59463c0ac9796ca7fdaf4864f0ad84>.
Released on October 24, 2012.
- sassutils.distutils <#module-sassutils.distutils>: Prevent
double monkey patch of sdist.
- Merged upstream changes of libsass.
Released on September 28, 2012.
- Fixed a link error on PyPy and Linux.
- Fixed build errors on Windows.
Released on September 12, 2012.
Released on August 24, 2012.
- Added new sassutils <#module-sassutils> package.
- Added sassutils.builder <#module-sassutils.builder> module to
build the whole directory at a time.
- Added sassutils.distutils <#module-sassutils.distutils>
module for distutils
</usr/share/doc/python3-doc/html/library/distutils.html#module-distutils>
and setuptools integration.
- Added sassutils.wsgi <#module-sassutils.wsgi> module which
provides a development-purpose WSGI middleware.
- Added build_sass <#sassutils.distutils.build_sass> command
for distutils
</usr/share/doc/python3-doc/html/library/distutils.html#module-distutils>/setuptools.
Released on August 18, 2012.
- Fixed segmentation fault for reading filename which does not exist.
Now it raises a proper exceptions.IOError exception.
Released on August 17, 2012. Initial version.