Improve hotkeys popup accessibility

pull/6000/head
Chocobozzz 2023-10-05 15:56:36 +02:00
parent 4d61e5ef9c
commit 0ac3820f4d
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 35 additions and 33 deletions

View File

@ -1,18 +1,17 @@
<div class="cfp-hotkeys-container fade" [ngClass]="{'in': helpVisible}">
<div class="cfp-hotkeys">
<h4 class="cfp-hotkeys-title">{{ title }}</h4>
<div class="cfp-hotkeys-table">
<table>
<tbody>
<tr *ngFor="let hotkey of hotkeys">
<td class="cfp-hotkeys-keys">
<span *ngFor="let key of hotkey.formatted" class="cfp-hotkeys-key">{{ key }}</span>
</td>
<td class="cfp-hotkeys-text">{{ hotkey.description }}</td>
</tr>
</tbody>
</table>
<ul role="presentation">
<li *ngFor="let hotkey of hotkeys">
<div class="cfp-hotkeys-keys">
<span *ngFor="let key of hotkey.formatted">{{ key }}</span>
</div>
<div class="cfp-hotkeys-text">{{ hotkey.description }}</div>
</li>
</ul>
<button class="button-unstyle cfp-hotkeys-close" (click)="toggleCheatSheet()">&#215;</button>
</div>
</div>

View File

@ -39,22 +39,23 @@
max-height: 100%;
}
.cfp-hotkeys table {
.cfp-hotkeys ul {
margin: auto;
width: fit-content;
list-style: none;
color: pvar(--mainForegroundColor);
}
.cfp-content {
display: table-cell;
vertical-align: middle;
.cfp-hotkeys-keys,
.cfp-hotkeys-text {
display: inline-block;
}
.cfp-hotkeys-keys {
padding: 5px;
text-align: end;
}
min-width: 90px;
.cfp-hotkeys-key {
> span {
@include margin-right(5px);
display: inline-block;
@ -66,10 +67,12 @@
box-shadow: inset 0 1px 0 #666, 0 1px 0 #bbb;
padding: 5px 9px;
font-size: 1em;
}
}
.cfp-hotkeys-text {
@include padding-left(10px);
font-size: 1em;
}
@ -85,11 +88,11 @@
min-height: 45px;
min-width: 45px;
text-align: center;
}
.cfp-hotkeys-close:hover {
&:hover {
cursor: pointer;
opacity: 0.8;
}
}
@media all and (max-width: $mobile-view) {