Skip to content

Commit 40ff3f9

Browse files
crisbetojelbourn
authored andcommitted
build: make body scrollable element in demo (#12093)
Reworks the demo to make the `body` the scrollable element. Currently we have the `mat-sidenav-content` be scrollable which doesn't reflect the setup in most apps and makes it harder to test some cases, because of some things like the overlay backdrop blocking scrolling.
1 parent dd7421d commit 40ff3f9

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/demo-app/demo-app/demo-app.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<mat-sidenav-container fullscreen>
1+
<mat-sidenav-container class="demo-container">
22
<mat-sidenav #start>
33
<mat-nav-list>
44
<a *ngFor="let navItem of navItems"

src/demo-app/demo-app/demo-app.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
html, body {
2+
width: 100%;
3+
height: 100%;
4+
}
5+
16
body {
27
font-family: Roboto, 'Helvetica Neue', sans-serif;
8+
margin: 0;
39

410
// Helps fonts on OSX looks more consistent with other systems
511
// Isn't currently in button styles due to performance concerns
@@ -10,6 +16,7 @@ body {
1016

1117
.mat-sidenav {
1218
min-width: 15vw;
19+
position: fixed;
1320

1421
.mat-button {
1522
width: 100%;
@@ -48,3 +55,8 @@ body {
4855
height: 100%;
4956
box-sizing: border-box;
5057
}
58+
59+
.demo-container {
60+
min-width: 100%;
61+
min-height: 100%;
62+
}

0 commit comments

Comments
 (0)