Skip to content

Commit

Permalink
Keyboard focus indicator changes #1321
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmcburnie committed Jan 12, 2021
1 parent 9475281 commit 570adff
Show file tree
Hide file tree
Showing 75 changed files with 552 additions and 75 deletions.
9 changes: 9 additions & 0 deletions dist/breadcrumbs/ds4/breadcrumbs.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ nav.breadcrumbs button[aria-current] {
color: var(--breadcrumbs-item-current-foreground-color, #767676);
text-decoration: none;
}
nav.breadcrumbs a:focus,
nav.breadcrumbs button:focus {
outline: 1px auto #767676;
outline-offset: 1px;
}
nav.breadcrumbs a:focus:not(:focus-visible),
nav.breadcrumbs button:focus:not(:focus-visible) {
outline: none;
}
@media (min-width: 601px) {
nav.breadcrumbs {
margin: 16px 0;
Expand Down
9 changes: 9 additions & 0 deletions dist/breadcrumbs/ds6/breadcrumbs.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ nav.breadcrumbs button[aria-current] {
color: var(--breadcrumbs-item-current-foreground-color, #767676);
text-decoration: none;
}
nav.breadcrumbs a:focus,
nav.breadcrumbs button:focus {
outline: 1px auto #767676;
outline-offset: 1px;
}
nav.breadcrumbs a:focus:not(:focus-visible),
nav.breadcrumbs button:focus:not(:focus-visible) {
outline: none;
}
@media (min-width: 601px) {
nav.breadcrumbs {
margin: 16px 0;
Expand Down
9 changes: 9 additions & 0 deletions dist/button/ds4/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ a.fake-btn--truncated span {
text-overflow: ellipsis;
white-space: nowrap;
}
button.btn:focus,
a.fake-btn:focus {
outline: 1px auto #767676;
outline-offset: 2px;
}
button.btn:focus:not(:focus-visible),
a.fake-btn:focus:not(:focus-visible) {
outline: none;
}
button.btn--wide,
a.fake-btn--wide {
padding-left: 48px;
Expand Down
9 changes: 9 additions & 0 deletions dist/button/ds6/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ a.fake-btn--truncated span {
text-overflow: ellipsis;
white-space: nowrap;
}
button.btn:focus,
a.fake-btn:focus {
outline: 1px auto #767676;
outline-offset: 2px;
}
button.btn:focus:not(:focus-visible),
a.fake-btn:focus:not(:focus-visible) {
outline: none;
}
button.btn--wide,
a.fake-btn--wide {
padding-left: 48px;
Expand Down
14 changes: 14 additions & 0 deletions dist/carousel/ds4/carousel.css
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ div.carousel {
color: #333;
color: var(--carousel-paddle-foreground-color, #333);
}
.carousel__control:focus {
outline: 1px auto #767676;
outline-offset: 2px;
}
.carousel__control:focus:not(:focus-visible) {
outline: none;
}
@media (min-width: 601px) {
.carousel:focus-within .carousel__control {
opacity: 0.92;
Expand Down Expand Up @@ -152,6 +159,13 @@ div.carousel {
.carousel__control:active {
background-color: #333;
}
.carousel__playback:focus {
outline: 1px auto #767676;
outline-offset: 1px;
}
.carousel__playback:focus:not(:focus-visible) {
outline: none;
}
span.carousel,
span.carousel__container {
display: inline-block;
Expand Down
14 changes: 14 additions & 0 deletions dist/carousel/ds6/carousel.css
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ div.carousel {
color: #111820;
color: var(--carousel-paddle-foreground-color, #111820);
}
.carousel__control:focus {
outline: 1px auto #767676;
outline-offset: 2px;
}
.carousel__control:focus:not(:focus-visible) {
outline: none;
}
@media (min-width: 601px) {
.carousel:focus-within .carousel__control {
opacity: 0.92;
Expand Down Expand Up @@ -160,6 +167,13 @@ div.carousel {
.carousel__control:active {
background-color: #414141;
}
.carousel__playback:focus {
outline: 1px auto #767676;
outline-offset: 1px;
}
.carousel__playback:focus:not(:focus-visible) {
outline: none;
}
span.carousel,
span.carousel__container {
display: inline-block;
Expand Down
10 changes: 7 additions & 3 deletions dist/checkbox/ds4/checkbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,16 @@ input.checkbox__control[type="checkbox"]:checked + span.checkbox__icon svg.check
input.checkbox__control[type="checkbox"]:checked + span.checkbox__icon svg.checkbox__unchecked {
display: none;
}
input.checkbox__control[type="checkbox"]:focus + span.checkbox__icon {
outline: 1px dotted #767676;
}
input.checkbox__control[type="checkbox"][disabled] + span.checkbox__icon {
opacity: 1;
}
input.checkbox__control[type="checkbox"][disabled] + span.checkbox__icon svg {
fill: #ccc;
}
input.checkbox__control[type="checkbox"]:focus + span.checkbox__icon {
outline: 1px auto #767676;
outline-offset: 2px;
}
input.checkbox__control[type="checkbox"]:focus:not(:focus-visible) + span.checkbox__icon {
outline: none;
}
10 changes: 7 additions & 3 deletions dist/checkbox/ds6/checkbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,16 @@ input.checkbox__control[type="checkbox"]:checked + span.checkbox__icon svg.check
input.checkbox__control[type="checkbox"]:checked + span.checkbox__icon svg.checkbox__unchecked {
display: none;
}
input.checkbox__control[type="checkbox"]:focus + span.checkbox__icon {
outline: 1px dotted #767676;
}
input.checkbox__control[type="checkbox"][disabled] + span.checkbox__icon {
opacity: 1;
}
input.checkbox__control[type="checkbox"][disabled] + span.checkbox__icon svg {
fill: #c7c7c7;
}
input.checkbox__control[type="checkbox"]:focus + span.checkbox__icon {
outline: 1px auto #767676;
outline-offset: 2px;
}
input.checkbox__control[type="checkbox"]:focus:not(:focus-visible) + span.checkbox__icon {
outline: none;
}
7 changes: 7 additions & 0 deletions dist/cta-button/ds4/cta-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ a.cta-btn--truncated span {
text-overflow: ellipsis;
white-space: nowrap;
}
a.cta-btn:focus {
outline: 1px auto #767676;
outline-offset: 2px;
}
a.cta-btn:focus:not(:focus-visible) {
outline: none;
}
a.cta-btn:visited {
color: #333;
color: var(--cta-button-visited-foreground-color, #333);
Expand Down
7 changes: 7 additions & 0 deletions dist/cta-button/ds6/cta-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ a.cta-btn--truncated span {
text-overflow: ellipsis;
white-space: nowrap;
}
a.cta-btn:focus {
outline: 1px auto #767676;
outline-offset: 2px;
}
a.cta-btn:focus:not(:focus-visible) {
outline: none;
}
a.cta-btn:visited {
color: #111820;
color: var(--cta-button-visited-foreground-color, #111820);
Expand Down
6 changes: 6 additions & 0 deletions dist/details/ds4/details.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,9 @@ details.details[open] span.details__icon {
details.details[open] summary.details__summary::before {
content: none;
}
details.details summary:focus {
outline: 1px auto #767676;
}
details.details summary:focus:not(:focus-visible) {
outline: none;
}
6 changes: 6 additions & 0 deletions dist/details/ds6/details.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,9 @@ details.details[open] span.details__icon {
details.details[open] summary.details__summary::before {
content: none;
}
details.details summary:focus {
outline: 1px auto #767676;
}
details.details summary:focus:not(:focus-visible) {
outline: none;
}
6 changes: 6 additions & 0 deletions dist/drawer-dialog/ds4/drawer-dialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,9 @@ button.drawer-dialog__close {
-webkit-transform: translateX(0);
transform: translateX(0);
}
.drawer-dialog__handle:focus {
outline: 1px auto #767676;
}
.drawer-dialog__handle:focus:not(:focus-visible) {
outline: none;
}
6 changes: 6 additions & 0 deletions dist/drawer-dialog/ds6/drawer-dialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,9 @@ button.drawer-dialog__close {
-webkit-transform: translateX(0);
transform: translateX(0);
}
.drawer-dialog__handle:focus {
outline: 1px auto #767676;
}
.drawer-dialog__handle:focus:not(:focus-visible) {
outline: none;
}
7 changes: 7 additions & 0 deletions dist/expand-button/ds4/expand-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ button.expand-btn--truncated span {
text-overflow: ellipsis;
white-space: nowrap;
}
button.expand-btn:focus {
outline: 1px auto #767676;
outline-offset: 2px;
}
button.expand-btn:focus:not(:focus-visible) {
outline: none;
}
button.expand-btn:hover,
button.expand-btn:focus {
border-color: #00489f;
Expand Down
7 changes: 7 additions & 0 deletions dist/expand-button/ds6/expand-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ button.expand-btn--truncated span {
text-overflow: ellipsis;
white-space: nowrap;
}
button.expand-btn:focus {
outline: 1px auto #767676;
outline-offset: 2px;
}
button.expand-btn:focus:not(:focus-visible) {
outline: none;
}
button.expand-btn:hover,
button.expand-btn:focus {
border-color: #2b0eaf;
Expand Down
11 changes: 11 additions & 0 deletions dist/filter-button/ds4/filter-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,14 @@ a.filter-link--selected:not([href]):hover,
a.filter-link--selected[aria-disabled="true"]:hover {
background-color: #dbeafe;
}
/* stylelint-disable no-descending-specificity */
button.filter-button:focus,
a.filter-link:focus {
outline: 1px auto #767676;
outline-offset: 2px;
}
button.filter-button:focus:not(:focus-visible),
a.filter-link:focus:not(:focus-visible) {
outline: none;
}
/* stylelint-enable no-descending-specificity */
11 changes: 11 additions & 0 deletions dist/filter-button/ds6/filter-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,14 @@ a.filter-link--selected:not([href]):hover,
a.filter-link--selected[aria-disabled="true"]:hover {
background-color: #e1e8fd;
}
/* stylelint-disable no-descending-specificity */
button.filter-button:focus,
a.filter-link:focus {
outline: 1px auto #767676;
outline-offset: 2px;
}
button.filter-button:focus:not(:focus-visible),
a.filter-link:focus:not(:focus-visible) {
outline: none;
}
/* stylelint-enable no-descending-specificity */
4 changes: 4 additions & 0 deletions dist/global/ds4/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ a:hover {
color: #00489f;
color: var(--color-link-hover, #00489f);
}
a:focus {
outline: 1px auto #767676;
outline-offset: 2px;
}
4 changes: 4 additions & 0 deletions dist/global/ds6/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ a:hover {
color: #2b0eaf;
color: var(--color-link-hover, #2b0eaf);
}
a:focus {
outline: 1px auto #767676;
outline-offset: 2px;
}
8 changes: 8 additions & 0 deletions dist/icon-button/ds4/icon-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,11 @@ button.img-btn:not([disabled]):focus {
button.img-btn:not([disabled]):active {
border-color: #767676;
}
button.icon-btn:focus,
a.icon-link:focus {
outline: 1px auto #767676;
}
button.icon-btn:focus:not(:focus-visible),
a.icon-link:focus:not(:focus-visible) {
outline: none;
}
8 changes: 8 additions & 0 deletions dist/icon-button/ds6/icon-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,11 @@ button.img-btn:not([disabled]):focus {
button.img-btn:not([disabled]):active {
border-color: #767676;
}
button.icon-btn:focus,
a.icon-link:focus {
outline: 1px auto #767676;
}
button.icon-btn:focus:not(:focus-visible),
a.icon-link:focus:not(:focus-visible) {
outline: none;
}
6 changes: 6 additions & 0 deletions dist/listbox-button/ds4/listbox-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,9 @@ span.listbox-button__value {
-webkit-box-flex: 1;
flex: 1 0 auto;
}
.listbox-button__options:focus {
outline: 1px auto #767676;
}
.listbox-button__options:focus:not(:focus-visible) {
outline: none;
}
6 changes: 6 additions & 0 deletions dist/listbox-button/ds6/listbox-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,9 @@ span.listbox-button__value {
-webkit-box-flex: 1;
flex: 1 0 auto;
}
.listbox-button__options:focus {
outline: 1px auto #767676;
}
.listbox-button__options:focus:not(:focus-visible) {
outline: none;
}
6 changes: 6 additions & 0 deletions dist/listbox/ds4/listbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,9 @@ div.listbox__option[role="option"]:active svg.icon {
color: #ccc;
color: var(--dropdown-item-active-status-color, #ccc);
}
.listbox__options:focus {
outline: 1px auto #767676;
}
.listbox__options:focus:not(:focus-visible) {
outline: none;
}
6 changes: 6 additions & 0 deletions dist/listbox/ds6/listbox.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,9 @@ div.listbox__option[role="option"]:active svg.icon {
color: #fff;
color: var(--dropdown-item-active-status-color, #fff);
}
.listbox__options:focus {
outline: 1px auto #767676;
}
.listbox__options:focus:not(:focus-visible) {
outline: none;
}
6 changes: 6 additions & 0 deletions dist/menu-button/ds4/menu-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,9 @@ hr.menu-button__separator {
border-width: 1px;
margin: 0;
}
div.menu-button__item[role^="menuitem"]:focus {
outline: 1px auto #767676;
}
div.menu-button__item[role^="menuitem"]:focus:not(:focus-visible) {
outline: none;
}
6 changes: 6 additions & 0 deletions dist/menu-button/ds6/menu-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,9 @@ hr.menu-button__separator {
border-width: 1px;
margin: 0;
}
div.menu-button__item[role^="menuitem"]:focus {
outline: 1px auto #767676;
}
div.menu-button__item[role^="menuitem"]:focus:not(:focus-visible) {
outline: none;
}
6 changes: 6 additions & 0 deletions dist/menu/ds4/menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,9 @@ hr.menu__separator {
border-style: solid;
border-width: 1px;
}
div.menu__item[role^="menuitem"]:focus {
outline: 1px auto #767676;
}
div.menu__item[role^="menuitem"]:focus:not(:focus-visible) {
outline: none;
}
Loading

0 comments on commit 570adff

Please sign in to comment.