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
Improve DevTools focus rings #7
Comments
This can be useful, but is not enough for an accessible focus style, because the hover style is too subtle. For keyboard focus, it’s best to also add a strongly contrasted outline (which can be implemented as a CSS outline, border or box-shadow). A possibly useful trick is to have all buttons use a 1px transparent border: .some-devtool-button {
border: solid 1px transparent;
border-radius: 3px;
padding: 2px 4px;
}
.some-devtool-button:-moz-focusring {
border-color: blue;
} |
In the debugger and i believe the toolbox, we only show the focus ring on key down. We do not show it on mouse down. I think this is a nice pattern that other tools could benefit from. |
Hi. Which one would be the good focus ring? |
The Photon design system defines focus styles for buttons as: box-shadow: 0 0 0 1px #0a84ff inset, 0 0 0 1px #0a84ff, 0 0 0 4px rgba(10, 132, 255, 0.3) We could use this style, but Photon elements are often 50% bigger than DevTools elements. So maybe we need to adapt it. Personally, I would love it if each interactive element could have a 1px border (transparent by default, if the design doesn't use a border). This would enable us to do:
That would be cool, but I'm not sure a high contrast theme is on the books. So implementing with an inset box-shadow (1px) and an "outset" partial opacity box-shadow (1px or 2px) could be okay. |
OK. Sooo. Do I start hacking around and put a PoC here? Shall I create a bug for every instance of inputs with the wrong focus (that would be madness IMHO) Also I realize that ie RDM styles are totally isolated from other tools. But in the inspector the changes I tried with other bug affected the settings.... |
The code is the documentation. ;) Some stylesheets are generic and loaded in most all contexts, including:
Some stylesheets are loaded only by a given tool, they can be in the |
The current situation is that there are a lot of different ways that focus styles are applied, with many different styles; sometimes no focus styles are applied at all for some interactive elements (which is an accessibility bug); and often those focus styles are applied on clicks, which we would like to prevent (see Dealing with sticky focus styles for a general explanation, and :-moz-focusring for a way we could implement that in DevTools). We still need to define the exact behavior and look we want to achieve, but a proof-of-concept implementation would help seeing an improved behavior and look in action, so that we can create a clear guideline. So the next step could be:
Steps 2 and 3 also depend on project management decisions. We should not go off and define a large change and open 30 bugs or more without input and some sort of sign-off. ^^ @violasong Does this plan sound good to you? @aburone I think you can start working on step 1 if you're interested; I would suggest working on the Network monitor for the proof of concept, and focus on 3 areas: the top toolbar, the "no requests" view, and the request table (excluding the request details that appear on the right when selecting a row). This gives us plenty of different use cases: buttons that touch their container's sides, buttons that are offset from the toolbar's sides, text input that takes the full toolbar height, select buttons, table headers, table rows, etc. For this POC I would recommend creating a new stylesheet to load in the netmonitor iframe, and trying to override existing styles if needed. |
Perfect. When I have something to show, shall I upload a patch in a bug report? Or is there another preferred way? |
I think you can create a bug, e.g. "Explore new focus ring styles in Netmonitor", and reference this issue. |
Florens I created a html file with the basic idea and the different triggers. Let me know how far away of the mark I've got so I can create a better PoC in the actual devtools. |
Nice, I've commented on bugzilla. Let's try to make progress there for now. |
Hi @aburone and @fvsch, I'm so happy to see you working on this bug and I would really like to help more with this. I'm currently needing to focus on some tight deadlines coming up so I can't think about this much right now. I'm happy to go with Florens' plan and jump back in with feedback sometime next week when I'm able to. Thanks so much! |
We have a design proposal ready for review at https://bugzilla.mozilla.org/show_bug.cgi?id=1502098#c16 |
Discussed at All Hands with @violasong and :yzen. Main decisions:
One way to go forward is to prototype implementing the new styles and the |
DevTools focus rings that need UX help:
DevTools focus rings (UX solved, some implementation needed):
Design System
Examples of Firefox focus rings
It's pretty messy right now but useful for inspiration
The text was updated successfully, but these errors were encountered: