Improve outline and radius for is-focused canvas#61367
Improve outline and radius for is-focused canvas#61367
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: +56 B (0%) Total Size: 1.74 MB
ℹ️ View Unchanged
|
| &.is-focused { | ||
| outline: calc(2 * var(--wp-admin-border-width-focus)) solid var(--wp-admin-theme-color); | ||
| outline-offset: calc(-2 * var(--wp-admin-border-width-focus)); | ||
| outline-width: var(--wp-admin-border-width-focus); |
There was a problem hiding this comment.
I think we should increase this width back to how it was before: calc(2 * var(--wp-admin-border-width-focus)). It's hard to notice it at the thinner width.
There was a problem hiding this comment.
I think we should increase this width back to how it was before:
calc(2 * var(--wp-admin-border-width-focus)). It's hard to notice it at the thinner width.
But we don't use that thicker focus anywhere else. This is the standard.
There was a problem hiding this comment.
The size of the thing that's being focused is the difference here. It's way too easy to miss with it wrapping something that takes up almost the entire page. I did a hallway test with my partner and she couldn't even see where the focus went with the thinner ring.
There was a problem hiding this comment.
I'd echo the instinct to avoid edge-cases on the variables. If we need more indications, potentially additional options are available, such as a stacked outline/halo, a shadow change outside the entire area itself. Unless the regression has been fixed, the scaling of the entire preview is also still missing.
Another benefit of using the variable is that we can add a toggle or even a stepped slider in the acccessibility settings of preferences to have thicker outlines. The variable would make that relatively trivial to do, since it's already uniformly applied across compontry for that specific reason.
There was a problem hiding this comment.
I'm fine with whatever approach allows for it to be clear that the canvas is selected. I'm not attached to the approach. The current thinner border isn't enough to communicate the canvas is focused.
There was a problem hiding this comment.
I agree the inset outline can be tricky to see, especially if the site background is in the same ballpark as the admin theme color. This is a TT4 style variation and it's basically invisible to my eye, even when zoomed in:
Could the outline be outset instead? I don't know if it breaks a11y rules, but this selector works:
.edit-site-layout__canvas:has(.is-focused) {}
There was a problem hiding this comment.
We can't use outset, in its current form at least, as it's hidden via overflow-hidden. Not sure if we can adjust where the focus is applied?
There was a problem hiding this comment.
We can't use outset, in its current form at least, as it's hidden via overflow-hidden
The selector I suggested targets the outer container (only when the button is focused), so is not hampered by overflow: hidden;. The idea is to apply the outline to that element instead.
|
Closing as inactive. |


What?
Fixing the is-focused style applied to the editor canvas when focused.
Why?
It looks broken in its current state. Now it's consistent as it can be with other focused elements. It's not displaced outside the frame as the current behavior is to apply overflow-hidden.
Testing Instructions
Screenshots or screencast
Before
After
|