W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2013

Re: [whatwg] Styling form controls (Was: Re: Forms-related feedback)

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 6 Dec 2013 10:30:18 +1100
Message-ID: <CAAWBYDAYJhSYPM7PvP=FuAQ5ha2g2OsX0tfFD7Gr80NGf9ktHw@mail.gmail.com>
To: Ian Hickson <ian@hixie.ch>
Cc: WHAT Working Group <whatwg@whatwg.org>, Dimitri Glazkov <dglazkov@chromium.org>, Jonas Sicking <jonas@sicking.cc>
On Thu, Dec 5, 2013 at 5:30 AM, Ian Hickson <ian@hixie.ch> wrote:
> On Tue, 3 Dec 2013, Dimitri Glazkov wrote:
>> > >
>> > > Yeah, the idea is you'd bind to the scroll box to change the whole
>> > > scroll UI, but you could also then override specific pseudos of the
>> > > scroll box to style subparts of the default (or custom) scrollbox
>> > > UI. This part was never very well developed though since the core of
>> > > XBL2 was never picked up. But I think the same approach should
>> > > probably still work with the newer Web components work, no? It needs
>> > > to be specified and implemented...
>> >
>> > Web components can't define pseudo elements. So no.
>> >
>> > This sadly also means that you can't write a CSS which styles the
>> > default UA UI if that is used, and styles an attached Shadow DOM if
>> > that is used.
>>
>> That's simply not true. Where'd you get that?
>>
>> http://www.w3.org/TR/shadow-dom/#custom-pseudo-elements
>> http://robdodson.me/blog/2013/11/15/the-cat-and-the-hat-css-selectors/
>
> The key feature here isn't defining _new_ pseudo-elements, but being able
> to map specific elements in the shadow tree to predefined standard
> pseudo-elements, in particular, the same pseudo-elements that the standard
> binding exposes.
>
> If such a feature is available, then the HTML spec could list which of the
> standard pseudos each default binding is expected to expose, and then
> authors could style subparts of standard controls easily.

At least within normal author shadow doms, the intent is to simply
document what id/class values users of the component should target for
styling.

Instead of "foo-bar::baz", do "foo-bar ^ #baz" or similar.

Making this work for UA shadows is harder, because we don't want
to/aren't able to expose the entire shadow DOM.  We can either do
magic, or just give up and say that UA-defined controls get to have
pseudos without exposing the whole markup tree.

~TJ
Received on Thursday, 5 December 2013 23:31:13 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:14 UTC