Re: Styling HTML placeholder attribute

On Jan 24, 2013, at 1:07 PM, Alan Stearns <stearns@adobe.com> wrote:

> On 1/24/13 12:41 PM, "Bjoern Hoehrmann" <derhoermi@gmx.net> wrote:
> 
>> * Philip Walton wrote:
>>> Obviously it would be terribly confusing, but has the option of both
>>> pseudo-class and pseudo-element been discussed?
>>> 
>>> `input:placeholder` would be used to describe an input element whose
>>> placeholder is visible and `input::placeholder` would be used to style
>>> the
>>> placeholder.
>> 
>> I note in passing that the identifier `placeholder` does not have to be
>> used in any selector at all, the Working Group is free to call them e.g.
>> `:unedited` and `::hint-text` if it wanted to.
> 
> This seems the most reasonable approach to me (based on what I've
> understood in this thread so far).
> 
> Have an :unedited pseudo-class representing the state of the input
> element, with a ::suggestion pseudo-element that represents the contents
> of the element in that state. I'll add this option to the wiki. 

I agree that this would be terribly confusing. I guess it would allow using opacity and also styling the borders differently based on state, but it would be rough for authors to have to remember that it is two colons for color and opacity and one colon for everything else. Put a background or border on the wrong one and you get very bad results. 

Received on Thursday, 24 January 2013 21:24:52 UTC