[whatwg] Customize HTML5 forms placeholder style

Aryeh Gregor Simetrical+w3c at gmail.com
Mon Feb 22 11:21:18 PST 2010

Okay, I think the requirement for a solution here should be: authors
should not have to worry about their inputs looking bad if they
recolor them without taking placeholders into account.  The
placeholder can't just take on the same color as normal user input,
but also can't stay gray when it's now on a black background or
something.  (My previous suggestion failed on the latter count.)

The only good way I can see to do this is a new text-opacity property,
which gets multiplied by the opacity given by the color property (or
else replaces it, either way).  We could then add a :placeholder
pseudoclass, or a :no-value/:empty-value/whatever pseudo-class, either
way, and use :placeholder { text-opacity: 0.6 }.

But it seems excessive to add a whole new CSS property.  Does anyone
have any better ideas?  Or do we just require authors who are using
placeholders as well as recoloring their inputs to manually recolor
the placeholders too?  I'm not sure if that's reasonable.

More information about the whatwg mailing list