Prepare a comment for the release of SASS / Compass

Is there any convenient way for SASS to automatically add a comment at the beginning of each CSS output file? In particular, when using Compass, I would like to add a brief warning that designers should not edit CSS directly and give them instructions for getting started with the compass. I use the output style :compressed , which removes the comments that are in the SCSS / SASS input file.

If there is no suitable way to do this, I will post a question / patch. I was thinking of adding an option called :output_prefix , which accepts a string to be added to all CSS output files.

+4
source share
3 answers

compressed bars exclude all comments. I suggest you add this property:

 warning { do-not: "edit this file"; } 

Regarding the proposed patch, I do not think that this use case is convincing enough to guarantee such a possibility.

0
source

From the SASS link to comments :

When the first letter of the comment is !, the comment will be interpolated and always output to css output even in compressed output modes. This is useful for adding copyright notifications to generated CSS.

So, you can run your SASS file something like this:

 /*! * WARNING: Don't edit this file by hand! Instead, you should be using Compass. * (More information at http://compass-style.org/) */ 
+13
source

Known bug in Sass. Fixed in the main, but not yet released:

https://github.com/nex3/sass/issues/784

0
source

Source: https://habr.com/ru/post/1332817/