13

I'm currently using the less-rails gem in a Ruby on Rails application that I'm building. I would like some way to debug my Less css files in Chrome by way of source maps (https://developers.google.com/chrome-developer-tools/docs/css-preprocessors) Does anyone know how this can be accomplished?

Mark Murphy
  • 2,834
  • 1
  • 31
  • 29
  • Not an answer but in case you haven't seen these yet... (1) a gem for source maps with sass [sass-rails-source-maps](https://github.com/vhyza/sass-rails-source-maps) and (2) a gist for an initializer for coffeescript source maps [source_maps.rb](https://gist.github.com/alexspeller/3730452) – John Kacz Jan 29 '16 at 17:25

2 Answers2

-1

In my opinion, the most convenient way to solve the problem: to abandon the assets pipeline and less-rails. change to gulp or blendid with gulp-less+gulp-less-sourcemap. This will take time to configure, but as my practice shows, the loss of time more than pays off with features like life edit, very fast compilation, and of course - sourcemaps.

In fact, I personally did not use less in such a bundle, but the implementation of sass is very convenient. I think that with less it could be the same

hazg
  • 318
  • 2
  • 10
-3

You can use pry to debug in rails. So, whereever you are using your css in the haml or html you can write something like -binding.pry( if its haml). Pry is used for debugging ruby code but you can also use it in your haml(view) using -.

https://github.com/pry/pry

Hope this helps.

user907998
  • 15
  • 2