Sass 3.1 brings even more power to your stylesheets

Sass 3.1 brings even more power to your stylesheets

It’s been almost a year since the last release of the closely tied open source products Haml and Sass — and for one of the two, the new 3.1 release brings significant changes.

Previously Haml and Sass were a part of the same package under Haml. The biggest update on the Haml side of things is that the two projects have now been split and are available in separate gems.

The most exciting update to Sass, at least to me, is the ability to create user-defined functions in Sass. Previously, this was achievable only through the Ruby API, and those less skilled with Ruby who knew just enough to get Sass working weren’t able to fully take advantage of it.

The update makes it possible to use keyword arguments instead of memorizing the order of arguments for each mixin or function. Additionally, some functions can now behave differently depending on the keywords they are passed. For example, a new function called adjust-color can take keywords for lightness, saturation and hue to determine its effect.

There are also new ways to manipulate lists built in, most importantly the @each directive which assigns variables to each item in a list in turn.

You can check out all the technical details and get started with Sass’s new toys over on the announcement post.

Read next: Test fallback font stacks with FFFFALLBACK

Shh. Here's some distraction

Comments