-
Notifications
You must be signed in to change notification settings - Fork 200
Selectors - and indexed pseudo classes #2168
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e777713
Add nth-of-type and expand nth-child
jamesnw d111ddd
add group and descriptions
SondraE 5160fd7
remove caniuse
SondraE 04e50e3
Merge branch 'main' of github.com:web-platform-dx/web-features into s…
jamesnw b1f1fbd
Shorten descriptions
jamesnw 202ef91
Merge branch 'main' of github.com:web-platform-dx/web-features into s…
jamesnw aea9d3b
Update descriptions, but too long
jamesnw a53199b
Merge branch 'main' of github.com:web-platform-dx/web-features into s…
jamesnw a15f874
Shorten descriptions
jamesnw d49576f
Remove (initial support)
jamesnw 3671bc2
Fix missing quote
jamesnw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,19 @@ | ||
| name: ":nth-child() (initial support)" | ||
| description: "The `:nth-child()` and `:nth-last-child()` CSS functional pseudo-classes match elements by the relative position of elements (first, second, third, fourth, and so on), counted from the first or last sibling." | ||
| name: ":nth-child()" | ||
| description: "The `:nth-child()` and `:nth-last-child()` CSS functional pseudo-classes match elements based on their index within a list of elements. The `:first-child` and `:last-child` pseudo-classes match the first and last element in a list, and the `:only-child` pseudo-class matches an element with no siblings." | ||
| spec: | ||
| - https://drafts.csswg.org/selectors-3/#nth-child-pseudo | ||
| - https://drafts.csswg.org/selectors-3/#nth-last-child-pseudo | ||
| group: selectors | ||
| status: | ||
| compute_from: css.selectors.nth-child | ||
| compat_features: | ||
| - css.selectors.first-child | ||
| - css.selectors.first-child.no_parent_required | ||
| - css.selectors.last-child | ||
| - css.selectors.last-child.no_parent_required | ||
| - css.selectors.nth-child | ||
| - css.selectors.nth-child.no_parent_required | ||
| - css.selectors.nth-last-child | ||
| - css.selectors.nth-last-child.no_parent_required | ||
| - css.selectors.only-child | ||
| - css.selectors.only-child.no_parent_required |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| name: ":nth-of-type() pseudo-classes" | ||
| description: "The `:nth-of-type()` and `:nth-last-of-type()` CSS functional pseudo-classes match elements based on their position among siblings of the same type. The `:first-of-type`, `:last-of-type`, and :only-of-type` pseudo-classes match the first, last, and only elements of its type." | ||
| spec: https://drafts.csswg.org/selectors-4/#typed-child-index | ||
| group: selectors | ||
| compat_features: | ||
| - css.selectors.nth-last-of-type | ||
| - css.selectors.first-of-type | ||
| - css.selectors.last-of-type | ||
| - css.selectors.nth-of-type | ||
| - css.selectors.only-of-type |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # Generated from: nth-of-type.yml | ||
| # Do not edit this file by hand. Edit the source file instead! | ||
|
|
||
| status: | ||
| baseline: high | ||
| baseline_low_date: 2015-07-29 | ||
| baseline_high_date: 2018-01-29 | ||
| support: | ||
| chrome: "4" | ||
| chrome_android: "18" | ||
| edge: "12" | ||
| firefox: "3.5" | ||
| firefox_android: "4" | ||
| safari: "3.1" | ||
| safari_ios: "2" | ||
| compat_features: | ||
| # baseline: high | ||
| # baseline_low_date: 2015-07-29 | ||
| # baseline_high_date: 2018-01-29 | ||
| # support: | ||
| # chrome: "1" | ||
| # chrome_android: "18" | ||
| # edge: "12" | ||
| # firefox: "3.5" | ||
| # firefox_android: "4" | ||
| # safari: "3.1" | ||
| # safari_ios: "2" | ||
| - css.selectors.first-of-type | ||
| - css.selectors.last-of-type | ||
| - css.selectors.nth-of-type | ||
| - css.selectors.only-of-type | ||
|
|
||
| # ⬇️ Same status as overall feature ⬇️ | ||
| # baseline: high | ||
| # baseline_low_date: 2015-07-29 | ||
| # baseline_high_date: 2018-01-29 | ||
| # support: | ||
| # chrome: "4" | ||
| # chrome_android: "18" | ||
| # edge: "12" | ||
| # firefox: "3.5" | ||
| # firefox_android: "4" | ||
| # safari: "3.1" | ||
| # safari_ios: "2" | ||
| - css.selectors.nth-last-of-type |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unclear as to what these subfeatures cover. Can you help me understand?
Would they make sense as a separate feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Selectors level 3 had text referring to the children's parent, but selectors level 4 adds the note-
For instance, the document root matches
:first-childdespite having no parent.This doesn't seem like a feature to me. It also looks like Safari data might be incorrect, as
document.documentElement.matches(":first-child")returns true in Safari.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Keeping them here, ignored, seems right then.