Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Inline comments should be kept inline #235

barraponto opened this Issue · 14 comments

13 participants

Capi Etheriel Chris Eppstein Natalie Weizenbaum Nicolas Gallagher Jitendra Vyas Chris Slater Ricardo Zea Theodoros Ploumis Richard Willis Michael Hulse barcahead 一丝 Joachim Feldmann
Capi Etheriel

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?

Chris Eppstein

@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?

Natalie Weizenbaum

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.

Nicolas Gallagher


Jitendra Vyas

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

Capi Etheriel

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.

Chris Slater

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

Capi Etheriel

Also, following StyleDocco might require it.

Ricardo Zea

+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.

Theodoros Ploumis

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

Richard Willis

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

Richard Willis badsyntax referenced this issue in badsyntax/SassBeautify

Inline SASS / SCSS comments #12

Michael Hulse


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.

Richard Willis 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.