Merge pull request #3294 from woocommerce/PCP-4277-conduct-an-accessibility-audit-and-compile-a-list-of-tasks-to-improve-the-accessibility-of-the-new-ui

Enhance the accessibility of the new Settings UI (4277)
This commit is contained in:
Emili Castells 2025-04-16 09:14:13 +02:00 committed by GitHub
commit a362780c8e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 268 additions and 58 deletions

View file

@ -70,6 +70,15 @@ button.components-button, a.components-button {
--button-disabled-color: #{$color-gray-100};
--button-disabled-background: #{$color-gray-500};
&:hover:not(:disabled) {
background: #{$color-blue};
}
&:not(.components-tab-panel__tabs-item):focus-visible:not(:disabled) {
outline: 2px solid #{$color-gray-500};
}
}
&.is-secondary {
@ -86,7 +95,7 @@ button.components-button, a.components-button {
--button-color: #{$color-blueberry};
--button-hover-color: #{$color-gradient-dark};
&:focus:not(:disabled) {
&:focus-visible:not(:disabled) {
border: none;
box-shadow: none;
}
@ -95,6 +104,16 @@ button.components-button, a.components-button {
&.small-button {
@include small-button;
}
&:focus:not(:disabled) {
outline: none;
}
&:focus-visible:not(:disabled),
&:not(.components-tab-panel__tabs-item):focus-visible:not(:disabled)
&[data-focus-visible="true"] {
outline: 2px solid #{$color-blueberry};
}
}
.ppcp--is-loading {

View file

@ -111,12 +111,7 @@
margin: 0;
}
}
// Custom styles.
.components-form-toggle.is-checked > .components-form-toggle__track {
background-color: $color-blueberry;
}
.ppcp-r-vertical-text-control {
.components-base-control__field {
display: flex;
@ -126,3 +121,74 @@
}
}
}
.ppcp-r-app, .ppcp-r-modal__container {
// Form toggle styling.
.components-form-toggle {
&.is-checked {
> .components-form-toggle__track {
background-color: $color-blueberry;
}
.components-form-toggle__track {
border-color: $color-blueberry;
}
}
.components-form-toggle__input {
&:focus {
+ .components-form-toggle__track {
box-shadow: none;
}
}
&:focus-visible + .components-form-toggle__track {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #fff,
0 0 0 calc(var(--wp-admin-border-width-focus)*2) $color-blueberry;
}
}
}
// Form inputs.
.components-text-control__input {
&:focus,
&[type="color"]:focus,
&[type="date"]:focus,
&[type="datetime-local"]:focus,
&[type="datetime"]:focus,
&[type="email"]:focus,
&[type="month"]:focus,
&[type="number"]:focus,
&[type="password"]:focus,
&[type="tel"]:focus,
&[type="text"]:focus,
&[type="time"]:focus,
&[type="url"]:focus,
&[type="week"]:focus {
border-color: $color-blueberry;
}
}
// Radio inputs.
.components-radio-control__input[type="radio"] {
&:checked {
background-color: $color-blueberry;
border-color: $color-blueberry;
}
&:focus {
box-shadow: none;
}
&:focus-visible {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #fff,
0 0 0 calc(var(--wp-admin-border-width-focus)*2) $color-blueberry;
}
}
// Checkbox inputs.
.components-checkbox-control__input[type="checkbox"] {
&:focus {
box-shadow: none;
}
&:focus-visible {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #fff,
0 0 0 calc(var(--wp-admin-border-width-focus)*2) $color-blueberry;
}
}
}

View file

@ -103,6 +103,11 @@ $margin_bottom: 48px;
.components-tab-panel__tabs-item {
height: var(--subnavigation-height);
&:focus-visible:not(:disabled),
&[data-focus-visible="true"]:focus:not(:disabled) {
outline: none;
}
}
}