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

Inline comments should be kept inline #235

Closed
barraponto opened this issue Dec 29, 2011 · 15 comments
Closed

Inline comments should be kept inline #235

barraponto opened this issue Dec 29, 2011 · 15 comments
Labels

Comments

@barraponto
Copy link

@barraponto barraponto commented Dec 29, 2011

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
Copy link

@chriseppstein chriseppstein commented Dec 30, 2011

@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
Copy link
Contributor

@nex3 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
Copy link

@necolas necolas commented Mar 5, 2012

+1

@jitendravyas
Copy link

@jitendravyas jitendravyas commented Nov 13, 2012

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

@barraponto
Copy link
Author

@barraponto barraponto commented Nov 13, 2012

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
Copy link

@chrisslater chrisslater commented Dec 18, 2012

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

@barraponto
Copy link
Author

@barraponto barraponto commented Dec 18, 2012

Also, following StyleDocco might require it.

@ricardozea
Copy link

@ricardozea ricardozea commented Dec 18, 2012

+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
Copy link

@theodorosploumis theodorosploumis commented Feb 9, 2013

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

@badsyntax
Copy link

@badsyntax badsyntax commented Aug 13, 2013

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

@mhulse
Copy link

@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
Copy link

@barcahead barcahead commented Nov 15, 2013

+1. Any workaround for supporting inline comments?

@yisibl
Copy link

@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
Copy link

@joafeldmann joafeldmann commented Sep 19, 2014

+1

@nex3
Copy link
Contributor

@nex3 nex3 commented Apr 5, 2018

I'm moving this issue to the new Ruby Sass repository because it's specific to Ruby Sass's implementation. Once it's there, I'm going to close it as "on ice" because Ruby Sass is deprecated and no additional features are planned for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.