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

Interpolations in CSS comments should not be evaluated in compressed mode #2359

Closed
lesf0 opened this issue Apr 19, 2017 · 7 comments
Closed
Assignees

Comments

@lesf0
Copy link

lesf0 commented Apr 19, 2017

The following compiled in compressed mode

/*
$variable: 0;
.classname {
	width: #{$variable};
}
*/

LibSass 3.5.0.beta.2

Error: Undefined variable: "$variable".

Ruby Sass 3.4.21

@xzyfer
Copy link
Contributor

xzyfer commented Apr 19, 2017

This actually a feature of Sass. Interpolations (#{}) in comments are still evaluated. The error happens because the interpolation is being evaluated but the assignment is not.

This project is an implementation of the Sass language. Our goal is to be 100% compatible with Sass. We're closing this issue since Ruby Sass produces the same output. In the future please confirm that LibSass' output differs from Ruby Sass before opening an issue.

If you wish to suggest features of file bugs in the Sass language please open an issue with Sass - https://github.com/sass/sass

@xzyfer xzyfer closed this as completed Apr 19, 2017
@lesf0
Copy link
Author

lesf0 commented Apr 19, 2017

@xzyfer , I've actually opened this issue because of different behaviour in Ruby Sass and LibSass. But I've checked out compressed style in both compilers. After your response I've checked default style too and then both compilers produces an error. So I'm not sure if this a bug or not, but at least it's a different from Ruby Sass on same configuration.

@xzyfer
Copy link
Contributor

xzyfer commented Apr 19, 2017

I'm sorry but it's not clear under which circumstances Ruby Sass and LibSass behave differently. In my tests the result is always Error: Undefined variable: "$variable". in both engines.

@lesf0
Copy link
Author

lesf0 commented Apr 19, 2017

@xzyfer
sass -t compressed test.scss test.css
sassc -t compressed test.scss test.css

@xzyfer
Copy link
Contributor

xzyfer commented Apr 19, 2017

Right so the difference in that in compressed mode Ruby isn't erring? This was not clear.

@xzyfer xzyfer reopened this Apr 19, 2017
@xzyfer xzyfer changed the title Commented out variable outputs are being executed. Interpolations in CSS comments should not be evaluated in compressed mode Apr 19, 2017
@xzyfer
Copy link
Contributor

xzyfer commented Apr 19, 2017

I've updated the issue to better describe problem.

@lesf0
Copy link
Author

lesf0 commented Apr 19, 2017

Thanks

mgreter added a commit to mgreter/libsass that referenced this issue May 21, 2017
mgreter added a commit to mgreter/sass-spec that referenced this issue May 21, 2017
@mgreter mgreter self-assigned this May 21, 2017
mgreter added a commit to mgreter/libsass that referenced this issue May 21, 2017
mgreter added a commit to mgreter/sass-spec that referenced this issue May 21, 2017
mgreter added a commit to mgreter/sass-spec that referenced this issue May 21, 2017
mgreter added a commit that referenced this issue May 21, 2017
Skip comment evaluation for compressed output (#2359)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants