Spring Clean (beta.1)
Pre-releaseThe core developer team kept the pace high over the last weeks and fixed a ton of open issues, while also refactoring an awfull lot of code, plus implementing new and missing features. We want to thank all the people that reported issues, patches or contributed in any other form, that made this release happen 👏
By the numbers
- 103 closed issues
- 67+ new sass specs
- 282+ new assertions
- 22% less skipped specs
- 8% increase in code coverage
Major new features
Output styles
The way Libsass outputs the final css was refactored to make the code more modular. This allowed us to add the missing compact and expanded output styles. This refactor also allows us to produce more accurate nested and compressed output styles (@mgreter, #910).
Strings and interpolation
String and interpolation parsing and evaluating was refactored too, which brings Libsass even closer to Ruby Sass in terms of output styles now (@mgreter, #847).
Sourcemaps
The refactoring work on strings, interpolations and output styles made it a lot easier to guarantee the correctness of the generated sourcemap files (@mgreter, #879)
Directive bubbling
@media
, @supports
, @keyframes
directives (and more!) are correctly bubbled so you always get CSS 2.0 compliant output.
This means @media
rules will be "combined" with all bubbled up @media
rules to better reflect the Ruby Sass behaviour (@xyfer, #800, #821).
@at-root
Full support for the @at-root
directive has been implemented (@xyfer, #799, #859).
New experimental feature
This release contains initial (and experimental) support to load 3rd party plugins in the form of precompiled .dll
(win) or .so
(nix) files. We really would like to see some people playing around with this new toy. It could help us determine what we actually want to do with this technology! (@mgreter, #919)
Breaking changes
- Change in
sass_make_data_context
- libsass now really takes memory ownership (#925) - Hard deprecated
image-url
andcompact
functions (throw errors until removed) (#834, #835)
Changes in C-API
- Implemented error status for importer entries (#926)
- Breaking change in
sass_make_data_context
(#925) - Added
char* indent
andchar* linefeed
to options (#787) - Added
string_list* plugin_paths
to options (#919) - Added
char* plugin_path
to options (#919) - Added
char* source_map_root
to options (#926) - Added
char* error_text
to options (#915) - Removed
char* image_path
from options (#834) - Added
sass_option_push_plugin_path
function (#919) - A few source files have been added and some removed
Improved spec tests
Due to the new support for all output styles, the spec tests have been enhanced to test all four output styles. The tests are now much more white-space sensitive than before, as only multiple line-feeds are normalized. This should ensure that libsass gets and stays closer to the exact output of ruby sass in the future. Beside we further improved the specs with new test:
- Added 10 color related function spec tests (@mgreter, #911)
- Added 185 generated tests for interpolation parsing (@mgreter)
Other fixes and features
- Implement raw css imports (@mgreter, #754, #318)
- Fix parsing of dash in declaration values (@xyfer, #733)
- Fully evaluate nested binary operations (@xyfer, #770)
- Made linefeed and indent configurable (@mgreter, #787)
- Improved source-mapping implementation (@mgreter, #792)
- Properly hydrate numbers after operations (@xyfer, #783)
- str-slice $end-at defaults to -1 if omitted (@xyfer, #815)
- Normalize CSS function string arguments (@xyfer, #817)
- Improved handling of negative numbers (@xyfer, #828)
- Update number function signatures (@xyfer, #826)
- Pass arguments by value not reference (@xyfer, #813, #909)
- Parse css comment in function definition (@xyfer, #646)
- Test complete buffer for utf8 characters (@mgreter, #820)
- Pass "keep comments" flag to sass2scss (@anlutro, #866)
- Fix desaturation of greyscale colours (@anlutro, #864)
- Fix crash in Parser::parse_term (@mmaxim, #846)
- Add support for -ms-calc (@xyfer, #842)
- Fix greedy not operator (@xyfer, #873, #897, #920, #934)
- Parse comments in propsets (@xyfer, #890)
- Consistently normalize function names (@xyfer, #877)
- Fix color related issues in functions (@mgreter, #911)
- Fix dash parsing after other tokens (@mgreter, #922)
- Implement number prefix parsing (/[+-]+/) (@mgreter, #535)
- Error on illegal parent selectors in root blocks (@mgreter, #325)
- Fix interpolation in media queries (@mgreter, #346)
- Parse line comments in blocks (@mgreter, #533)
- Error on illegal media blocks extending (@mgreter, #317, #712)
- Threadsafe
atof
implementation (@npiguet, #929) - Fix comments on in propsets causing segfaults (@xzyfer, #901)
Thanks!
A huge thanks to everyone who reported issues 🔆 !!
Honourable mentions to @am11, @anlutro, @chriseppstein, @hcatlin, @hugogiraudel, @lunelson, @mgreter, @mmaxim, @npiguet, @Snugug and @xzyfer for their contributions to Libsass and Sass spec that made this release possible.