Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prepend comment to SASS/Compass output

Is there a convenient way to have SASS automatically prepend a comment to the beginning of each CSS output file? Specifically, when using Compasss I'd like to stick a brief warning telling designers not to edit the CSS directly and to point them to instructions on getting started with Compass. I use an output style of :compressed, which strips out comments that are in the input SCSS/SASS file.

If there isn't a convenient way to do this then I'll submit an issue/patch. I was thinking of adding an option named :output_prefix that takes a String that will be prepended to all output CSS files.

like image 331
balexand Avatar asked Dec 10 '22 12:12

balexand


1 Answers

From the SASS reference on comments:

When the first letter of a comment is !, the comment will be interpolated and always rendered into css output even in compressed output modes. This is useful for adding Copyright notices to your generated CSS.

So you could start your SASS file with something like this:

/*!
 * WARNING: Don't edit this file by hand! Instead, you should be using Compass.
 * (More information at http://compass-style.org/)
 */
like image 185
hopper Avatar answered Dec 28 '22 08:12

hopper