Menu icon Foundation
Remove line number comments generated in app.css

Hi,

I am currently using Foundation 5, and would like to remove the line number comments that are being generated in app.css.

Example:

/* line 292, ../bower_components/foundation/scss/foundation/components/_global.scss */

Is there any easy way to fix this?

Thanks

settingsconfig.rbapp.css

Hi,

I am currently using Foundation 5, and would like to remove the line number comments that are being generated in app.css.

Example:

/* line 292, ../bower_components/foundation/scss/foundation/components/_global.scss */

Is there any easy way to fix this?

Thanks

Mihai Stroe over 5 years ago

In config.rb you have a few options for output_style that affect how Compass will compile the Sass. Play around with those settings and see how they output your css.

Steve Trask over 5 years ago

If you are using grunt edit grunt.js as per above outputstyle as below

 module.exports = function(grunt) {
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    sass: {
      options: {
        includePaths: ['bower_components/foundation/scss']
      },
      dist: {
        options: {
          outputStyle: 'compressed'
        },
        files: {
          'css/app.css': 'scss/app.scss'
        }        
      }
    },

    watch: {
      grunt: { files: ['Gruntfile.js'] },

      sass: {
        files: 'scss/**/*.scss',
        tasks: ['sass']
      }
    }
  });

  grunt.loadNpmTasks('grunt-sass');
  grunt.loadNpmTasks('grunt-contrib-watch');

  grunt.registerTask('build', ['sass']);
  grunt.registerTask('default', ['build','watch']);

Rafael Hegre Cabeza over 5 years ago

Thank you for your replies.

As currently not using grunt, I edited the config.rb file as mentioned above. I did not change the output_style, however uncommented line_comments to false as stated below:

To disable debugging comments that display the original location of your selectors. Uncomment:

line_comments = false

Mihai Stroe over 5 years ago

That works.

Testy Tester over 3 years ago

I would love to RE-enable this on Foundation 6, since I'm still devving and would love to find where some of these verbose styles are actually defined.

 

How is this done in Foundation 6? Why is it off by default, as opposed to on by default in v5?

Clayt over 3 years ago

I have the opposite issue. I'm on Foundation 5 compiled with Grunt and I want to re-enable line number comments. I've tried `line_comments=true`, `lineNumbers = true` and a few other things. No luck.