-
Notifications
You must be signed in to change notification settings - Fork 200
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
Placeholder selector is not vendor prefixed #14
Comments
Good catch, I didn't know this. I should be able to add it. As a workaround for now, try this undocumented method - |
Cool! I ended up with this: const placeholder = (x) => ({
...add(':placeholder', x),
...add(':-webkit-input-placeholder', x),
...add(':-moz-placeholder', x),
...add(':-ms-input-placeholder', x),
}) |
✌️ |
the next version of glamor should do this automatically |
Placeholder is still not vendor prefixing:
Results in this output in the head stylesheet:
|
ah, it doesn't do it for the nested version, only when using the helper. will fix. |
fixed in 2.20.14 |
It isn't working right now. Glamor put all vendor prefixes in a single comma separated rule: Lines 322 to 325 in 09dd49d
But it doesn't work. I found why here: http://stackoverflow.com/a/23338422/2379685
You can test it in this fiddle using chrome: https://jsfiddle.net/Lcjfkrb2/ Also, you can go to https://autoprefixer.github.io/ and paste: input::placeholder {
color: red
} The result will be: input::-webkit-input-placeholder {
color: red
}
input::-moz-placeholder {
color: red
}
input:-ms-input-placeholder {
color: red
}
input::placeholder {
color: red
} Couldn't this be handled by autoprefixer instead of hard coded? |
I think I figured out how to resolve it. Working on a PR. |
Done! |
It seems placeholder styles are not working in Chrome, seemingly because the selector
::placeholder
is not supported (needs to be::-webkit-input-placeholder
) and as far as I could tell from a quick look through the code, the selectors are not processed by the prefixer, only rules are.Question is, since the cases where the selector needs to be prefixed somehow are quite rare and tricky to handle in a generic way (for example, to get placeholder styling to work cross-browser you need to duplicate the rule blocks iirc), is it better to handle these things case by case or find some more generic solution (i.e pass all selectors through a prefixer)?
The text was updated successfully, but these errors were encountered: