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

Add support for :where() #1662

Merged
merged 5 commits into from Apr 7, 2022
Merged

Add support for :where() #1662

merged 5 commits into from Apr 7, 2022

Conversation

jathak
Copy link
Member

@jathak jathak commented Apr 5, 2022

@jathak jathak requested a review from nex3 April 5, 2022 21:09
CHANGELOG.md Outdated
@@ -1,3 +1,9 @@
## 1.49.12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should bump the minor version, since it's effectively a new feature.

@@ -831,14 +831,15 @@ class ExtensionStore {
// become `.foo:not(.bar)`. However, this is a narrow edge case and
// supporting it properly would make this code and the code calling it
// a lot more complicated, so it's not supported for now.
if (innerPseudo.normalizedName != 'is' &&
innerPseudo.normalizedName != 'matches') {
if (!{'is', 'matches', 'where'}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!{'is', 'matches', 'where'}
if (!const {'is', 'matches', 'where'}

@jathak jathak merged commit 039f2ad into main Apr 7, 2022
@jathak jathak deleted the where branch April 7, 2022 02:20
@stof
Copy link
Contributor

stof commented Apr 15, 2022

I find something weird in this PR: it seems to treat where exactly the same than is. But the reason why both exist is because :where has a specificity of 0, which I don't see in this PR

@jathak
Copy link
Member Author

jathak commented Apr 18, 2022

While the browser treats them differently, there aren't really any cases where the specificity difference matters from Sass's perspective. For the one place where this was previously the case (the laws of extend), we decided to tweak the spec there since the previous language led to somewhat surprising output (that would also have been more difficult to implement here).

@stof
Copy link
Contributor

stof commented Apr 19, 2022

thanks. I missed the spec tweak.

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

Successfully merging this pull request may close these issues.

None yet

3 participants