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

Feature request: add a parameter to disable parsing of CSS comments #2727

Closed
Llbe opened this issue Aug 2, 2019 · 3 comments
Closed

Feature request: add a parameter to disable parsing of CSS comments #2727

Llbe opened this issue Aug 2, 2019 · 3 comments

Comments

@Llbe
Copy link

Llbe commented Aug 2, 2019

CSS comments (/**/) are parsed and interpolation is performed within them. This is a rational and good thing, unless you want to comment out SCSS code without using SCSS comments (//).

Now, if one uses --style=compressed that won't save the comments, parsing them isn't very useful (although existing code could behave differently if they're not parsed anymore).

I suggest adding a new parameter --skip-comments or similar, that simply disables parsing of CSS comments. You can use it if you want to be able to use any kind of commenting to disable code. Especially if you also use --style=compressed.

WDYT?

Related: #1123

@Llbe
Copy link
Author

Llbe commented Aug 2, 2019

I guess this could be viewed differently by saying that this is about "adding CSS style comments to SCSS", by enabling them with a parameter.

@Llbe
Copy link
Author

Llbe commented Aug 2, 2019

Sorry for the verbosity on this list, but --comment-style=any|scss|css is another option.

@nex3
Copy link
Contributor

nex3 commented Aug 2, 2019

It's generally not a good practice to add flags that change the behavior of the language itself, because it makes it easier to write stylesheets that aren't portable from one user's Sass installation to another's. Since it's also possible to comment out blocks of Sass code with silent comments, which many text editors have built-in macros for, I don't think it's worth the extra complexity and unportability.

@nex3 nex3 closed this as completed Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants