Inline comments should be kept inline #235

Open
barraponto opened this Issue Dec 29, 2011 · 14 comments

Projects

None yet
@barraponto

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?

@chriseppstein
Member

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

@nex3
Contributor
nex3 commented Feb 10, 2012

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.

@necolas
necolas commented Mar 5, 2012

+1

@jitendravyas

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

@barraponto

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.

@chrisslater

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

@barraponto

Also, following StyleDocco might require it.

@ricardozea

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

@theodorosploumis

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

@badsyntax

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 Aug 13, 2013
Closed

Inline SASS / SCSS comments #12

@mhulse
mhulse commented Aug 18, 2013

+1.

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.

@barcahead

+1. Any workaround for supporting inline comments?

@yisibl
yisibl commented Dec 20, 2013

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.

@joafeldmann

+1

@badsyntax badsyntax referenced this issue in badsyntax/SassBeautify Nov 1, 2014
Closed

Fix comment wrapping #57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment