Exciting brand brand new features – utilizing supply maps with Sass 3.3

Exciting brand brand new features – utilizing supply maps with Sass 3.3

One of many exciting brand brand new features in Sass 3.3 that each and every designer should simply simply take benefit of is maps that are source.

As CSS pre-processors, minifiers, and JavaScript transpilers are becoming conventional it’s increasingly hard to debug the rule operating into the web web browser due to distinctions because of the source code that is original.

For instance, if you utilize CoffeeScript (which compiles to JavaScript) you may not see CoffeeScript while debugging when you look at the web browser. Alternatively, you’ll see put together JavaScript. The problem that is same for Sass which compiles down seriously to CSS.

Source maps seek to bridge the space between higher-level languages like CoffeeScript and Sass while the languages that are lower-level compile down to (JavaScript and CSS). Supply maps permit you to look at source that is originalthe CoffeeScript or Sass) rather than the put together JavaScript or CSS while debugging.

This means that when you inspect an element with developer tools, rather than seeing the CSS styles associated with that element, you can see the code we really care about: the pre-compiled Sass in practice, for Sass users.

Generating source maps for Sass

To have use of this particular aspect when you look at the web web browser, you’ll want to create a supply map apply for each supply file.

For Sass, this is certainly as simple as including a flag to Sass’s demand line tool:

In the event that you look in your production folder after operating that command, you are going to realize that a remark happens to be put into the conclusion for the generated CSS file:

This points to a extra file that was made during compilation: screen.css.map , which – because the title suggests – is exactly what maps all the put together CSS back once again to the foundation Sass declarations. Continue reading “Exciting brand brand new features – utilizing supply maps with Sass 3.3”