Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Inline comments should be kept inline #235

barraponto opened this Issue · 14 comments

Sometimes comments are meant to be inline. Consider the following code:

.myselector {
  display: none; /* javascript will fix this */

It compiles to:

.myselector {
  display: none;
  /* javascript will fix this */

There are several use cases like this. Can it be done?


@nex3 I asked @barraponto to file this after a thread on the compass mailing list. I think this is a case where the meaning of the comment is changed significantly when placed on the next line. Are you opposed to special casing this?


I like the idea, but it would be moderately difficult to implement, since it involves somewhat non-local changes when compiling to CSS. It's pretty low priority.




@barraponto But why do you want to keep comments in final output?


Some stylesheets are meant to be extended/overriden, regardless of the extender writing CSS or SCSS (or using any other preprocessor). Comments are nice documentation, particularly when you're reading a shared stylesheet.


@barraponto I agree, I would like to see this implemented


Also, following StyleDocco might require it.


+1 for this one. Inline comments can be quite helpful. Some people don't necessarily want to minimize their CSS. And as @barraponto says, in shared stylesheets, documenting via comments is a nice thing to have.


+1. A compiles css file needs inline comments for non SASS users.


It would be nice to get an update on this, are there any plans to support inline comments?

@badsyntax badsyntax referenced this issue in badsyntax/SassBeautify

Inline SASS / SCSS comments #12



Having them on second line kinda screws up the context of the line/comment meaning.

I guess the alternative would be to put your inline comments on the line above, instead of after a property (for example):

.myselector {
  /* javascript will fix this: */
  display: none;

Not as nice though (in terms of documenting an uncompressed version of the code).

I'm pretty sure LESS has this problem as well.


+1. Any workaround for supporting inline comments?


Many times, we want to code output also has a better note, in order to help you better read the CSS code. It is strongly recommended to support this demand.

@badsyntax badsyntax referenced this issue in badsyntax/SassBeautify

Fix comment wrapping #57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.