-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix: replace :-moz-placeholder-shown
with :-moz-placeholder
#1532
Conversation
Mozilla had |
-moz
prefix for :placeholder-shown
:-moz-placeholder-shown
with :-moz-placeholder
Thank you for nice review and checking! |
Thanks. Released in 10.4.21. |
Keep in mind that this change effectively breaks it in Firefox (at least for v136@macOS) within the following constellation: |
@pooledge can you explain better the problem? Input, output, expected CSS. |
Input (Svelte scoped SCSS): div {
:global(input) {
&:not(:placeholder-shown),
&:focus {
/* part 1 */
:global(~ label) { /* part 2 */ }
}
}
} Output v10.4.21 (won't apply for Firefox v136 on mac): div input:not(:-moz-placeholder) {
/* part 1 */
}
div input:not(:placeholder-shown), div input:focus {
/* part 1 */
}
div input:not(:-moz-placeholder) ~ label {
/* part 2 */
}
div input:not(:placeholder-shown) ~ label, div input:focus ~ label {
/* part 2 */
} Output v10.4.20 (works well in all browsers): div input:not(:-moz-placeholder-shown) {
/* part 1 */
}
div input:not(:placeholder-shown), div input:focus {
/* part 1 */
}
div input:not(:-moz-placeholder-shown) ~ label {
/* part 2 */
}
div input:not(:placeholder-shown) ~ label, div input:focus ~ label {
/* part 2 */
} Edit: parts were displaced while creating minimum reproducible, sorry |
Why it works well? |
That's a good question. While the documentation on this looks pretty comprehensive, reality is different, as e.g. this one was build with < v10.4.21 |
@pooledge maybe it was a feature based on bug behavior? |
I have checked the behavior in FireFox Browser. HTML code
<main>
<form class="flex flex-col p-4 w-60">
<label for="name">Full Name:</label>
<input id="name" name="name" type="text" />
<label for="email">Email Address:</label>
<input
id="email"
name="email"
type="email"
placeholder="name@example.com"
/>
<label for="age">Your age:</label>
<input
id="age"
name="age"
type="number"
placeholder="You must be 18+"
/>
</form>
</main> ✅
|
It works because
..and this is how the non-prefixed styling declaration wins, while with I wish |
Update on <style lang="scss">
/*! autoprefixer: off */
div { /*...*/ }
</style> |
Description
When Autoprefixer parses the
:placeholder-shown
, the following results are obtained in Autoprefixer CSS online.However,
:-moz-placeholder-shown
doesn't exist at Mozilla vendor-prefixed CSS extensions.That's why I removed the-moz
prefix from placeholder-shown.js.It's a mistake.
Then, I replaced
:-moz-placeholder-shown
with:-moz-placeholder
.Thank you so much for useful information!