I am on OSX and I would like to be able to debug the generated Sass CSS in the Chrome (or Canary) developer tools using the new source function described. I use Sass and Compass.
I followed the good instructions here to get Sass to create the source map file. In the interest of anyone struggling with this, the steps are:
- Install a preview version of Sass with
sudo gem install sass --pre - Check out the version of Compass - you need 12.2, not 13 alpha. If you need to remove it, you can do it with
sudo gem uninstall compass --version 0.13.alpha.2 . - Add this to config.rb
sass_options = {:sourcemap => true} . - Go to the folder that contains your config.rb and run
sass --compass --sourcemap --watch scss:css (this tells Sass to compile the files in the scss folder to the CSS files in the css folder).
If everything works correctly, when you make changes to one of our scss files (say styles.scss), Sass will compile a new CSS file - at the same time, it will create a file called styles.css.map that contains the mapping information, which should allow Chrome to tell you the source SCSS file when you select an item in the developer tools.
I successfully received my Sass creating this file. But unfortunately, Chrome doesn't want to do anything about it. I did what seems recommended:
- Install Chrome Canary
- Go to chrome: // flags and enable the option "Enable developer tools" experiments "
- Open the tools for web developers (Function-12), click on the hexadecimal window in the lower right corner of the window and on the "General" tab, check "Include Source Cards" and on the "Experiments" tab, check "Sass Support".
- Restart canary
But when I check the item in the Developer Tools, I just get the same old link to the crappy CSS file. I want to see where the element styles appear in the SCSS file. Has anyone been lucky with this on Chrome OSX or even FireSass?
source share