W3C home > Mailing lists > Public > www-style@w3.org > September 2015

Re: Styling <input type=text>

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 30 Sep 2015 10:56:29 -0700
Message-ID: <CAAWBYDCzcZ4dpNw3gjWnYrTOqN2UbSCKcYoGG7RSytHju8moqw@mail.gmail.com>
To: Anne van Kesteren <annevk@annevk.nl>
Cc: "www-style@w3.org" <www-style@w3.org>, Domenic Denicola <d@domenic.me>
On Wed, Sep 30, 2015 at 7:06 AM, Anne van Kesteren <annevk@annevk.nl> wrote:
> For the user agent stylesheet, there's no good way to address <input
> type=text>, since there's many values that make the <input> element
> end up in the Text state.
>
> The only way seems to be something along the lines of
>
>   input:not([type=hidden i]):not([type=search i]):not([type=tel i])...
>
> which gets verbose (enough that I don't want to complete it) and is
> hard to maintain. Is this something we should try to tackle?
>
> See https://github.com/whatwg/html/pull/212 for context.

Personally, I think not.  A well-designed custom element with similar
functionality should either throw upon setting an unrecognized value,
silently ignore the set, or ignore what you're trying to set and
instead just set it to the default value.  <input> is a legacy mistake
with the worst possible behavior - accepting the set with any value,
but interpreting it as something else.  I'm okay with it being
annoying to deal with.

That said, if we did want to tackle it, the right way would be with an
:input-type() pseudoclass.  Then :input-type(text) would match
<input>, <input type=text>, and <input type=foo>.

~TJ
Received on Wednesday, 30 September 2015 17:57:18 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:57 UTC