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

Comments

Projects
None yet
@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

This comment has been minimized.

Show comment
Hide comment
@chriseppstein

chriseppstein Dec 30, 2011

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?

Member

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

This comment has been minimized.

Show comment
Hide comment
@nex3

nex3 Feb 10, 2012

Contributor

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.

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

This comment has been minimized.

Show comment
Hide comment
@necolas

necolas commented Mar 5, 2012

+1

@jitendravyas

This comment has been minimized.

Show comment
Hide comment
@jitendravyas

jitendravyas Nov 13, 2012

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

jitendravyas commented Nov 13, 2012

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

@barraponto

This comment has been minimized.

Show comment
Hide comment
@barraponto

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

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

This comment has been minimized.

Show comment
Hide comment
@chrisslater

chrisslater Dec 18, 2012

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

chrisslater commented Dec 18, 2012

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

@barraponto

This comment has been minimized.

Show comment
Hide comment
@barraponto

barraponto Dec 18, 2012

Also, following StyleDocco might require it.

barraponto commented Dec 18, 2012

Also, following StyleDocco might require it.

@ricardozea

This comment has been minimized.

Show comment
Hide comment
@ricardozea

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

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

This comment has been minimized.

Show comment
Hide comment
@theodorosploumis

theodorosploumis Feb 9, 2013

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

theodorosploumis commented Feb 9, 2013

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

@badsyntax

This comment has been minimized.

Show comment
Hide comment
@badsyntax

badsyntax Aug 13, 2013

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

badsyntax commented Aug 13, 2013

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

@mhulse

This comment has been minimized.

Show comment
Hide comment
@mhulse

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

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

This comment has been minimized.

Show comment
Hide comment
@barcahead

barcahead Nov 15, 2013

+1. Any workaround for supporting inline comments?

barcahead commented Nov 15, 2013

+1. Any workaround for supporting inline comments?

@yisibl

This comment has been minimized.

Show comment
Hide comment
@yisibl

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

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

This comment has been minimized.

Show comment
Hide comment
@joafeldmann

joafeldmann commented Sep 19, 2014

+1

@nex3

This comment has been minimized.

Show comment
Hide comment
@nex3

nex3 Apr 5, 2018

Contributor

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.

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.

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