-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
TextTransformControl/TextDecorationControl: Balancing usability and accessibility #36735
Comments
Inspired by #31623 (comment), I think the most correct option would be to use We could make sure that, when the control is supposed to be "reset" (initial value, and ToolsPanel reset), the "None" option gets selected. Also pinging @jasmussen in case he had any feedback. |
@jasmussen: It's a good idea but we don't use a tools panel in Global Styles. We want to show Letter case in Global Styles for headings, see #34345 (comment). Any ideas on how to unset the value there? |
Right! I don't mean to be facetious with the following GIF showing that you can just click the toggled state to untoggle it again: I genuinely believe we shouldn't optimize too hard for reset buttons. Bold text you'd unset the same way, appearance you can set back to default, line-height you can select and delete. Reset buttons in an ellipsis (in the future) provide an additional affordance, but isn't the main affordance. |
@noisysocks What I understood was that we want to lean into the central reset mechanisms, which is this one in Global Styles: If we were to improve the flow, I think that menu button could be split into per-control resets instead of a whole panel rest. |
To implement this behaviour where you click to un-toggle we'd have to make the controls a group of buttons instead of a radio. This isn't great as a group of buttons doesn't convey that the options are mutually exclusive to folks who are using assistive technologies.
The Reset to defaults button resets all settings, no? I think it's too nuclear and could lead to user confusion/frustration. How do we all feel about @ciampo's suggestion as a solution for this in Global Styles?
Just a thought, but I wonder if we could have a "none" option in the radio control that is visually hidden but appears for assistive technology users? |
@jameskoster I feel like you've had some thoughts about a radio group with a minus reset button. |
I don't know if it's the right approach, but I lean towards building a UI which essentially replicates the CSS you'd write in order to achieve these things. As an example, if I set all headings to be uppercase, but there's one heading that I want to display as typed, then I would target that heading and declare So in this case, if we want to display the control regardless of whether a value is set, then we need:
For me, a |
I think it can be a good baseline to start from. One of the challenges here is we will very often have an additional state: unset. That is: no choice has been made. |
Going back to the 'replicate the code' concept, this would be equivalent to a style that has no |
The only gotcha there is in cases where we do want to surface the control by default, to aid discoverability. In that case, toggle-buttons allow the natural unset state by not having any toggled, whereas you can't go back to this untoggled state in a segmented control (similar to radios). |
True, but while discoverability is improved, there is still a confusing trade-off... For example with the Row block, the 'Block spacing' control is visible but contains no value, despite the canvas clearly demonstrating a gap: |
Yep, that loops right back into #43082! |
I wanted to flag this issue and my comment, as it raised the confusion of using the toggle group control and not being able to toggle an individual setting: #42766 (comment). One other thing -- text-decoration is a shorthand property, so you can add multiple values. Meaning you can set line-through and underline at the same time, they aren't mutually exclusive. https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration |
Great detective work. Yes, it seems like text-decoration needs an explicit none, and that it isn't enough to assume "none" is the default. |
Ah, that's a good point. It seems to me that Decoration should be a group of non mutually exclusive buttons and Letter case should be a radio with None as an option. Does that sound right to everyone? 😀 |
As a starting point, I'd love to just see an explicit none button at the start, perhaps just using the |
There has been some complications in finding the correct implementation for the
TextTransformControl
andTextDecorationControl
components (e.g. #26060 #31623). It seems like the difficulty is in making the implementation semantically correct, while also being intuitively usable for sighted users.Considered implementations
The options items are mutually exclusive, which makes them similar to a radio control. But we also want an intuitive way to reset the control, which is currently achieved by clicking the active item again. We can't implement this behavior onto a radio control because radio buttons are expected to be idempotent.
On the other hand, a mere array of buttons, even if
role="group"
ed, fails to semantically capture the mutual exclusivity of the options.Any ideas or thoughts? (cc @ciampo @diegohaz)
The text was updated successfully, but these errors were encountered: