Among the exciting brand brand new features in Sass 3.3 that each and every designer should simply just take benefit of is maps that are source.
In training, for Sass users, this means once you examine a feature with designer tools, in the place of seeing the CSS designs connected with that element, you can view the rule we actually worry about: the pre-compiled Sass.
Generating source maps for Sass
To obtain usage of this feature into the web browser, you ought to create a supply map apply for each supply file.
For Sass, this will be as simple as incorporating a flag to Sass’s demand line device:
In the event that you try looking in your production folder after running that demand, you will realize that a remark happens to be included with the finish associated with the CSS that is generated file
Enabling supply maps when you look at the web web web browser
The thing that is second have to do to make the most of supply maps is always to make sure our web browser understands try to find them. Chrome, Firefox and Safari all have help for source maps.
If you are utilizing Chrome, supply maps are now actually the main core feature set, so that you don’t need to monkey around in chrome://flags any longer. Merely start up the DevTools settings and toggle the Enable CSS supply Maps choice:
For Firefox users, source maps have been in variation 29. You can easily allow them within the Toolbox Alternatives menu (the apparatus symbol) or by right-clicking any place in the Style Inspector’s guideline view and picking the Show initial sources choice. (more details is present in the Mozilla weblog.)
Safari is a little prior to the bend with regards to supply map help. In cases where a map file is detected, sources are automatically changed towards the source-mapped files, no setup necessary.
Another device inside our gear
When supply maps are enabled in your web browser of preference, the foundation guide for almost any design can change through the generated CSS to your supply Sass, down seriously to the line quantity. Amazing!
Just like Firebug as well as its successors drastically enhanced our ability to debug within the web browser, supply maps boost the level of our capabilities that are diagnostic. By permitting us to directly access our pre-compiled code, we will find and fix dilemmas faster than ever before. Given that i have been making use of supply maps for a few months, i can not imagine working without them.
Relate solely to Tim on twitter at @timhettler.
The Sass Way covers the latest news and subjects on handcrafting CSS with Sass and Compass. We make use of a publishing that is open and depend on efforts through the Sass community via our GitHub task.