fix: replace :-moz-placeholder-shown with :-moz-placeholder#1532
fix: replace :-moz-placeholder-shown with :-moz-placeholder#1532ai merged 2 commits intopostcss:mainfrom Marukome0743:placeholder-shown
:-moz-placeholder-shown with :-moz-placeholder#1532Conversation
|
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-showndoesn't exist at Mozilla vendor-prefixed CSS extensions.That's why I removed the-mozprefix from placeholder-shown.js.It's a mistake.
Then, I replaced
:-moz-placeholder-shownwith:-moz-placeholder.Thank you so much for useful information!