0

Is there anyway to enable line reference comments to the compiled CSS in Less?

I've researched a bit and haven't been able to find any info on how to enable line comments. This is difficult when debugging, because it's hard to know what less file the the compiled css class is coming from.

cimmanon
  • 67,211
  • 17
  • 165
  • 171
whatsnewsaes
  • 405
  • 2
  • 5
  • 13
  • 1
    Are you looking for [`dumpLineNumbers`](http://lesscss.org/usage/#using-less-in-the-browser-options)? – Harry Nov 07 '14 at 14:51
  • 1
    Yes!!! Looks like you can do it with grunt as well. https://github.com/gruntjs/grunt-contrib-less#dumplinenumbers – whatsnewsaes Nov 07 '14 at 15:28

1 Answers1

1

The help of the Less compiler will show you that you can set the line-numbers option

-------------------------- Deprecated ----------------
  --line-numbers=TYPE      Outputs filename and line numbers.
                           TYPE can be either 'comments', which will output
                           the debug info within comments, 'mediaquery'
                           that will output the information within a fake
                           media query which is compatible with the SASS
                           format, and 'all' which will do both.

Notice that this option has been deprecated in favor of v3 CSS sourcemap, see also: Compile LESS files with source maps.

Community
  • 1
  • 1
Bass Jobsen
  • 48,736
  • 16
  • 143
  • 224