1 Commits

Author SHA1 Message Date
Zoë Bijl 9ae713c083 [bugfix] make focus visible
Mastodon’s UI has been plagued with inaccessibility from the start. Removing the focus outline is one example of that. This is the start of fixing that. Removes all instances of `outline: 0 | none;`.

Next step is to add nicely styled focus outlines.
2025-10-10 01:07:35 +02:00
17 changed files with 2 additions and 171 deletions
@@ -52,7 +52,6 @@
} }
@mixin search-input() { @mixin search-input() {
outline: 0;
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
border: 0; border: 0;
@@ -164,10 +164,6 @@ body {
button { button {
font-family: inherit; font-family: inherit;
cursor: pointer; cursor: pointer;
&:focus {
outline: none;
}
} }
.app-holder { .app-holder {
@@ -178,7 +174,6 @@ button {
width: 100%; width: 100%;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
outline: 0 !important;
} }
& > noscript { & > noscript {
@@ -250,7 +245,6 @@ button {
margin: 0; margin: 0;
line-height: inherit; line-height: inherit;
cursor: pointer; cursor: pointer;
outline: 0;
transition: color 300ms linear; transition: color 300ms linear;
text-decoration: underline; text-decoration: underline;
@@ -753,7 +753,6 @@
font-size: 14px; font-size: 14px;
resize: none; resize: none;
border: 0; border: 0;
outline: 0;
border-radius: 4px; border-radius: 4px;
&::placeholder { &::placeholder {
@@ -260,10 +260,6 @@ $ui-header-height: 55px;
background: lighten($ui-base-color, 11%); background: lighten($ui-base-color, 11%);
} }
&:focus {
outline: 0;
}
&--transparent { &--transparent {
background: transparent; background: transparent;
color: $ui-secondary-color; color: $ui-secondary-color;
@@ -350,7 +346,6 @@ $ui-header-height: 55px;
cursor: pointer; cursor: pointer;
position: relative; position: relative;
z-index: 2; z-index: 2;
outline: 0;
overflow: hidden; overflow: hidden;
& > button { & > button {
@@ -377,11 +372,6 @@ $ui-header-height: 55px;
text-shadow: 0 0 10px rgba($ui-highlight-color, 0.4); text-shadow: 0 0 10px rgba($ui-highlight-color, 0.4);
} }
} }
&:focus,
&:active {
outline: 0;
}
} }
.column { .column {
@@ -743,10 +733,6 @@ $ui-header-height: 55px;
input { input {
width: 100%; width: 100%;
margin-bottom: 6px; margin-bottom: 6px;
&:focus {
outline: 0;
}
} }
} }
@@ -786,16 +772,6 @@ $ui-header-height: 55px;
color: lighten($darker-text-color, 4%); color: lighten($darker-text-color, 4%);
} }
&::-moz-focus-inner {
border: 0;
}
&::-moz-focus-inner,
&:focus,
&:active {
outline: 0 !important;
}
&:focus { &:focus {
background: lighten($ui-base-color, 4%); background: lighten($ui-base-color, 4%);
} }
@@ -50,7 +50,6 @@
border-radius: 4px; border-radius: 4px;
padding: 10px; padding: 10px;
width: 100%; width: 100%;
outline: 0;
color: $inverted-text-color; color: $inverted-text-color;
background: $simple-background-color; background: $simple-background-color;
font-size: 14px; font-size: 14px;
@@ -61,9 +60,6 @@
color: $dark-text-color; color: $dark-text-color;
} }
&:focus {
outline: 0;
}
@include single-column('screen and (max-width: 630px)') { @include single-column('screen and (max-width: 630px)') {
font-size: 16px; font-size: 16px;
} }
@@ -220,7 +216,6 @@
padding: 10px 32px 0 10px; padding: 10px 32px 0 10px;
width: 100%; width: 100%;
min-height: 100px; min-height: 100px;
outline: 0;
color: $inverted-text-color; color: $inverted-text-color;
background: $simple-background-color; background: $simple-background-color;
font-size: 14px; font-size: 14px;
@@ -236,10 +231,6 @@
all: unset; all: unset;
} }
&:focus {
outline: 0;
}
@include single-column('screen and (max-width: 630px)') { @include single-column('screen and (max-width: 630px)') {
font-size: 16px; font-size: 16px;
} }
@@ -670,7 +661,6 @@
&.active { &.active {
background: $ui-highlight-color; background: $ui-highlight-color;
color: $primary-text-color; color: $primary-text-color;
outline: 0;
.language-dropdown__dropdown__results__item__common-name { .language-dropdown__dropdown__results__item__common-name {
color: $secondary-text-color; color: $secondary-text-color;
@@ -77,7 +77,6 @@
&:focus, &:focus,
&:hover { &:hover {
outline: none;
background: lighten($ui-base-color, 3%); background: lighten($ui-base-color, 3%);
transition: background 200ms ease-out; transition: background 200ms ease-out;
} }
@@ -76,14 +76,8 @@
padding-bottom: 2px; padding-bottom: 2px;
padding-inline-start: 2px; padding-inline-start: 2px;
padding-inline-end: 5px; padding-inline-end: 5px;
outline: 0;
cursor: pointer; cursor: pointer;
&:active,
&:focus {
outline: 0 !important;
}
img { img {
filter: grayscale(100%); filter: grayscale(100%);
opacity: 0.8; opacity: 0.8;
@@ -123,16 +123,6 @@
border: 1px solid $ui-secondary-color; border: 1px solid $ui-secondary-color;
border-radius: 4px; border-radius: 4px;
&::-moz-focus-inner {
border: 0;
}
&::-moz-focus-inner,
&:focus,
&:active {
outline: 0 !important;
}
&::-webkit-search-cancel-button { &::-webkit-search-cancel-button {
display: none; display: none;
} }
@@ -60,7 +60,6 @@
border-bottom: 1px $ui-secondary-color solid; border-bottom: 1px $ui-secondary-color solid;
cursor: pointer; cursor: pointer;
text-decoration: none; text-decoration: none;
outline: none;
transition: background 0.3s; transition: background 0.3s;
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
@@ -454,10 +454,6 @@
height: 100% !important; height: 100% !important;
} }
&:focus {
outline: 0;
}
.detailed-status & { .detailed-status & {
width: 100%; width: 100%;
height: 100%; height: 100%;
@@ -483,7 +479,6 @@
max-height: 100% !important; max-height: 100% !important;
width: 100% !important; width: 100% !important;
height: 100% !important; height: 100% !important;
outline: 0;
} }
} }
@@ -590,7 +585,6 @@
.player-button { .player-button {
display: inline-block; display: inline-block;
outline: 0;
flex: 0 0 auto; flex: 0 0 auto;
background: transparent; background: transparent;
padding: 5px; padding: 5px;
@@ -198,16 +198,6 @@
transition: none; transition: none;
} }
&::-moz-focus-inner {
border: 0;
}
&::-moz-focus-inner,
&:focus,
&:active {
outline: 0 !important;
}
&.inverted { &.inverted {
color: $lighter-text-color; color: $lighter-text-color;
@@ -282,7 +272,6 @@
cursor: pointer; cursor: pointer;
padding: 0 3px; padding: 0 3px;
white-space: nowrap; white-space: nowrap;
outline: 0;
transition: all 100ms ease-in; transition: all 100ms ease-in;
transition-property: background-color, color; transition-property: background-color, color;
@@ -308,16 +297,6 @@
&.active { &.active {
color: $highlight-text-color; color: $highlight-text-color;
} }
&::-moz-focus-inner {
border: 0;
}
&::-moz-focus-inner,
&:focus,
&:active {
outline: 0 !important;
}
} }
body > [data-popper-placement] { body > [data-popper-placement] {
@@ -623,7 +602,6 @@ body > [data-popper-placement] {
&:hover, &:hover,
&:active { &:active {
background: var(--dropdown-border-color); background: var(--dropdown-border-color);
outline: 0;
} }
} }
} }
@@ -1038,7 +1016,6 @@ body > [data-popper-placement] {
background: transparent; background: transparent;
border: 0; border: 0;
border-bottom: 2px solid $ui-primary-color; border-bottom: 2px solid $ui-primary-color;
outline: 0;
box-sizing: border-box; box-sizing: border-box;
display: block; display: block;
font-family: inherit; font-family: inherit;
@@ -1195,12 +1172,8 @@ button.icon-button.active i.fa-retweet {
align-items: center; align-items: center;
} }
&:focus { &:focus.ckbox {
outline: 0 !important; box-shadow: 0 0 1px 1px $ui-highlight-color;
.ckbox {
box-shadow: 0 0 1px 1px $ui-highlight-color;
}
} }
} }
@@ -1523,7 +1496,6 @@ button.icon-button.active i.fa-retweet {
&:focus { &:focus {
background: lighten($ui-base-color, 2%); background: lighten($ui-base-color, 2%);
outline: 0;
} }
&__avatar { &__avatar {
@@ -693,17 +693,12 @@
line-height: 22px; line-height: 22px;
resize: vertical; resize: vertical;
border: 0; border: 0;
outline: 0;
border-radius: 4px; border-radius: 4px;
margin: 20px 0; margin: 20px 0;
&::placeholder { &::placeholder {
color: $dark-text-color; color: $dark-text-color;
} }
&:focus {
outline: 0;
}
} }
&__toggle { &__toggle {
@@ -821,7 +816,6 @@
font-family: inherit; font-family: inherit;
font-size: 14px; font-size: 14px;
resize: none; resize: none;
outline: 0;
border-radius: 4px; border-radius: 4px;
border: 1px solid $ui-secondary-color; border: 1px solid $ui-secondary-color;
min-height: 100px; min-height: 100px;
@@ -1019,7 +1013,6 @@
color: $inverted-text-color; color: $inverted-text-color;
display: inline-block; display: inline-block;
width: auto; width: auto;
outline: 0;
font-family: inherit; font-family: inherit;
background: $simple-background-color background: $simple-background-color
url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14.933 18.467' height='19.698' width='15.929'><path d='M3.467 14.967l-3.393-3.5H14.86l-3.392 3.5c-1.866 1.925-3.666 3.5-4 3.5-.335 0-2.135-1.575-4-3.5zm.266-11.234L7.467 0 11.2 3.733l3.733 3.734H0l3.733-3.734z' fill='#{hex-color(darken($simple-background-color, 14%))}'/></svg>") url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14.933 18.467' height='19.698' width='15.929'><path d='M3.467 14.967l-3.393-3.5H14.86l-3.392 3.5c-1.866 1.925-3.666 3.5-4 3.5-.335 0-2.135-1.575-4-3.5zm.266-11.234L7.467 0 11.2 3.733l3.733 3.734H0l3.733-3.734z' fill='#{hex-color(darken($simple-background-color, 14%))}'/></svg>")
@@ -1128,7 +1121,6 @@
} }
.embed-modal__html { .embed-modal__html {
outline: 0;
box-sizing: border-box; box-sizing: border-box;
display: block; display: block;
width: 100%; width: 100%;
@@ -1142,16 +1134,6 @@
margin-bottom: 15px; margin-bottom: 15px;
border-radius: 4px; border-radius: 4px;
&::-moz-focus-inner {
border: 0;
}
&::-moz-focus-inner,
&:focus,
&:active {
outline: 0 !important;
}
&:focus { &:focus {
background: lighten($ui-base-color, 4%); background: lighten($ui-base-color, 4%);
} }
@@ -1377,10 +1359,6 @@ img.modal-warning {
&::placeholder { &::placeholder {
color: lighten($darker-text-color, 4%); color: lighten($darker-text-color, 4%);
} }
&:focus {
outline: 0;
}
} }
.button { .button {
@@ -1477,7 +1455,6 @@ img.modal-warning {
overflow: hidden; overflow: hidden;
&:focus { &:focus {
outline: 0;
background: darken($ui-base-color, 4%); background: darken($ui-base-color, 4%);
} }
} }
@@ -107,37 +107,17 @@
color: lighten($darker-text-color, 4%); color: lighten($darker-text-color, 4%);
} }
&::-moz-focus-inner {
border: 0;
}
&::-moz-focus-inner,
&:focus,
&:active {
outline: 0 !important;
}
&:focus { &:focus {
background: lighten($ui-base-color, 4%); background: lighten($ui-base-color, 4%);
} }
} }
.search__icon { .search__icon {
&::-moz-focus-inner {
border: 0;
}
&::-moz-focus-inner,
&:focus {
outline: 0 !important;
}
.fa { .fa {
position: absolute; position: absolute;
top: 16px; top: 16px;
inset-inline-end: 10px; inset-inline-end: 10px;
display: inline-block; display: inline-block;
opacity: 0;
transition: all 100ms linear; transition: all 100ms linear;
transition-property: color, transform, opacity; transition-property: color, transform, opacity;
font-size: 18px; font-size: 18px;
@@ -57,10 +57,6 @@
padding-top: 5px; padding-top: 5px;
clear: both; clear: both;
&:focus {
outline: 0;
}
.emojione { .emojione {
width: 20px; width: 20px;
height: 20px; height: 20px;
@@ -213,7 +209,6 @@
.focusable { .focusable {
&:focus { &:focus {
outline: 0;
background: lighten($ui-base-color, 4%); background: lighten($ui-base-color, 4%);
&.status.status-direct { &.status.status-direct {
@@ -27,7 +27,6 @@
align-items: center; align-items: center;
color: $primary-text-color; color: $primary-text-color;
text-decoration: none; text-decoration: none;
outline: 0;
padding: 12px 16px; padding: 12px 16px;
line-height: 32px; line-height: 32px;
font-weight: 500; font-weight: 500;
@@ -432,7 +432,6 @@ code {
color: $primary-text-color; color: $primary-text-color;
display: block; display: block;
width: 100%; width: 100%;
outline: 0;
font-family: inherit; font-family: inherit;
resize: vertical; resize: vertical;
background: darken($ui-base-color, 10%); background: darken($ui-base-color, 10%);
@@ -535,7 +534,6 @@ code {
box-sizing: border-box; box-sizing: border-box;
cursor: pointer; cursor: pointer;
font-weight: 500; font-weight: 500;
outline: 0;
margin-bottom: 10px; margin-bottom: 10px;
margin-inline-end: 10px; margin-inline-end: 10px;
@@ -581,7 +579,6 @@ code {
color: $primary-text-color; color: $primary-text-color;
display: block; display: block;
width: 100%; width: 100%;
outline: 0;
font-family: inherit; font-family: inherit;
resize: vertical; resize: vertical;
background: darken($ui-base-color, 10%) background: darken($ui-base-color, 10%)
@@ -702,7 +699,6 @@ code {
} }
.oauth-code { .oauth-code {
outline: 0;
box-sizing: border-box; box-sizing: border-box;
display: block; display: block;
width: 100%; width: 100%;
@@ -714,16 +710,6 @@ code {
font-size: 14px; font-size: 14px;
margin: 0; margin: 0;
&::-moz-focus-inner {
border: 0;
}
&::-moz-focus-inner,
&:focus,
&:active {
outline: 0 !important;
}
&:focus { &:focus {
background: lighten($ui-base-color, 4%); background: lighten($ui-base-color, 4%);
} }
@@ -85,7 +85,6 @@
width: 100%; width: 100%;
font-size: 14px; font-size: 14px;
color: $inverted-text-color; color: $inverted-text-color;
outline: 0;
font-family: inherit; font-family: inherit;
background: $simple-background-color; background: $simple-background-color;
border: 1px solid darken($simple-background-color, 14%); border: 1px solid darken($simple-background-color, 14%);
@@ -139,16 +138,6 @@
border-color: $valid-value-color; border-color: $valid-value-color;
} }
&::-moz-focus-inner {
outline: 0 !important;
border: 0;
}
&:focus,
&:active {
outline: 0 !important;
}
&.disabled { &.disabled {
border-color: $dark-text-color; border-color: $dark-text-color;
@@ -285,7 +274,6 @@
color: $inverted-text-color; color: $inverted-text-color;
display: inline-block; display: inline-block;
width: auto; width: auto;
outline: 0;
font-family: inherit; font-family: inherit;
background: $simple-background-color background: $simple-background-color
url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14.933 18.467' height='19.698' width='15.929'><path d='M3.467 14.967l-3.393-3.5H14.86l-3.392 3.5c-1.866 1.925-3.666 3.5-4 3.5-.335 0-2.135-1.575-4-3.5zm.266-11.234L7.467 0 11.2 3.733l3.733 3.734H0l3.733-3.734z' fill='#{hex-color(darken($simple-background-color, 14%))}'/></svg>") url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14.933 18.467' height='19.698' width='15.929'><path d='M3.467 14.967l-3.393-3.5H14.86l-3.392 3.5c-1.866 1.925-3.666 3.5-4 3.5-.335 0-2.135-1.575-4-3.5zm.266-11.234L7.467 0 11.2 3.733l3.733 3.734H0l3.733-3.734z' fill='#{hex-color(darken($simple-background-color, 14%))}'/></svg>")