twolfson / grunt-spritesmith

Grunt task for converting a set of images into a spritesheet and corresponding CSS variables
MIT License
1.14k stars 92 forks source link

How disable comments from scss file #88

Closed Leolik closed 10 years ago

Leolik commented 10 years ago

In my result css file I see comments from generated .scss file

/*
SCSS variables are information about icon's compiled state, stored under its original file name

.icon-home {
  width: $icon-home-width;
}

The large array-like variables contain all information about a single icon
$icon-home: x y offset_x offset_y width height total_width total_height image_path;
*/

How disable this comment??

twolfson commented 10 years ago

There is currently not a setting to remove those comments from the files. It should not be present in the final CSS if you use a good minifier. Why do you want to remove it?

Leolik commented 10 years ago

In our requirements, do not use minification (slice stage) and css should be with comments (page separators and etc). It is good that there are comments in sprites.scss (for developers), but bad that they appear in the generated css. Can you change the comments that they were not visible in the css, only scss, for example:

// SCSS variables are information about icon's compiled state, stored under its original file name
//
// .icon-home {
//   width: $icon-home-width;
// }
//
// The large array-like variables contain all information about a single icon
// $icon-home: x y offset_x offset_y width height total_width total_height image_path;
twolfson commented 10 years ago

If you would like to keep the comments in SCSS but not in the CSS, then that responsibility falls on SASS. In the compressed compilation setting of SASS, it strips out all comments except for important ones

/*! This is important because it has the ! after the */

Maybe you can leverage that?

http://www.codechewing.com/library/permanent-comments-to-sass-compressed-css/

Leolik commented 10 years ago

When I said that we do not use minification, under this also meant that we use expanded output style for SASS.

At the moment, I have to cut the comments of the generated spritesmith .scss file using grunt-stripcomments. Thereafter, the resulting file CSS is generated without spritesmith comment. But it would be nice if your utility was some way to control the output comments.

juanbrujo commented 9 years ago

@Leolik +1

falxcerebri commented 8 years ago

@Leolik +1

DzmVasileusky commented 8 years ago

@Leolik +1

jt3k commented 8 years ago

+9999

timurztd commented 8 years ago

+