Skip to content

Commit 8e1be88

Browse files
committed
docs: improve layout of the showcase
1 parent c1fa238 commit 8e1be88

3 files changed

Lines changed: 24 additions & 4 deletions

File tree

projects/demo/src/app/app.scss

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
}
55

66
.demo-toolbar {
7+
display: flex;
8+
flex-wrap: wrap;
9+
align-items: center;
710
position: sticky;
811
top: 0;
912
z-index: 10;
@@ -19,24 +22,28 @@
1922

2023
.demo-toolbar__title {
2124
font: var(--mat-sys-title-medium);
25+
min-width: 0;
2226
}
2327

2428
.demo-toolbar__spacer {
25-
flex: 1;
29+
flex: 1 1 auto;
30+
min-width: 0;
2631
}
2732

2833
.theme-controls {
2934
display: flex;
3035
flex-wrap: wrap;
3136
align-items: center;
3237
gap: 1rem 1.25rem;
38+
min-width: 0;
3339
}
3440

3541
.theme-controls__color {
3642
display: flex;
3743
align-items: center;
3844
gap: 0.5rem;
3945
cursor: pointer;
46+
min-width: 0;
4047
}
4148

4249
.theme-controls__label {
@@ -103,7 +110,7 @@
103110
color: var(--mat-sys-primary);
104111
}
105112

106-
@media (max-width: 720px) {
113+
@media (max-width: 850px) {
107114
.demo-toolbar__title {
108115
display: none;
109116
}
@@ -112,3 +119,9 @@
112119
display: none;
113120
}
114121
}
122+
123+
@media (max-width: 520px) {
124+
.theme-controls__presets {
125+
display: none;
126+
}
127+
}

projects/demo/src/app/material-showcase/material-showcase.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ <h2 id="nav-heading" class="showcase-section__title">Navigation</h2>
162162
</a>
163163
</mat-nav-list>
164164

165-
<button matButton="outlined" [matMenuTriggerFor]="demoMenu">
165+
<button class="showcase-menu" matButton="outlined" [matMenuTriggerFor]="demoMenu">
166166
<mat-icon>more_vert</mat-icon>
167167
Menu
168168
</button>

projects/demo/src/app/material-showcase/material-showcase.scss

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
.showcase-grid {
2-
display: grid;
2+
display: flex;
3+
flex-direction: column;
34
gap: 1.75rem;
5+
width: 100%;
46
}
57

68
.showcase-section__title {
@@ -73,8 +75,13 @@
7375
overflow: hidden;
7476
}
7577

78+
.showcase-menu {
79+
align-self: flex-start;
80+
}
81+
7682
@media (min-width: 960px) {
7783
.showcase-grid {
84+
display: grid;
7885
grid-template-columns: repeat(2, minmax(0, 1fr));
7986
}
8087

0 commit comments

Comments
 (0)