[whatwg] Customize HTML5 forms placeholder style

On Thu, 2010-02-18 at 22:48 +0100, Anne van Kesteren wrote:

> On Thu, 18 Feb 2010 17:29:14 +0100, Mounir Lamouri  
> <mounir.lamouri at gmail.com> wrote:
> > I am working on placeholder implementation on Gecko and I am face of the
> > placeholder style customization. Indeed, a website can style the
> > input/textearea element which can make default placeholder style
> > inappropriate.
> > The trivial idea is to create a CSS pseudo-element to style the
> > placeholder. I am going to implement that [1] as Webkit did [2].
> > But the properties that will apply to the pseudo-element should be
> > limited. Probably only those related to the font.
> >
> > At the moment, it looks like there is no specification about the style
> > customization of the placeholder. Maybe it would be appropriate to
> > specify one ?
> >
> > [1] https://bugzilla.mozilla.org/show_bug.cgi?id=457801
> > [2] https://bugs.webkit.org/show_bug.cgi?id=21227
> 
> Can we really not try to push this as pseudo-class and educate the masses?  
> UAs could do some trickery that their default style rule has higher  
> specificity than style= or some such to work around the issue WebKit ran  
> into.
> 
> 


Then you're left with what a browser can deliver, which may not suit all
cases. There ought to be a way to override it in CSS.

What about a new selector for these sorts of elements? Maybe something
like element:placeholder or somesuch? To me it seems logical that you
shouldn't be using pseudo elements, but at the same time shouldn't leave
it entirely in the hands of the browser (just look at the problems we
have with styling form elements at the moment!)

Thanks,
Ash
http://www.ashleysheridan.co.uk


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20100218/2d054d6a/attachment.htm>

Received on Thursday, 18 February 2010 13:54:44 UTC