Skip to content

Commit 057ed37

Browse files
authored
fix(material/api-theme): fix nav items hover/focus contrast (#1004)
- fix hover and focus indicators on header nav items to have sufficient contrast Fixes #759
1 parent 84b3139 commit 057ed37

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

material.angular.io/src/app/shared/navbar/_navbar-theme.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@
1313

1414
.docs-navbar, .docs-navbar-header {
1515
background: mat.get-color-from-palette($primary);
16+
17+
& a:hover, & a:focus {
18+
background: rgba(0, 0, 0, 0.4);
19+
color: mat.get-color-from-palette($accent, 200);
20+
}
21+
22+
.docs-navbar-header-item-selected {
23+
background: rgba(0, 0, 0, 0.2);
24+
}
1625
}
1726
}
1827
}

material.angular.io/src/app/shared/navbar/navbar.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
</a>
1515
<a mat-button class="docs-navbar-hide-small docs-button"
1616
*ngFor="let key of sectionKeys"
17-
[routerLink]="key">{{sections[key].name}}</a>
18-
<a mat-button class="docs-navbar-hide-small docs-button" routerLink="guides">Guides</a>
17+
[routerLink]="key"
18+
routerLinkActive="docs-navbar-header-item-selected">{{sections[key].name}}</a>
19+
<a mat-button class="docs-navbar-hide-small docs-button" routerLink="guides" routerLinkActive="docs-navbar-header-item-selected">Guides</a>
1920
<div class="flex-spacer"></div>
2021
<version-picker></version-picker>
2122
<theme-picker></theme-picker>

0 commit comments

Comments
 (0)