Basic support for forced colors/high contrast mode

This commit is contained in:
Scott Nonnenberg 2022-04-04 10:16:00 -07:00 committed by GitHub
parent b59e85bae5
commit 76a1a805ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 56 additions and 14 deletions

View file

@ -173,20 +173,8 @@
-webkit-mask-origin: $mask-origin; -webkit-mask-origin: $mask-origin;
} }
background-color: $color; background-color: $color;
} @media (forced-colors: active) {
background-color: WindowText;
@mixin header-icon-white($svg) {
@include color-svg($svg, $color-white-alpha-80);
&:focus,
&:hover {
@include color-svg($svg, $color-white);
}
}
@mixin header-icon-black($svg) {
@include color-svg($svg, $color-black-alpha-40);
&:focus,
&:hover {
@include color-svg($svg, black);
} }
} }
@ -220,6 +208,10 @@
@mixin popper-shadow() { @mixin popper-shadow() {
box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.3), 0px 0px 8px rgba(0, 0, 0, 0.05); box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.3), 0px 0px 8px rgba(0, 0, 0, 0.05);
@media (forced-colors: active) {
border: 1px solid WindowText;
}
} }
@mixin button-reset { @mixin button-reset {
@ -232,6 +224,10 @@
cursor: pointer; cursor: pointer;
outline: inherit; outline: inherit;
text-align: inherit; text-align: inherit;
@media (forced-colors: active) {
border: 1px solid WindowText;
}
} }
@mixin staged-attachment-close-button { @mixin staged-attachment-close-button {

View file

@ -2294,6 +2294,7 @@ button.ConversationDetails__action-button {
} }
@include keyboard-mode { @include keyboard-mode {
border: none;
&:focus { &:focus {
border-color: $color-ultramarine; border-color: $color-ultramarine;
outline: none; outline: none;

View file

@ -88,6 +88,10 @@
-webkit-mask-size: 62%; -webkit-mask-size: 62%;
background-color: var(--fg); background-color: var(--fg);
@media (forced-colors: active) {
background-color: WindowText;
}
&--direct { &--direct {
-webkit-mask-image: url('../images/icons/v2/profile-outline-20.svg'); -webkit-mask-image: url('../images/icons/v2/profile-outline-20.svg');
-webkit-mask-size: 60%; -webkit-mask-size: 60%;

View file

@ -82,6 +82,10 @@
background-color: $color-white; background-color: $color-white;
-webkit-mask-size: contain; -webkit-mask-size: contain;
@media (forced-colors: active) {
background-color: WindowText;
}
&--relink { &--relink {
-webkit-mask: url('../images/icons/v2/link-broken-16.svg') no-repeat -webkit-mask: url('../images/icons/v2/link-broken-16.svg') no-repeat
center; center;
@ -121,6 +125,13 @@
display: block; display: block;
width: 100%; width: 100%;
height: 100%; height: 100%;
@media (forced-colors: active) {
background-color: WindowText;
@include dark-theme {
background-color: WindowText;
}
}
} }
&:hover, &:hover,
@ -130,6 +141,21 @@
&:active { &:active {
background-color: $color-white-alpha-20; background-color: $color-white-alpha-20;
} }
@media (forced-colors: active) {
&:hover,
&:focus,
&:active {
background-color: none;
}
@include dark-theme {
&:hover,
&:focus,
&:active {
background-color: none;
}
}
}
} }
&__message { &__message {
@ -173,10 +199,18 @@
.LeftPaneDialog__icon { .LeftPaneDialog__icon {
background-color: $color-black; background-color: $color-black;
@media (forced-colors: active) {
background-color: WindowText;
}
} }
.LeftPaneDialog__close-button::before { .LeftPaneDialog__close-button::before {
background-color: $color-black; background-color: $color-black;
@media (forced-colors: active) {
background-color: WindowText;
}
} }
} }

View file

@ -123,6 +123,13 @@
@include dark-theme { @include dark-theme {
background: $color-gray-15; background: $color-gray-15;
} }
@media (forced-colors: active) {
background-color: WindowText;
@include dark-theme {
background: WindowText;
}
}
} }
} }
} }