Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit c3f26d6

Browse files
authored
Improve high-contrast support for spotlight (#8948)
1 parent bb859d5 commit c3f26d6

File tree

4 files changed

+122
-6
lines changed

4 files changed

+122
-6
lines changed

res/css/views/dialogs/_SpotlightDialog.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,18 @@ limitations under the License.
3434
line-height: $font-15px;
3535
color: $secondary-content;
3636

37-
> span > div {
37+
kbd {
3838
display: inline-block;
3939
padding: 2px $spacing-4; // TODO: Use a spacing variable
4040
margin: 0 $spacing-4;
4141
border-radius: 6px;
4242
background-color: $quinary-content;
4343
vertical-align: middle;
4444
color: $tertiary-content;
45+
// To avoid any styling inherent with <kbd> elements
46+
font-family: inherit;
47+
font-weight: inherit;
48+
font-size: inherit;
4549
}
4650
}
4751
}
@@ -424,6 +428,9 @@ limitations under the License.
424428

425429
.mx_SpotlightDialog_enterPrompt {
426430
padding: 2px $spacing-4; // TODO: Use a spacing variable
431+
// To avoid any styling inherent with <kbd> elements
432+
font-family: inherit;
433+
font-weight: inherit;
427434
font-size: $font-12px;
428435
line-height: $font-15px;
429436
color: $tertiary-content;

res/themes/light-high-contrast/css/_light-high-contrast.scss

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,112 @@ $roomtopic-color: $secondary-content;
129129
.mx_Dialog_buttons button.mx_LocationPicker_cancelButton::before {
130130
background-color: $background !important;
131131
}
132+
133+
.mx_SpotlightDialog_wrapper .mx_Dialog {
134+
#mx_SpotlightDialog_keyboardPrompt {
135+
kbd {
136+
color: $background !important;
137+
}
138+
}
139+
}
140+
141+
.mx_SpotlightDialog {
142+
.mx_SpotlightDialog_searchBox {
143+
> .mx_SpotlightDialog_filter {
144+
color: $background !important;
145+
&::before {
146+
background-color: $background !important;
147+
}
148+
}
149+
}
150+
#mx_SpotlightDialog_content {
151+
.mx_SpotlightDialog_recentlyViewed {
152+
.mx_SpotlightDialog_option {
153+
&:hover, &[aria-selected=true] {
154+
color: $background !important;
155+
156+
.mx_DecoratedRoomAvatar_icon::before {
157+
background-color: $background !important;
158+
}
159+
}
160+
}
161+
}
162+
.mx_SpotlightDialog_results,
163+
.mx_SpotlightDialog_recentSearches,
164+
.mx_SpotlightDialog_otherSearches,
165+
.mx_SpotlightDialog_hiddenResults {
166+
.mx_SpotlightDialog_option {
167+
&:hover, &[aria-selected=true] {
168+
background-color: $quinary-content !important;
169+
color: $background !important;
170+
171+
&.mx_SpotlightDialog_startChat::before,
172+
&.mx_SpotlightDialog_joinRoomAlias::before,
173+
&.mx_SpotlightDialog_explorePublicRooms::before,
174+
&.mx_SpotlightDialog_startGroupChat::before {
175+
background-color: $background !important;
176+
}
177+
178+
.mx_DecoratedRoomAvatar_icon::before {
179+
background-color: $background !important;
180+
}
181+
182+
.mx_SpotlightDialog_result_publicRoomDetails {
183+
.mx_SpotlightDialog_result_publicRoomHeader {
184+
.mx_SpotlightDialog_result_publicRoomName {
185+
color: $background;
186+
}
187+
.mx_SpotlightDialog_result_publicRoomAlias {
188+
color: $background;
189+
}
190+
}
191+
.mx_SpotlightDialog_result_publicRoomDescription {
192+
color: $background;
193+
}
194+
}
195+
196+
.mx_NotificationBadge {
197+
background-color: $background !important;
198+
}
199+
200+
.mx_SpotlightDialog_result_details {
201+
color: $background !important;
202+
}
203+
}
204+
}
205+
}
206+
.mx_SpotlightDialog_enterPrompt {
207+
background-color: $background !important;
208+
}
209+
}
210+
}
211+
212+
.mx_GenericDropdownMenu_button:hover,
213+
.mx_GenericDropdownMenu_button[aria-expanded=true] {
214+
color: $background !important;
215+
}
216+
217+
.mx_ContextualMenu_wrapper.mx_GenericDropdownMenu_wrapper {
218+
.mx_GenericDropdownMenu_Option {
219+
&.mx_GenericDropdownMenu_Option--item {
220+
&:hover {
221+
background-color: $quinary-content !important;
222+
color: $background !important;
223+
224+
&[aria-checked="true"]::before {
225+
background-color: $background !important;
226+
}
227+
228+
> .mx_GenericDropdownMenu_Option--label {
229+
span:first-child {
230+
color: $background !important;
231+
}
232+
}
233+
}
234+
}
235+
}
236+
}
237+
238+
.mx_NetworkDropdown_removeServer::before {
239+
background-color: $background !important;
240+
}

src/components/views/dialogs/spotlight/Option.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const Option: React.FC<OptionProps> = ({ inputRef, children, endAdornment
3737
role="option"
3838
>
3939
{ children }
40-
<div className="mx_SpotlightDialog_enterPrompt" aria-hidden></div>
40+
<kbd className="mx_SpotlightDialog_enterPrompt" aria-hidden></kbd>
4141
{ endAdornment }
4242
</AccessibleButton>;
4343
};

src/components/views/dialogs/spotlight/SpotlightDialog.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -996,10 +996,10 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
996996
<div id="mx_SpotlightDialog_keyboardPrompt">
997997
{ _t("Use <arrows/> to scroll", {}, {
998998
arrows: () => <>
999-
<div></div>
1000-
<div></div>
1001-
{ !filter !== null && !query && <div></div> }
1002-
{ !filter !== null && !query && <div></div> }
999+
<kbd></kbd>
1000+
<kbd></kbd>
1001+
{ !filter !== null && !query && <kbd></kbd> }
1002+
{ !filter !== null && !query && <kbd></kbd> }
10031003
</>,
10041004
}) }
10051005
</div>

0 commit comments

Comments
 (0)