Skip to content

Commit 82fc8b0

Browse files
authored
Mark target-within as discouraged (#3353)
1 parent 58934a8 commit 82fc8b0

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

features/target-within.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
name: :target-within
22
description: The `:target-within` CSS pseudo-class matches the element with an ID matching the URL fragment and its ancestors.
3-
spec: https://drafts.csswg.org/selectors-4/#the-target-within-pseudo
3+
spec: https://www.w3.org/TR/2022/WD-selectors-4-20220507/#the-target-within-pseudo
44
group: selectors
5-
# BCD key removed due to no implementation. See https://github.com/web-platform-dx/web-features/issues/2339
6-
# compat_features:
7-
# - css.selectors.target-within
5+
discouraged:
6+
# reason: The `:target-within` pseudo-class was dropped from the specification in favor of `:has(:target)`.
7+
# removal_date: 2023-08-16
8+
according_to:
9+
- https://drafts.csswg.org/selectors-4/#the-target-pseudo
10+
- https://github.com/w3c/csswg-drafts/issues/8357
11+
alternatives:
12+
- has
13+
- target

scripts/specs.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ const defaultAllowlist: allowlistItem[] = [
136136
[
137137
"https://github.com/whatwg/html/pull/11426",
138138
"This is where speculation rules' prefetch is in the process of being spec'd. Once the PR merges, change the spec url in `speculation-rules`, and remove this exception."
139+
],
140+
[
141+
"https://www.w3.org/TR/2022/WD-selectors-4-20220507/#the-target-within-pseudo",
142+
"Allowed because this is where the feature last appeared in the spec before removal."
139143
]
140144
];
141145

0 commit comments

Comments
 (0)