How do I preserve CSS comments in Rails stylesheet assets that are minified?
This is similar to this question, but for CSS instead of JavaScript.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Rails currently uses YUI Compressor to minify CSS stylesheets during asset precompilation. See this section of the Rails asset guide.
To prevent certain comments from being removed, just add an exclamation point to the comment block as follows:
This is documented here.