-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
Description of :not() selector #16975
Comments
Looking at this issue while filing this one, it seems this bullet point was actually a hold over from when
I think this bullet point should actually be removed as it might be futile to continue editing it to try to make it correct when the initial premise is no longer true. |
This is a tricky one. Selectors are read right to left, so your selecting all links and hoping to exclude links that have a specific "ancestor" in this case edbaafi is right in that it should either be removed or explained in a less confusing way, but |
yes IMO what the original bullet was trying to highlight was that:
Now that this is possible with Selectors level 4, if this bullet point is to stay (to remedy the faulty logic aspect), perhaps something like this is clearer:
|
This is tricky stuff, but I understand it and it makes sense. |
that would work. I think removing all of
and then adding the above after the unordered list, not within it, since it starts with a "be careful" statement. |
How about we rewrite it to something like this:
Reads more clearer to me. |
Me too. Would be great if you could put together a PR with that change. |
@deepug9787 @sideshowbarker Sorry but this is not correct. Please revert this change and reopen this issue.
In the example you listed, there is nothing that causes this selector to exclude A counterexample showing your explanation/logic is incorrect (changing
Thus we can't say this selector excludes
which is what
which is what I can provide a correct example/explanation but need to know what we are trying to accomplish with this bullet point and if we think this is still relevant given Selector Level 4 removed the initial limitation. |
@estelle see incorrect logic/explanation in merged PR ^ |
This reverts commit 6dbaf68. See #16975 (comment)
I think I moved a little too quickly on this one. Seeing that there was already a discussion going on around this issue, I should've waited for everyone's feedback before I issued the PR. My apologies. |
No worries — it’s under version control and nothing’s destructive, and it didn’t break a build or somethng. If anything, it helped make clear we all care about getting it right |
That part I can’t answer because it’s not clear to me either what it’s currently intending to accomplish |
We can consider this done via #18748? |
MDN URL
https://developer.mozilla.org/en-US/docs/Web/CSS/:not
What specific section or headline is this issue about?
Description, 6th bullet
What information was incorrect, unhelpful, or incomplete?
This is confusing and may be an error. I think it might be correct if "ancestors" were changed to "children" (or "descendants"?), as in:
"This selector only applies to one element; you cannot use it to exclude all
ancestorschildren. For instance,body :not(table) a
will still apply to links inside a<table>
, since<tr>
will match with the:not()
part of the selector."What did you expect to see?
Previous field says it all.
Do you have any supporting links, references, or citations?
No response
Do you have anything more you want to share?
No response
MDN metadata
Page report details
en-us/web/css/_colon_not
The text was updated successfully, but these errors were encountered: