Rub shoulders with leading experts and industry disruptors at TNW Conference →

The heart of tech

This article was published on April 26, 2011


    Sass 3.1 brings even more power to your stylesheets

    Sass 3.1 brings even more power to your stylesheets
    Joel Falconer
    Story by

    Joel Falconer

    Joel Falconer is the Features Editor at TNW. He lives on the Gold Coast, Australia with his wife and three kids and can sometimes be found g Joel Falconer is the Features Editor at TNW. He lives on the Gold Coast, Australia with his wife and three kids and can sometimes be found gaming or consulting. Follow Joel on Twitter.

    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.