Skip to content
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

a11y: Apply focus style to revision items #57039

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

.edit-site-global-styles-screen-revisions__revision-item {
position: relative;
padding-left: $grid-unit-20;
overflow: hidden;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to turn off overflow:hidden in order to display the focus outline correctly. From what I've tested, there doesn't seem to be any problem with removing this style, but if you have any problems please let me know.

cursor: pointer;

&:hover {
Expand All @@ -40,9 +38,20 @@
left: $grid-unit-20 + 1; // So the circle is centered on the line.
transform: translate(-50%, -50%);
z-index: 1;

// This border serves as a background color in Windows High Contrast mode.
border: 4px solid transparent;
}
&.is-selected::before {
background: var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
&.is-selected {
border-radius: $radius-block-ui;

// Only visible in Windows High Contrast mode.
outline: 3px solid transparent;
outline-offset: -2px;

&::before {
background: var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
}
}

&::after {
Expand All @@ -66,12 +75,10 @@
width: 100%;
height: auto;
display: block;
padding: $grid-unit-15 $grid-unit-15 $grid-unit-10 $grid-unit-30;
&:focus,
&:active {
outline: 0;
box-shadow: none;
}
padding: $grid-unit-15 $grid-unit-15 $grid-unit-10 $grid-unit-50;
z-index: 1;
position: relative;
Comment on lines +79 to +80
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this style, the focus outline would be hidden from the timeline line.

fcus-outline-overwrap

outline-offset: -2px;
}
}

Expand Down
Loading