Skip to content

Commit 794f4ff

Browse files
jamesnwSondraEcaptainbrosset
authored
Selectors - and indexed pseudo classes (#2168)
Co-authored-by: SondraE <sondra@oddbird.net> Co-authored-by: Patrick Brosset <patrickbrosset@gmail.com>
1 parent 32df3ec commit 794f4ff

File tree

4 files changed

+124
-4
lines changed

4 files changed

+124
-4
lines changed

features/nth-child.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
name: ":nth-child() (initial support)"
2-
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."
1+
name: ":nth-child()"
2+
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."
33
spec:
44
- https://drafts.csswg.org/selectors-3/#nth-child-pseudo
55
- https://drafts.csswg.org/selectors-3/#nth-last-child-pseudo
66
group: selectors
7+
status:
8+
compute_from: css.selectors.nth-child
9+
compat_features:
10+
- css.selectors.first-child
11+
- css.selectors.first-child.no_parent_required
12+
- css.selectors.last-child
13+
- css.selectors.last-child.no_parent_required
14+
- css.selectors.nth-child
15+
- css.selectors.nth-child.no_parent_required
16+
- css.selectors.nth-last-child
17+
- css.selectors.nth-last-child.no_parent_required
18+
- css.selectors.only-child
19+
- css.selectors.only-child.no_parent_required

features/nth-child.yml.dist

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,28 @@ status:
66
baseline_low_date: 2015-07-29
77
baseline_high_date: 2018-01-29
88
support:
9-
chrome: "4"
9+
chrome: "1"
1010
chrome_android: "18"
1111
edge: "12"
1212
firefox: "3.5"
1313
firefox_android: "4"
1414
safari: "3.1"
1515
safari_ios: "2"
1616
compat_features:
17+
# baseline: high
18+
# baseline_low_date: 2015-07-29
19+
# baseline_high_date: 2018-01-29
20+
# support:
21+
# chrome: "1"
22+
# chrome_android: "18"
23+
# edge: "12"
24+
# firefox: "1"
25+
# firefox_android: "4"
26+
# safari: "3.1"
27+
# safari_ios: "2"
28+
- css.selectors.last-child
29+
30+
# ⬇️ Same status as overall feature ⬇️
1731
# baseline: high
1832
# baseline_low_date: 2015-07-29
1933
# baseline_high_date: 2018-01-29
@@ -27,7 +41,32 @@ compat_features:
2741
# safari_ios: "2"
2842
- css.selectors.nth-child
2943

30-
# ⬇️ Same status as overall feature ⬇️
44+
# baseline: high
45+
# baseline_low_date: 2015-07-29
46+
# baseline_high_date: 2018-01-29
47+
# support:
48+
# chrome: "2"
49+
# chrome_android: "18"
50+
# edge: "12"
51+
# firefox: "1.5"
52+
# firefox_android: "4"
53+
# safari: "3.1"
54+
# safari_ios: "2"
55+
- css.selectors.only-child
56+
57+
# baseline: high
58+
# baseline_low_date: 2015-07-29
59+
# baseline_high_date: 2018-01-29
60+
# support:
61+
# chrome: "4"
62+
# chrome_android: "18"
63+
# edge: "12"
64+
# firefox: "3"
65+
# firefox_android: "4"
66+
# safari: "3.1"
67+
# safari_ios: "4"
68+
- css.selectors.first-child
69+
3170
# baseline: high
3271
# baseline_low_date: 2015-07-29
3372
# baseline_high_date: 2018-01-29
@@ -40,3 +79,16 @@ compat_features:
4079
# safari: "3.1"
4180
# safari_ios: "2"
4281
- css.selectors.nth-last-child
82+
83+
# baseline: false
84+
# support:
85+
# chrome: "57"
86+
# chrome_android: "57"
87+
# edge: "79"
88+
# firefox: "52"
89+
# firefox_android: "52"
90+
- css.selectors.first-child.no_parent_required
91+
- css.selectors.last-child.no_parent_required
92+
- css.selectors.nth-child.no_parent_required
93+
- css.selectors.nth-last-child.no_parent_required
94+
- css.selectors.only-child.no_parent_required

features/nth-of-type.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: ":nth-of-type() pseudo-classes"
2+
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."
3+
spec: https://drafts.csswg.org/selectors-4/#typed-child-index
4+
group: selectors
5+
compat_features:
6+
- css.selectors.nth-last-of-type
7+
- css.selectors.first-of-type
8+
- css.selectors.last-of-type
9+
- css.selectors.nth-of-type
10+
- css.selectors.only-of-type

features/nth-of-type.yml.dist

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Generated from: nth-of-type.yml
2+
# Do not edit this file by hand. Edit the source file instead!
3+
4+
status:
5+
baseline: high
6+
baseline_low_date: 2015-07-29
7+
baseline_high_date: 2018-01-29
8+
support:
9+
chrome: "4"
10+
chrome_android: "18"
11+
edge: "12"
12+
firefox: "3.5"
13+
firefox_android: "4"
14+
safari: "3.1"
15+
safari_ios: "2"
16+
compat_features:
17+
# baseline: high
18+
# baseline_low_date: 2015-07-29
19+
# baseline_high_date: 2018-01-29
20+
# support:
21+
# chrome: "1"
22+
# chrome_android: "18"
23+
# edge: "12"
24+
# firefox: "3.5"
25+
# firefox_android: "4"
26+
# safari: "3.1"
27+
# safari_ios: "2"
28+
- css.selectors.first-of-type
29+
- css.selectors.last-of-type
30+
- css.selectors.nth-of-type
31+
- css.selectors.only-of-type
32+
33+
# ⬇️ Same status as overall feature ⬇️
34+
# baseline: high
35+
# baseline_low_date: 2015-07-29
36+
# baseline_high_date: 2018-01-29
37+
# support:
38+
# chrome: "4"
39+
# chrome_android: "18"
40+
# edge: "12"
41+
# firefox: "3.5"
42+
# firefox_android: "4"
43+
# safari: "3.1"
44+
# safari_ios: "2"
45+
- css.selectors.nth-last-of-type

0 commit comments

Comments
 (0)