-
Notifications
You must be signed in to change notification settings - Fork 108
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 Pseudo selectors #1869
Add Pseudo selectors #1869
Conversation
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.
This one's really close. I have suggestions exclusively on descriptions and comments. Please resolve each as you see fit and merge, or @ me if you have questions. Thank you!
features/before-after.yml
Outdated
@@ -0,0 +1,13 @@ | |||
name: ::before and ::after | |||
description: The `::before` and `::after` CSS pseudo-elements select the first and last children of an element for styling, and are often used with the `content` property to add generated cosmetic content. |
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.
As written, I think this might be confused with :first-child
and :last-child
. What do you think of this?
description: The `::before` and `::after` CSS pseudo-elements select the first and last children of an element for styling, and are often used with the `content` property to add generated cosmetic content. | |
description: The `::before` and `::after` CSS pseudo-elements select inline boxes preceding and following an element. They are often used with the `content` property to generate cosmetic content. |
# baseline: high | ||
# baseline_low_date: ≤2017-03-27 | ||
# baseline_high_date: ≤2019-09-27 | ||
# support: | ||
# chrome: "26" | ||
# chrome_android: "26" | ||
# edge: "12" | ||
# firefox: "4" | ||
# firefox_android: "4" | ||
# safari: ≤10.1 | ||
# safari_ios: ≤10.3 | ||
- css.selectors.before.animation_and_transition_support | ||
|
||
# baseline: false | ||
# support: | ||
# chrome: "26" | ||
# chrome_android: "26" | ||
# edge: "12" | ||
# firefox: "4" | ||
# firefox_android: "4" | ||
- css.selectors.after.animation_and_transition_support |
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.
This data is pretty bad, but I'm OK with using compute_from to not worry about it for now: mdn/browser-compat-data#18109
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.
features/placeholder-shown.yml
Outdated
@@ -0,0 +1,11 @@ | |||
name: :placeholder-shown | |||
description: The `:placeholder-shown` CSS pseudo-element selects `<input>` and `<textarea>` elements when no value is set and placeholder text is shown. |
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.
Two ideas here:
- Avoid circularity with "…is shown"
- Distinguish with similarly-named pseudo?
description: The `:placeholder-shown` CSS pseudo-element selects `<input>` and `<textarea>` elements when no value is set and placeholder text is shown. | |
description: The `:placeholder-shown` CSS pseudo-element selects `<input>` and `<textarea>` elements when no value is set and the element's `placeholder` attribute is not empty. Not to be confused with `::placeholder`, which selects the placeholder text itself. |
features/placeholder.yml
Outdated
@@ -0,0 +1,7 @@ | |||
name: ::placeholder | |||
description: The `::placeholder` CSS pseudo-element selects text in `<input>` and `<textarea>` elements when no value is set. |
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.
Random idea: hint at the use case here?
description: The `::placeholder` CSS pseudo-element selects text in `<input>` and `<textarea>` elements when no value is set. | |
description: The `::placeholder` CSS pseudo-element selects help text in `<input>` and `<textarea>` elements when no value is set. |
description: The `::placeholder` CSS pseudo-element selects text in `<input>` and `<textarea>` elements when no value is set. | ||
spec: https://drafts.csswg.org/css-pseudo-4/#placeholder-pseudo | ||
caniuse: css-placeholder | ||
group: selectors |
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 wondered whether this should live with the placeholder attribute. I think they're distinct because they have dramatically different support histories. That said:
group: selectors | |
group: selectors | |
# TODO: create some kind of "input placeholders" feature when https://github.com/web-platform-dx/web-features/issues/971 is resolved, combining placeholder selectors and the element attr |
Per #1764 (comment), I used
select
as the verb.