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

Commit e759ed2

Browse files
committed
fix: various a11y refinements
- minify theme-demo-icon.svg Fixes #671
1 parent f354578 commit e759ed2

File tree

9 files changed

+14
-40
lines changed

9 files changed

+14
-40
lines changed

src/app/pages/component-viewer/component-overview.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<ng-container *ngIf="componentViewer.componentDocItem | async; let docItem">
2-
<span class="cdk-visually-hidden" role="heading" aria-level="2" tabindex="-1" #initialFocusTarget>
2+
<h2 class="cdk-visually-hidden" tabindex="-1" #initialFocusTarget>
33
Overview for {{docItem?.id}}
4-
</span>
4+
</h2>
55
<doc-viewer
66
documentUrl="/docs-content/overviews/{{docItem?.packageName}}/{{docItem?.id}}.html"
77
class="docs-component-view-text-content docs-component-overview"

src/app/pages/component-viewer/component-viewer.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<div class="docs-component-viewer">
2-
<nav mat-tab-nav-bar class="docs-component-viewer-tabbed-content" aria-label="Section">
2+
<nav mat-tab-nav-bar class="docs-component-viewer-tabbed-content"
3+
aria-label="Documentation Sections">
34
<a mat-tab-link class="docs-component-viewer-section-tab"
45
*ngFor="let section of sections"
56
[routerLink]="section.toLowerCase()"

src/app/shared/stack-blitz/stack-blitz-button.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<button mat-icon-button type="button" (click)="openStackBlitz()" [disabled]="isDisabled"
2-
[attr.aria-label]="isDisabled ? 'Building StackBlitz example...' : 'Edit in StackBlitz'"
2+
[attr.aria-label]="isDisabled ? 'Building StackBlitz example...' : 'Edit this example in StackBlitz'"
33
[matTooltip]="isDisabled ? 'Building ' + exampleData?.description + ' StackBlitz example...' :
44
'Edit ' + exampleData.description + ' example in StackBlitz'">
55
<mat-icon>open_in_new</mat-icon>

src/app/shared/table-of-contents/table-of-contents.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div *ngFor="let linkSection of _linkSections" class="docs-toc-container">
22
<div class="docs-toc-heading">{{linkSection.name}}</div>
3-
<nav aria-label="Section Table of Contents">
3+
<nav [attr.aria-label]="linkSection.name + ' Table of Contents'">
44
<a [href]="_rootUrl + '#' + link.id"
55
*ngFor="let link of linkSection.links; let i = index"
66
class="docs-level-{{link.type}} docs-link"

src/app/shared/theme-picker/theme-picker.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<mat-icon>format_color_fill</mat-icon>
44
</button>
55

6-
<mat-menu #themeMenu="matMenu" xPosition="before" class="theme-picker-menu">
7-
<button mat-menu-item *ngFor="let theme of themes" (click)="onThemeSelection(theme.name)">
6+
<mat-menu #themeMenu="matMenu" xPosition="before" class="docs-theme-picker-menu">
7+
<button mat-menu-item *ngFor="let theme of themes" (click)="selectTheme(theme.name)">
88
<mat-icon [ngClass]="{'docs-theme-selected-icon': currentTheme === theme}"
99
[color]="currentTheme === theme ? 'accent' : undefined">
1010
{{currentTheme === theme ? 'radio_button_checked' : 'radio_button_unchecked'}}

src/app/shared/theme-picker/theme-picker.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.theme-picker-menu {
1+
.docs-theme-picker-menu {
22
.mat-menu-item {
33
.mat-icon.theme-example-icon {
44
margin-right: 0;

src/app/shared/theme-picker/theme-picker.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('ThemePicker', () => {
1515
const component = fixture.componentInstance;
1616
const name = 'pink-bluegrey';
1717
spyOn(component.styleManager, 'setStyle');
18-
component.onThemeSelection(name);
18+
component.selectTheme(name);
1919
expect(component.styleManager.setStyle).toHaveBeenCalled();
2020
expect(component.styleManager.setStyle).toHaveBeenCalledWith('theme', `assets/${name}.css`);
2121
});

src/app/shared/theme-picker/theme-picker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class ThemePicker implements OnInit, OnDestroy {
7171
'assets/img/theme-demo-icon.svg'));
7272
const themeName = this._themeStorage.getStoredThemeName();
7373
if (themeName) {
74-
this.onThemeSelection(themeName);
74+
this.selectTheme(themeName);
7575
}
7676
}
7777

@@ -80,7 +80,7 @@ export class ThemePicker implements OnInit, OnDestroy {
8080
.pipe(map((params: ParamMap) => params.get('theme')))
8181
.subscribe((themeName: string | null) => {
8282
if (themeName) {
83-
this.onThemeSelection(themeName);
83+
this.selectTheme(themeName);
8484
}
8585
});
8686
}
@@ -89,7 +89,7 @@ export class ThemePicker implements OnInit, OnDestroy {
8989
this._queryParamSubscription.unsubscribe();
9090
}
9191

92-
onThemeSelection(themeName: string) {
92+
selectTheme(themeName: string) {
9393
const theme = this.themes.find(currentTheme => currentTheme.name === themeName);
9494

9595
if (!theme) {

src/assets/img/theme-demo-icon.svg

Lines changed: 1 addition & 28 deletions
Loading

0 commit comments

Comments
 (0)