-
-
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
Doesn't properly generate input placeholder rules #189
Comments
I understand, but you want Autoprefixer to be too smart and understand does vendor hack (like Current logick is simple. If you write vendor hack, Autoprefixer will not add own. We can add more code, try to look inside rules. But I think, it will be bad for code climate and overengineering :). But I open for PR :). |
I think that makes sense for properties, but not for pseudo-elements. |
I understand, that you have some point, but them come another user and say, that he want different logic ;). |
It's the CSS language logic. |
I mean, that somebody may need miss some property in hack selector. How do I know, that you need color for webkit in your example? |
Or maybe we should remove too smart logic and not detect hacks for selectors? Main problems is when browsers well start support placeholders and will read both prefixed and unprefixed rules. |
What I'm thinking is that you don't need to; you pretend like it isn't there and generate the full set of rules.
How would that be different than having them apply 2 separate vendor-prefixed rules (see my desired output example)? |
Could |
I will change logic for selectors only in 1.1, because it will broke current API. |
OK sounds good. Might be something to get wider feedback on before a public release too. Thanks for considering it :) |
Yep, this is not working properly for us at Twitter. Say I have 2 files. One uses prefixed placeholders (or has them generated in place), the other uses |
Or even the same file. You might ask "why", but this is what a bundle looks like when you append override rules for experiments. Source: /* from default.css */
input::placeholder { color: gray; }
/* from override.css */
input::placeholder { color: black; } Output: /* from default.css */
input::-moz-placeholder { color: gray; }
input:-ms-input-placeholder { color: gray; }
input::-webkit-input-placeholder { color: gray; }
input::placeholder { color: gray; }
/* from override.css */
input::placeholder { color: black; } Clearly, if you expect the unprefixed |
Hmmm, really I totally forget about this. Moving property logic to selectors is a bad idea :). |
There will not be hotfix today :(. We need more smarter check to prevent adding prefixed selector again, when in some cases we call autoprefixer again. But I can use logic from properties, where we view for prefixed selectors only on upper unprefixed one (also it will be faster). For hostfix today you can put next placeholder in any at-rule to create new context, like: @media all {
input::placeholder { color: black; }
} I will fix it on this or next week and them you can remove your hack. |
Yeah that definitely adds to the difficulty. Thanks for the hack! That works for now. |
Done 42a6539
|
I try to release 1.1 with this fix at Monday. |
Thanks so much for this! |
Version 1.1 with this fix was released today. |
tldr: what do I use for placeholder? |
@erichonkanen |
@ai thanks |
reduce the padding in textbox. i am able to get the placeholder in firefox |
source:
output:
expected:
I'd expect to be able to "extend" the generated webkit rule (in the example), rather than have it completely omitted by AP.
The text was updated successfully, but these errors were encountered: