Fix issues with inhibited accessible focus outlines (#10579)

pull/28217/head
Michael Telatynski 2023-04-12 13:49:12 +01:00 committed by GitHub
parent ec83855938
commit 287a3fd0cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 37 additions and 209 deletions

View File

@ -535,6 +535,27 @@ legend {
} }
} }
@define-mixin mx_DialogButton {
/* align images in buttons (eg spinners) */
vertical-align: middle;
border: 0px;
border-radius: 8px;
font-family: $font-family;
font-size: $font-14px;
color: $button-fg-color;
background-color: $accent;
width: auto;
padding: 7px;
padding-left: 1.5em;
padding-right: 1.5em;
cursor: pointer;
display: inline-block;
&:not(.focus-visible) {
outline: none;
}
}
/* XXX: Our button style are a mess: buttons that happen to appear in dialogs get special styles applied /* XXX: Our button style are a mess: buttons that happen to appear in dialogs get special styles applied
* to them that no button anywhere else in the app gets by default. In practice, buttons in other places * to them that no button anywhere else in the app gets by default. In practice, buttons in other places
* in the app look the same by being AccessibleButtons, or possibly by having explict button classes. * in the app look the same by being AccessibleButtons, or possibly by having explict button classes.
@ -565,13 +586,6 @@ legend {
margin-right: 0px; margin-right: 0px;
} }
.mx_Dialog button:not(.mx_Dialog_nonDialogButton):not([class|="maplibregl"]):not(.mx_AccessibleButton):hover,
.mx_Dialog input[type="submit"]:hover,
.mx_Dialog_buttons button:not(.mx_Dialog_nonDialogButton):not(.mx_AccessibleButton):hover,
.mx_Dialog_buttons input[type="submit"]:hover {
@mixin mx_DialogButton_hover;
}
.mx_Dialog button:not(.mx_Dialog_nonDialogButton):not([class|="maplibregl"]):not(.mx_AccessibleButton):focus, .mx_Dialog button:not(.mx_Dialog_nonDialogButton):not([class|="maplibregl"]):not(.mx_AccessibleButton):focus,
.mx_Dialog input[type="submit"]:focus, .mx_Dialog input[type="submit"]:focus,
.mx_Dialog_buttons button:not(.mx_Dialog_nonDialogButton):not(.mx_AccessibleButton):focus, .mx_Dialog_buttons button:not(.mx_Dialog_nonDialogButton):not(.mx_AccessibleButton):focus,
@ -643,10 +657,6 @@ legend {
margin: auto; margin: auto;
} }
.mx_GeneralButton:hover {
@mixin mx_DialogButton_hover;
}
.mx_linkButton { .mx_linkButton {
cursor: pointer; cursor: pointer;
color: $accent; color: $accent;
@ -666,12 +676,14 @@ legend {
background-color: $background; background-color: $background;
} }
.mx_textButton { @define-mixin mx_DialogButton_small {
@mixin mx_DialogButton_small; @mixin mx_DialogButton;
font-size: $font-15px;
padding: 0px 1.5em 0px 1.5em;
} }
.mx_textButton:hover { .mx_textButton {
@mixin mx_DialogButton_hover; @mixin mx_DialogButton_small;
} }
.mx_button_row { .mx_button_row {
@ -874,3 +886,8 @@ legend {
} }
} }
} }
@define-mixin mx_Dialog_link {
color: $accent;
text-decoration: none;
}

View File

@ -26,10 +26,6 @@ limitations under the License.
text-align: center; text-align: center;
} }
.mx_Login_submit:hover {
@mixin mx_DialogButton_hover;
}
.mx_Login_submit:disabled { .mx_Login_submit:disabled {
opacity: 0.3; opacity: 0.3;
cursor: default; cursor: default;

View File

@ -18,9 +18,8 @@ limitations under the License.
margin-top: 15px; margin-top: 15px;
.mx_CreateRoomDialog_details_summary { .mx_CreateRoomDialog_details_summary {
outline: none;
list-style: none; list-style: none;
font-weight: 600; font-weight: $font-semi-bold;
cursor: pointer; cursor: pointer;
color: $accent; color: $accent;
@ -28,6 +27,10 @@ limitations under the License.
&::-webkit-details-marker { &::-webkit-details-marker {
display: none; display: none;
} }
&:not(.focus-visible) {
outline: none;
}
} }
> div { > div {

View File

@ -74,10 +74,6 @@ limitations under the License.
margin-top: -5px; margin-top: -5px;
} }
.mx_RoomHeader_textButton:hover {
@mixin mx_DialogButton_hover;
}
.mx_RoomHeader_textButton_danger { .mx_RoomHeader_textButton_danger {
background-color: $alert; background-color: $alert;
} }

View File

@ -238,44 +238,6 @@ $selected-color: $room-highlight-color;
} }
/* ******************** */ /* ******************** */
/* Mixins */
/* ******************** */
@define-mixin mx_DialogButton {
/* align images in buttons (eg spinners) */
vertical-align: middle;
border: 0px;
border-radius: 8px;
font-family: $font-family;
font-size: $font-14px;
color: $button-fg-color;
background-color: $accent;
width: auto;
padding: 7px;
padding-left: 1.5em;
padding-right: 1.5em;
cursor: pointer;
display: inline-block;
outline: none;
}
@define-mixin mx_DialogButton_danger {
background-color: $accent;
}
@define-mixin mx_DialogButton_secondary {
/* flip colours for the secondary ones */
font-weight: 600;
border: 1px solid $accent !important;
color: $accent;
background-color: $button-secondary-bg-color;
}
@define-mixin mx_Dialog_link {
color: $accent;
text-decoration: none;
}
/* ******************** */
body { body {
color-scheme: dark; color-scheme: dark;
} }

View File

@ -212,43 +212,6 @@ $location-live-secondary-color: #deddfd;
$live-badge-color: #ffffff; $live-badge-color: #ffffff;
/* ******************** */ /* ******************** */
/* ***** Mixins! ***** */
@define-mixin mx_DialogButton {
/* align images in buttons (eg spinners) */
vertical-align: middle;
border: 0px;
border-radius: 8px;
font-family: $font-family;
font-size: $font-14px;
color: $button-fg-color;
background-color: $accent;
width: auto;
padding: 7px;
padding-left: 1.5em;
padding-right: 1.5em;
cursor: pointer;
display: inline-block;
outline: none;
}
@define-mixin mx_DialogButton_danger {
background-color: $accent;
}
@define-mixin mx_DialogButton_secondary {
/* flip colours for the secondary ones */
font-weight: 600;
border: 1px solid $accent !important;
color: $accent;
background-color: $button-secondary-bg-color;
}
@define-mixin mx_Dialog_link {
color: $accent;
text-decoration: none;
}
body { body {
color-scheme: dark; color-scheme: dark;
} }

View File

@ -317,52 +317,6 @@ $location-live-secondary-color: #deddfd;
$live-badge-color: #ffffff; $live-badge-color: #ffffff;
/* ******************** */ /* ******************** */
/* ***** Mixins! ***** */
@define-mixin mx_DialogButton {
/* align images in buttons (eg spinners) */
vertical-align: middle;
border: 0px;
border-radius: 8px;
font-family: $font-family;
font-size: $font-14px;
color: $button-fg-color;
background-color: $accent;
width: auto;
padding: 7px;
padding-left: 1.5em;
padding-right: 1.5em;
cursor: pointer;
display: inline-block;
outline: none;
}
@define-mixin mx_DialogButton_hover {
}
@define-mixin mx_DialogButton_danger {
background-color: $accent;
}
@define-mixin mx_DialogButton_small {
@mixin mx_DialogButton;
font-size: $font-15px;
padding: 0px 1.5em 0px 1.5em;
}
@define-mixin mx_DialogButton_secondary {
/* flip colours for the secondary ones */
font-weight: 600;
border: 1px solid $accent !important;
color: $accent;
background-color: $button-secondary-bg-color;
}
@define-mixin mx_Dialog_link {
color: $accent;
text-decoration: none;
}
body { body {
color-scheme: light; color-scheme: light;
} }

View File

@ -34,23 +34,6 @@ $appearance-tab-border-color: $input-darker-bg-color;
$eventbubble-reply-color: $quaternary-content; $eventbubble-reply-color: $quaternary-content;
$roomtopic-color: $secondary-content; $roomtopic-color: $secondary-content;
@define-mixin mx_DialogButton_danger {
background-color: $accent;
}
@define-mixin mx_DialogButton_secondary {
/* flip colours for the secondary ones */
font-weight: 600;
border: 1px solid $accent !important;
color: $accent;
background-color: $button-secondary-bg-color;
}
@define-mixin mx_Dialog_link {
color: $accent;
text-decoration: none;
}
/* Draw an outline on buttons with focus */ /* Draw an outline on buttons with focus */
.mx_AccessibleButton:focus { .mx_AccessibleButton:focus {
outline: 2px solid $accent; outline: 2px solid $accent;

View File

@ -336,52 +336,6 @@ $location-live-secondary-color: #deddfd;
$live-badge-color: #ffffff; $live-badge-color: #ffffff;
/* ******************** */ /* ******************** */
/* Mixins */
/* ******************** */
@define-mixin mx_DialogButton {
/* align images in buttons (eg spinners) */
vertical-align: middle;
border: 0px;
border-radius: 8px;
font-family: $font-family;
font-size: $font-14px;
color: $button-fg-color;
background-color: $accent;
width: auto;
padding: 7px;
padding-left: 1.5em;
padding-right: 1.5em;
cursor: pointer;
display: inline-block;
outline: none;
}
@define-mixin mx_DialogButton_hover {
}
@define-mixin mx_DialogButton_danger {
background-color: $accent;
}
@define-mixin mx_DialogButton_small {
@mixin mx_DialogButton;
font-size: $font-15px;
padding: 0px 1.5em 0px 1.5em;
}
@define-mixin mx_DialogButton_secondary {
/* flip colours for the secondary ones */
font-weight: 600;
border: 1px solid $accent !important;
color: $accent;
background-color: $button-secondary-bg-color;
}
@define-mixin mx_Dialog_link {
color: $accent;
text-decoration: none;
}
body { body {
color-scheme: light; color-scheme: light;
} }