This repository was archived by the owner on Dec 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 395
New sidenav #310
Merged
Merged
New sidenav #310
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c9b1f5b
feat(nav): implement new left nav
amcdnl 5c06dd4
feat(nav): cont imp left nav
amcdnl f5d9098
Merge branch 'master' of https://github.com/angular/material.angular.…
amcdnl ba28d51
chore(nit): address PR feedback
amcdnl 9fd6d13
Merge branch 'master' into new-sidenav2
amcdnl 45b6b23
Merge branch 'master' into new-sidenav2
amcdnl b2cfa71
fix: window scroll event not working
amcdnl 566fe51
fix: footer spacing causing scrollbar overflows
amcdnl 6b880bb
chore: nit feedback
amcdnl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
51 changes: 32 additions & 19 deletions
51
src/app/pages/component-sidenav/_component-sidenav-theme.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,49 @@ | ||
@import '../../../../node_modules/@angular/material/theming'; | ||
@import '../../../styles/constants'; | ||
|
||
@mixin component-viewer-sidenav-theme($theme) { | ||
$primary: map-get($theme, primary); | ||
$accent: map-get($theme, accent); | ||
$warn: map-get($theme, warn); | ||
$background: map-get($theme, background); | ||
$foreground: map-get($theme, foreground); | ||
$sidenav: '.docs-component-viewer-sidenav'; | ||
$is-dark-theme: map-get($theme, is-dark); | ||
$nav-background-opacity: if($is-dark-theme, 0.2, 0.03); | ||
|
||
.docs-component-viewer-nav-content { | ||
background: rgba(0, 0, 0, $nav-background-opacity); | ||
|
||
.docs-component-viewer-sidenav { | ||
&::-webkit-scrollbar-thumb { | ||
background: rgba(0, 0, 0, .26); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment as above |
||
} | ||
|
||
// Section divider | ||
h3 { | ||
background: rgba(mat-color($foreground, secondary-text), .32); | ||
color: mat-color($primary, default-contrast); | ||
button { | ||
color: rgba(mat-color($foreground, text), .5); | ||
} | ||
|
||
// Sidenav navigation items | ||
li { | ||
border-color: rgba(mat-color($foreground, secondary-text), .06); | ||
color: mat-color($foreground, secondary-text); | ||
hr { | ||
border: none; | ||
border-top: solid 1px rgba(mat-color($foreground, secondary-text), .1) | ||
} | ||
|
||
> a { | ||
a { | ||
color: mat-color($foreground, secondary-text); | ||
|
||
&.is-selected, | ||
&:hover, | ||
&:focus { | ||
background: mat-color($background, background); | ||
color: mat-color($primary); | ||
} | ||
&.docs-component-viewer-sidenav-item-selected, | ||
&:hover { | ||
color: mat-color($primary); | ||
} | ||
} | ||
} | ||
|
||
@media (max-width: $small-breakpoint-width) { | ||
.docs-component-viewer-sidenav { | ||
.docs-component-viewer-nav-content { | ||
background: none; | ||
} | ||
} | ||
|
||
.mat-drawer { | ||
&::-webkit-scrollbar-thumb { | ||
background: rgba(0, 0, 0, .26); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment as above |
||
} | ||
} | ||
} | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<div class="docs-component-viewer-nav"> | ||
<div class="docs-component-viewer-nav-content"> | ||
<nav *ngFor="let category of docItems.getCategories((params | async)?.section); let last = last;"> | ||
<button (click)="toggleExpand(category.id)" | ||
[attr.aria-label]="category.name + ', section toggle'" | ||
[attr.aria-controls]="'panel-' + category.id" | ||
[attr.aria-expanded]="getExpanded(category.id)"> | ||
{{category.name}} | ||
<mat-icon *ngIf="!getExpanded(category.id)">keyboard_arrow_down</mat-icon> | ||
<mat-icon *ngIf="getExpanded(category.id)">keyboard_arrow_up</mat-icon> | ||
</button> | ||
<ul [@bodyExpansion]="_getExpandedState(category.id)" id="panel-{{category.id}}"> | ||
<li *ngFor="let component of category.items"> | ||
<a [routerLink]="'/' + (params | async)?.section+ '/' + component.id" | ||
routerLinkActive="docs-component-viewer-sidenav-item-selected"> | ||
{{component.name}} | ||
</a> | ||
</li> | ||
</ul> | ||
<hr *ngIf="!last" /> | ||
</nav> | ||
</div> | ||
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
<mat-sidenav-container class="docs-component-viewer-sidenav-container"> | ||
<!-- If on small screen, menu resides in drawer --> | ||
<mat-sidenav #sidenav class="docs-component-viewer-sidenav" | ||
*ngIf="isScreenSmall()" | ||
[opened]="!isScreenSmall()" | ||
[mode]="isScreenSmall() ? 'over' : 'side'" | ||
[fixedInViewport]="isScreenSmall()" | ||
fixedTopGap="92"> | ||
<nav *ngFor="let category of docItems.getCategories((params | async)?.section)"> | ||
<h3>{{category.name}}</h3> | ||
<ul> | ||
<li *ngFor="let component of category.items"> | ||
<a [routerLink]="'/' + (params | async)?.section+ '/' + component.id" | ||
routerLinkActive="docs-component-viewer-sidenav-item-selected"> | ||
{{component.name}} | ||
</a> | ||
</li> | ||
</ul> | ||
</nav> | ||
<app-component-nav [params]="params"></app-component-nav> | ||
</mat-sidenav> | ||
|
||
<div class="docs-component-sidenav-content"> | ||
<component-page-header (toggleSidenav)="sidenav.toggle()"></component-page-header> | ||
<router-outlet></router-outlet> | ||
<app-footer></app-footer> | ||
<div class="docs-component-sidenav-inner-content"> | ||
<div class="docs-component-sidenav-body-content"> | ||
<!-- If on large screen, menu resides to left of content --> | ||
<app-component-nav | ||
*ngIf="!isScreenSmall()" | ||
[params]="params"> | ||
</app-component-nav> | ||
<router-outlet></router-outlet> | ||
</div> | ||
<app-footer></app-footer> | ||
</div> | ||
</div> | ||
</mat-sidenav-container> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be the foreground color instead of always black?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to make it a slight lighter accent of the current background. This is mainly done like this for different themes.