Skip to content

Commit 1f88bd7

Browse files
crisbetojelbourn
authored andcommitted
feat(sidenav): align with 2018 material design spec (#12569)
Aligns the sidenav with the latest Material design spec. The component was largely in-line already, so these changes only add a border in `side` mode.
1 parent 5278f72 commit 1f88bd7

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

src/lib/sidenav/_sidenav-theme.scss

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
// We use invert() here to have the darken the background color expected to be used. If the
1313
// background is light, we use a dark backdrop. If the background is dark,
1414
// we use a light backdrop.
15-
$drawer-backdrop-color: invert(mat-color($background, card, 0.6)) !default;
16-
$drawer-background-color: mat-color($background, dialog) !default;
17-
$drawer-container-background-color: mat-color($background, background) !default;
18-
$drawer-push-background-color: mat-color($background, dialog) !default;
15+
$drawer-backdrop-color: invert(mat-color($background, card, 0.6));
16+
$drawer-background-color: mat-color($background, dialog);
17+
$drawer-container-background-color: mat-color($background, background);
18+
$drawer-push-background-color: mat-color($background, dialog);
19+
$drawer-side-border: solid 1px mat-color($foreground, divider);
1920

2021
.mat-drawer-container {
2122
background-color: $drawer-container-background-color;
@@ -31,6 +32,25 @@
3132
}
3233
}
3334

35+
.mat-drawer-side {
36+
border-right: $drawer-side-border;
37+
38+
&.mat-drawer-end {
39+
border-left: $drawer-side-border;
40+
border-right: none;
41+
}
42+
}
43+
44+
[dir='rtl'] .mat-drawer-side {
45+
border-left: $drawer-side-border;
46+
border-right: none;
47+
48+
&.mat-drawer-end {
49+
border-left: none;
50+
border-right: $drawer-side-border;
51+
}
52+
}
53+
3454
.mat-drawer-backdrop.mat-drawer-shown {
3555
background-color: $drawer-backdrop-color;
3656
}

src/lib/sidenav/drawer.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ $mat-drawer-over-drawer-z-index: 4;
150150

151151
&:not(.mat-drawer-side) {
152152
// The elevation of z-16 is noted in the design specifications.
153-
// See https://material.io/guidelines/patterns/navigation-drawer.html#
153+
// See https://material.io/design/components/navigation-drawer.html
154154
@include mat-elevation(16);
155155
}
156156
}

0 commit comments

Comments
 (0)