Repository is archived
No commit activity in last 3 years
No release in over 3 years
Rails gem for generating sass source maps
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0

Runtime

>= 0
~> 3.3
~> 5.0.0.beta1
>= 2.3.0
 Project Readme

DEPRECATED: Sass Rails Source Maps

This gem is not under active developement

As an alternative, you can try to use sassc-rails with inline source maps support.


NOTE: This gem requires sass-rails version 5.0.0

This gem allows you to see your Rails 4 .scss source files in Google Chrome inspector, which can be useful for debugging.

debug_info option available in stable sass gem is no longer working in Google Chrome, because Chrome now supports Source Map v3 only.

Installation

Source Maps are supported by sass gem in version 3.3 and higher. Unfortunately, sass-rails, the rails dependency, freezes sass gem to version ~> 3.2.0. To use this gem, you need to follow these steps:

  • Add sass-rails-source-maps to your application's Gemfile :
group :development do
  gem 'sass-rails-source-maps'
end

This branch depends on sass-rails version 5.0.0 which has more relaxed dependency for sass gem. So to avoid version conflict you need to:

  • Unfreeze sass-rails gem in your Gemfile (delete version for sass-rails)

For example, in new Rails 4.1.5 application change line

gem 'sass-rails', '~> 4.0.3'

to

gem 'sass-rails'

in your Gemfile.

  • And then execute:
bundle update sass-rails
  • After that, run:
rake assets:clobber

to make Rails regenerate assets. After assets regeneration, assets/source_maps containing sass source maps is created in public directory.

Usage

If everything works fine, you should see something like this screenshot

Enabling source maps may vary in different Chrome versions. For more info please see Working with CSS Preprocessors.

Notes

  • This gem is not intended for production usage.
  • This gem is Rails 4.x compatible only

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request