Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to leave comments #202

Closed
tipiirai opened this issue Feb 15, 2011 · 13 comments
Closed

Ability to leave comments #202

tipiirai opened this issue Feb 15, 2011 · 13 comments

Comments

@tipiirai
Copy link

I'd like to leave comments to the resulting CSS file. For example

/** 
      Comments starting with ** are preserved
*/

/*! 
  C-style comments starting with *! are preserved. Similar to YUI minifier.
*/

Allows me to put in a license or if I want the resulting CSS file to be editable comments are crucial.

Thanks for the amazing tool!

Tero

@cloudhead
Copy link
Member

/* comment */ will be preserved
// comment will not be preserved

Cheers

@tipiirai
Copy link
Author

thanks for clarifying. I'm talking about the compressed version. I believe it does not leave comments at all.

@cloudhead
Copy link
Member

Maybe leaving header comments could make sense in the compressed version, but the point of the compressed version is to be as small as possible

@tipiirai
Copy link
Author

yea. you are right. thanks again for the great tool

@tipiirai
Copy link
Author

oh. and closing this one.

@ericrasch
Copy link

My need for keeping comments is due to using LESS with WordPress. WordPress Themes are initialized by the comment declaration at the top of the CSS (http://codex.wordpress.org/Theme_Development#Theme_Stylesheet). It would help to have a way to preserve this specific comment, but still output the minified version... just like tipiirai pointed out. I'm able to do this in Sass with a /*! ... */.

@pdaoust
Copy link

pdaoust commented Feb 29, 2012

Looking through the source, I see that the minifier now allows you to preserve comments by going /*! ... */, but it doesn't seem to be working. Am I reading the source wrong?

@pdaoust
Copy link

pdaoust commented Feb 29, 2012

Oops, never mind -- looks like I have to pass { yuicompress: true } to the parser, because there are now two different options for minifiers. Perhaps this ought to be mentioned in the documentation somewhere?

@Glench
Copy link
Contributor

Glench commented Mar 1, 2012

As the person that added the yuicompress option, I'd really really like it to be in the documentation, but so far no luck in getting @cloudhead's attention.

@StreetStrider
Copy link

Is there any way to completely ignore /* ... */ commens as // ... by LESS options?

@lukeapage
Copy link
Member

Output without compression 11then compress yourself.. ask cleancss for an
option to keep all comments...

@StreetStrider
Copy link

@lukeapage , hi.

compress yourself

Yes, I will. But I don't say anything about compression. I mean, I would like to use block comments in many ways as line comments and I don't need them in output at all.

@lukeapage
Copy link
Member

Sorry I don't understand. Less does remove // comments and keeps /*
comments.. does that help?

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants