Skip to content

Commit

Permalink
a11y: Apply focus style to revision items
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Dec 14, 2023
1 parent 2fb3c57 commit 7758fdf
Showing 1 changed file with 17 additions and 10 deletions.
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;
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;
outline-offset: -2px;
}
}

Expand Down

0 comments on commit 7758fdf

Please sign in to comment.