question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WebkitInputPlaceholder

See original GitHub issue

WebkitInputPlaceholder seems not to work. If i add simple css:

::-webkit-input-placeholder {
   color: red;
}

it works fine, but

WebkitInputPlaceholder: 'red',

not doing it’s job. Anyone has same issue? It’s not very popular CSS attribute, but i need to have it for customization options.

BTW, don’t you think, that react could have cross-browser support for those prefixed css stuff and remove WebkitInput, Moz and ms prefix all together. React let’s not to think about DOM too much, but still i have to think about browser prefixes

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
MattKunzecommented, Dec 7, 2015

Radium seems to suggest falling back to creating styles for pseudo-elements, I was curious if they had come up with a solution: https://github.com/FormidableLabs/radium/issues/243

We just ran into something similar with the spinner buttons for numeric input elements. I just added a style fragment as suggested elsewhere (we use webpack so we can just require it), thought it might be nice to keep it entirely within the component.

1reaction
waldreitercommented, Dec 7, 2015

@liesislukas I guess React can’t do anything here. Maybe this works for you:

var css = document.createElement('style');
document.body.appendChild(css);
css.innerHTML = '::-webkit-input-placeholder {color: red;}';
Read more comments on GitHub >

github_iconTop Results From Across the Web

::placeholder | CSS-Tricks - CSS-Tricks
:placeholder-shown is for selecting the input itself when it's placeholder text is being shown. As opposed to ::placeholder which styles the ...
Read more >
placeholder - CSS: Cascading Style Sheets - MDN Web Docs
The ::placeholder CSS pseudo-element represents the placeholder text in an <input> or <textarea> element. Try it. HTML Demo: ::placeholder.
Read more >
css ::-webkit-input-placeholder - CodeProject Reference
The non-standard proprietary ::-webkit-input-placeholder pseudo-element represents the placeholder text of a form element. This allows web developers and theme ...
Read more >
html - ::-webkit-input-placeholder does not work - Stack Overflow
i'm writing a mobile web sites and i'm styling it with sass. I would like to change the placeholder color of textinput, but...
Read more >
CSS ::placeholder Selector - W3Schools
The ::placeholder selector selects form elements with placeholder text, and let you style the placeholder text. The placeholder text is set with the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found