W3C home > Mailing lists > Public > www-style@w3.org > March 2016

Re: [selectors] Suggestion for :focus-ring pseudoclass

From: Brian Kardell <bkardell@gmail.com>
Date: Thu, 17 Mar 2016 09:37:32 -0400
Message-ID: <CADC=+jfv6jJo92f9L9=TczP_B5Ko5RFEaxH79P0=XF_y5fb52Q@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: www-style list <www-style@w3.org>
On Wed, Mar 16, 2016 at 7:58 PM, Tab Atkins Jr. <jackalmage@gmail.com>
wrote:

> On Tue, Sep 22, 2015 at 3:21 PM, Tab Atkins Jr. <jackalmage@gmail.com>
> wrote:
> > I'm currently in discussion with Alice Boxhall and Brian Kardell about
> > their input modalities proposal (which we discussed at the f2f), but
> > one thing that came out of the discussion which seemed independently
> > relevant is the ability to directly style the "focus ring" state.
> >
> > By "focus ring" state, I mean the subset of :focus that, in the
> > absence of any overriding author styles, triggers a UA focus ring.
> > This currently happens any time a text input or [tabindex > 0] element
> > is focused, and when a button is *keyboard* focused (but not when it's
> > clicked).
> >
> > Mozilla has something approximately equivalent today, with
> > :-moz-focusring
> > <https://developer.mozilla.org/en-US/docs/Web/CSS/%3A-moz-focusring>.
> > (The only difference is that it doesn't match anything if "focus ring
> > drawing" is turned off.)
> >
> > The main benefit of such a thing is that, today, if the default UA
> > focus ring style does not work well with your site's theme, you're
> > kinda screwed.  You can manually write a :focus rule, but you can't
> > predict when an element would have a focus ring drawn; you'll
> > unfortunately start drawing focus rings when the user mouse-clicks a
> > button.  Using :focus-ring instead does the right thing automatically,
> > triggering your styles only when the UA determines via heuristics that
> > it should draw a focus ring.
> >
> > (Those heuristics might not always be right, and that's part of my
> > continuing conversation with Alice and Brian, but that's separable
> > from this topic.)
> >
> > Thoughts?
>
> So, it's been a few months since I brought up this topic.  Any further
> thoughts or objections, or should I spec this?  If so, should it go
> into Selectors 4, or push off to Selectors 5?
>
> ~TJ
>
>
I'd still really love a way to opt in behavior for custom elements so that
authors can say 'treat this like you do X" or something, but I guess that
can be tackled later.  It seems relatively straightforward, and it's
obviously solving a very real and well documented problem that can't be
solved otherwise... Obviously I support getting this done sooner rather as
it immediately benefits the accessibility of any new development.


-- 
Brian Kardell :: @briankardell
Received on Thursday, 17 March 2016 13:38:00 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:09:01 UTC