-
Notifications
You must be signed in to change notification settings - Fork 461
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
LibSass supports cross-media @extend #712
Comments
Wasn't this a feature that was available in Sass but was neutered in 3.2? Anyways..... ssssshhhhhhhhhh |
Shouldn't this be a bug in LibSass? The expected behavior in the test was that The lack of this "feature" seems like a necessary evil to prevent unexpected behavior like that. If I wanted to extend the .selector {
content: selector;
}
@media print {
.other-selector {
@at-root (without: media) {
@extend .selector;
}
background: red; // custom rule inside media query
}
} |
What is the status on this? Do you need me to write a spec? |
Maintainers, what is the current status on this? |
This is a bug in libsass. Sass does have a feature planned to support cross media extends but it does not have the output you see here. The correct output requires Sass to keep the |
@KittyGiraudel The information at http://sass-compatibility.github.io/#cross_media_extend is not accurate. LibSass doesn't "get this right". It gets it very wrong just like sass got it very wrong back when we allowed it. |
Sass Compatibility has no "get it right" or "get it wrong". It has support or no support. |
The presentation implies there is a feature that libsass has and other implementations don't. It's impossible for Ruby sass 3.4 anything other than 100% because it is the reference implementation. Hunt & pecked on my iPhone... Sorry if it's brief! |
I could add a note about how LibSass gets it wrong in the description if you will but I won't be able to do much more. Sass Compatibility intends to list inconsistencies between Sass engines. It is an inconsistency, no matter if both are not supporting what you deem is right. |
@KittyGiraudel Then the sense of the discrepency is wrong. The feature should be "forbids @extend in @media" and Sass should have it checked and libsass should not have it checked. |
@KittyGiraudel Anyways, I really like the presentation of your compatibility guide. It would be awesome if we could data-drive it from sass-spec. are you open to working with us on that? |
That seems reasonable.
It already is, except for the few tests that do not exist on sass-spec. I have been working with @xzyfer on this for several weeks now. As a result, I have written a lot of extra tests for sass-spec. :) |
Excellent. Where is the mapping of tests to features? |
Hardly the place for it I suppose. Where should I reach you Chris? |
LibSass does support a buggy version of it, hence should not be used. |
@KittyGiraudel could you please create a spec representing the correct behaviour? |
There: sass/sass-spec#261. |
@mgreter have you confirmed the (unmerged) spec sass/sass-spec#261 passes? |
Nevermind, that spec requires capturing errors. |
I can confirm that for the sass/sass-spec#261 testcase libsass still works, i.e. produces output .foo, .bar {
content: 'foo'; } without reporting an error. This was:
|
Looks like a regression in 3.3. This was fixed in 3.2.0.
|
Tracking the regression in #1562 |
This PR activates specs for sass/libsass#712
I feel kind of dirty reporting this, because this is not actually a bug per se... It turns out LibSass does support something Ruby Sass doesn't. Moreover, this feature has been asked for years in Sass, so I'm quite confused about the way to go here... Should this be removed? I'll leave you the only judge of this.
Test:
Expect:
Result:
Ref: http://sass-compatibility.github.io/#cross_media_extend.
The text was updated successfully, but these errors were encountered: