It’s been almost a year since the last release of the closely tied open source productsHamlandSass— 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.
Calling all Scaleup founders! Join the Soonicorn Summit on November 28 in Amsterdam.
Meet with the leaders of Picnic, Miro, Carbon Equity and more during this exclusive event dedicated to Scaleup Founders!
You can check out all the technical details and get started with Sass’s new toys over on theannouncement post.
Story byJoel 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(show all)Joel Falconeris the Features Editor at TNW. He lives on the Gold Coast, Australia with his wife and three kids and can sometimes be foundgamingorconsulting. Follow Joel onTwitter.
Get the TNW newsletter
Get the most important tech news in your inbox each week.