|
62 | 62 | <nav |
63 | 63 | class="adev-nav-primary docs-scroll-hide" |
64 | 64 | [class.adev-nav-primary--open]="isMobileNavigationOpened()" |
65 | | - [class.adev-nav-primary--rc]="currentDocsVersionMode === 'rc'" |
66 | | - [class.adev-nav-primary--next]="currentDocsVersionMode === 'next'" |
67 | | - [class.adev-nav-primary--deprecated]="currentDocsVersionMode === 'deprecated'" |
| 65 | + [class.adev-nav-primary--rc]="currentDocsVersionMode() === 'rc'" |
| 66 | + [class.adev-nav-primary--next]="currentDocsVersionMode() === 'next'" |
| 67 | + [class.adev-nav-primary--deprecated]="currentDocsVersionMode() === 'deprecated'" |
68 | 68 | > |
69 | 69 | <button |
70 | 70 | type="button" |
|
177 | 177 | type="button" |
178 | 178 | cdkMenuItem |
179 | 179 | [href]="item.url" |
180 | | - [attr.aria-label]="item.displayName" |
| 180 | + [aria-label]="item.displayName" |
181 | 181 | > |
182 | 182 | <span>{{ item.displayName }}</span> |
183 | 183 | </a> |
|
209 | 209 | </svg> |
210 | 210 | <span |
211 | 211 | class="adev-nav-item__label adev-search-desktop" |
212 | | - [attr.aria-label]="'Open search dialog with ' + searchTitle" |
| 212 | + [aria-label]="'Open search dialog with ' + searchTitle" |
213 | 213 | > |
214 | 214 | <kbd>{{ searchLabel }}</kbd> |
215 | 215 | <kbd>K</kbd> |
|
446 | 446 | </ul> |
447 | 447 | </ng-template> |
448 | 448 | </div> |
449 | | - <!-- TODO: Refactor this and make it better. Accessible, animated, etc. --> |
| 449 | + <!-- Theme Picker --> |
450 | 450 | <div class="adev-nav-item" [class.adev-nav-item--active]="openedMenu() === 'theme-picker'"> |
451 | 451 | <button |
452 | 452 | type="button" |
453 | 453 | [cdkMenuTriggerFor]="themeMiniMenu" |
454 | 454 | [cdkMenuPosition]="miniMenuPositions" |
455 | | - aria-label="Open theme picker" |
| 455 | + [aria-label]="'Change theme. Current theme: ' + theme()" |
| 456 | + aria-controls="theme-mini-menu" |
| 457 | + [aria-expanded]="openedMenu() === 'theme-picker'" |
| 458 | + aria-haspopup="menu" |
456 | 459 | (cdkMenuClosed)="closeMenu()" |
457 | 460 | (cdkMenuOpened)="openMenu('theme-picker')" |
458 | 461 | > |
459 | | - <docs-icon role="presentation"> |
| 462 | + <docs-icon role="presentation" class="adev-theme-icon"> |
460 | 463 | @switch (theme()) { |
461 | 464 | @case ('light') { |
462 | 465 | {{ 'light_mode' }} |
|
472 | 475 | </button> |
473 | 476 |
|
474 | 477 | <ng-template #themeMiniMenu> |
475 | | - <ul class="adev-mini-menu" cdkMenu> |
476 | | - <li> |
| 478 | + <ul |
| 479 | + class="adev-mini-menu" |
| 480 | + cdkMenu |
| 481 | + id="theme-mini-menu" |
| 482 | + role="menu" |
| 483 | + aria-label="Theme options" |
| 484 | + > |
| 485 | + <li role="none"> |
477 | 486 | <button |
478 | 487 | type="button" |
479 | 488 | cdkMenuItem |
| 489 | + role="menuitemradio" |
| 490 | + [aria-checked]="theme() === 'auto'" |
480 | 491 | (click)="setTheme('auto')" |
481 | 492 | aria-label="Set default system theme" |
482 | 493 | > |
483 | | - <docs-icon class="docs-icon_high-contrast">routine</docs-icon> |
| 494 | + <docs-icon class="docs-icon_high-contrast" aria-hidden="true">routine</docs-icon> |
484 | 495 | <span>System</span> |
485 | 496 | </button> |
486 | 497 | </li> |
487 | | - <li> |
| 498 | + <li role="none"> |
488 | 499 | <button |
489 | 500 | type="button" |
490 | 501 | cdkMenuItem |
| 502 | + role="menuitemradio" |
| 503 | + [aria-checked]="theme() === 'dark'" |
491 | 504 | (click)="setTheme('dark')" |
492 | 505 | aria-label="Set dark theme" |
493 | 506 | > |
494 | | - <docs-icon class="docs-icon_high-contrast">dark_mode</docs-icon> |
| 507 | + <docs-icon class="docs-icon_high-contrast" aria-hidden="true">dark_mode</docs-icon> |
495 | 508 | <span>Dark</span> |
496 | 509 | </button> |
497 | 510 | </li> |
498 | | - <li> |
| 511 | + <li role="none"> |
499 | 512 | <button |
500 | 513 | type="button" |
501 | 514 | cdkMenuItem |
| 515 | + role="menuitemradio" |
| 516 | + [aria-checked]="theme() === 'light'" |
502 | 517 | (click)="setTheme('light')" |
503 | 518 | aria-label="Set light theme" |
504 | 519 | > |
505 | | - <docs-icon class="docs-icon_high-contrast">light_mode</docs-icon> |
| 520 | + <docs-icon class="docs-icon_high-contrast" aria-hidden="true">light_mode</docs-icon> |
506 | 521 | <span>Light</span> |
507 | 522 | </button> |
508 | 523 | </li> |
|
0 commit comments