-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Focus Outline Color #166
Comments
Could this also include |
@jelbourn Does that solve your issue? |
Not quite- this is secondhand from Google's Material Design folks, but apparently there are situations where they'd like the focus ring to have a different radius than the element itself. |
Is |
It doesn't seem so. @jelbourn Google's Material Design folks should contact the CSS WG or someone from Google in the CSSWG. Maybe that could clarify the perimeter of the issue. |
there used to be |
Since today is the last day to refine proposals, let's make it final that |
I meant to ask about this last week, but the goal here is specifically how form elements have their outline rendered when they have focus? Because the majority of tests linked above don't have anything to do with focus. (And, e.g., outline-005.html fails in STP 156 because the outline doesn't follow border-radius, even if it does follow the edge of form controls). |
specifically about "i just want to change the color" and not get side effects |
@argyleink I believe this is just w3c/csswg-drafts#7761? Firefox follows |
I see, can confirm that |
@argyleink that is expected, to guarantee contrast regardless of the background. That's the only difference in Firefox between |
yeah, i get why, but is it conditional, like only doubled up if it's not passing? or it's just always a double as a catch all? |
It's always double, the alternative color is the "accent foreground" color, which is usually white, but can be a darkened version of the accent color if it's too light. It's basically whatever color the checkbox checkmark etc are. |
In the State of CSS 2022 question about browser incompatibilities, there were 13 responses categorized as
These two about focus might also be pointing at the same issue:
This wasn't enough to make the top list in #248, but I'd consider it a medium strength signal since a bunch of comments point to a specific problem. |
None of these are about focus outlines, though, are they? They're just about the behaviour of outline in general. See my question about scope above. |
@gsnedders I'm not especially familiar with this, but assumed that <!DOCTYPE html>
<style>
input:focus {
outline: 3px solid blue;
}
</style>
<input value="hello"> Whether the comments from State of CSS are about focus outlines or other uses of outlines is hard to say, but since they mention radius and many focusable things have rounded corners, it's not very far fetched. Is the scope of this proposal still unclear though? If so I'm sure @argyleink will be happy to clarify. |
In the MDN short survey on CSS & HTML, "CSS |
most of the comments you shared about outlines were about the shape of the outline following the shape of the element that's in focus. there was previously poor interop here on this behavior, but it's been remedied. BUT, that being said, changing the color of the outline shouldnt revert the shape following behavior to the previous behavior (where the shape of the element was ignored). that's what this issue is about, that change the color of it shouldnt effect the shape. there was a lot of fanfare once outlines follow element shape (they're ugly when they dont follow), but if we want that shape apparently we can't change the color because it forces paint down the old code path. hence the term side effects in the description: i changed the color but for some reason got a shape change. |
It's still unclear what this proposal is about. |
Are we to assume that this proposal is only about Are there any tests for |
I'd prefer it stays scoped that way yeah
There are some, but I don't see any narrowly-scoped tests for |
Thanks for your response, Adam. We are wondering if this is in fact testable, since it's deeply affected by operating system & context. |
Is this a to-do list of two items, or three items?
Is there something for browsers to do for 3? Or are you just listing the suboptimal consequence of not doing 1 & 2? @argyleink |
I think that's a fair view of bullet 3 yeah 👍🏻 |
Thank you for proposing Focus Outline for inclusion in Interop 2023. We wanted to let you know that this proposal was not selected to be part of Interop this year. We had many strong proposals, and could not accept them all. This should not be taken as a comment on the technology as a whole, and resubmitting a proposal for this feature as part of a future round of Interop would be welcome. For an overview of our process, see the proposal selection summary. Thank you again for contributing to Interop 2023! Posted on behalf of the Interop team. |
Description
There are 3 areas that could use interop attention:
outline-color
alone change the outline. Firefox and Safari ignore the color request and continue drawing their default outline stylesoutline-color
should allow the value ofinvert
and only Firefox handles that correctly per spec, it does this by using currentColoroutline-style
, which has the side effect of no longer matching the border radius of the focused elementRationale
There was a lot of positive developer feedback when Chrome aligned with Firefox and Safari on making the outline follow the shape of the element. This meant no more
box-shadow
focus outlines were needed anymore.. mostly. Recently I did a dive into the cross browser customization of this nice shapes focus outline, and found some issues that I've listed above in the description. I still see thebox-shadow
"hack" in the wild, like in this material component or this article. It's my understanding that these box-shadow solutions don't work for forced color modes or high contrast modes.Half of the great work is done, having the outline follow the element shape, but it's a big bummer that attempts to customize the color to match a brand means losing the shape. We want people using the built in focus indicator.
Specification
https://www.w3.org/TR/css-ui-4/#outline-props
Tests
https://wpt.fyi/results/css/css-ui?label=master&aligned&view=subtest&q=outline
The text was updated successfully, but these errors were encountered: