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
enhancement New feature or request

Comments

@barraponto
Copy link

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

@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 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 commented Mar 5, 2012

+1

@jitendravyas
Copy link

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

@barraponto
Copy link
Author

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

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

@barraponto
Copy link
Author

Also, following StyleDocco might require it.

@ricardozea
Copy link

+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

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

@badsyntax
Copy link

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

@mhulse
Copy link

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

+1. Any workaround for supporting inline comments?

@yisibl
Copy link

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

+1

@nex3
Copy link
Contributor

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.

@nex3 nex3 closed this as completed Apr 5, 2018
@nex3 nex3 removed the planned We would like to add this feature at some point label Apr 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests