-
Notifications
You must be signed in to change notification settings - Fork 464
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
Should throw error when & has no parent #1644
Comments
Thanks for the report @HeadOnAPlate. We're looking into it. |
The previous behaviour was a bug. This code should error because there is no parent selector to replace
|
Give that the output is essentially invalid CSS the current behaviour is more correct than the previous behaviour. As such I'm moving this to 3.3.3. |
I understand. In the ruby-sass implementation this appears to throw an error as well. Also: has the spec changed regarding this parent selector '&'? Because we have been using this code since april 2014, without any problem. |
Since |
Ok, I experimented a bit and it turns out length(&) seems to return 1, even if there is no context. I managed to guard the code by using this function instead: Thanks for pointing me in the right direction. |
It looks like
is enough to reproduce that. |
I've got a patch for this locally. |
This PR activates specs for sass/libsass#1644
Until recently (sass/libsass#1644), libsass silently ignored the & character used to reference the parent selector when there was no parent. Since that behaviour has been changed, introduce a workaround to get the ua-support mixin to work either at the base level or nested in another rule.
This is a followup to issue #1569 .
Libsass no longer crashes in the specified test-case, but instead outputs the "&" in the css.
Produces the following outputs:
libsass version 3.2.5
libsass version 3.3.1
The text was updated successfully, but these errors were encountered: