Skip to content

Commit b584257

Browse files
committedMay 23, 2024
fix: allow table of contents to scroll
Fixes that it wasn't possible to scroll the table of contents independently of the page. Also gives a bit more space around it. Fixes #29102.
1 parent 728aa77 commit b584257

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed
 

‎material.angular.io/src/app/pages/component-viewer/component-viewer.scss

+3-2
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ app-component-viewer {
5151
// sticky positioning
5252
@media (max-width: constants.$small-breakpoint-width) {
5353
order: -1;
54-
position: inherit;
54+
position: relative;
5555
width: auto;
5656
padding-left: 0;
57+
max-height: none;
5758
}
5859
}
5960
}
@@ -65,7 +66,7 @@ app-component-viewer {
6566

6667
.docs-component-api,
6768
.docs-component-overview {
68-
width: 80%;
69+
width: 75%;
6970

7071
@media (max-width: constants.$small-breakpoint-width) {
7172
width: 100%;

‎material.angular.io/src/app/pages/guide-viewer/guide-viewer.scss

+3-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
.docs-guide-content {
3838
flex-grow: 1;
39-
width: 80%;
39+
width: 75%;
4040

4141
@media (max-width: constants.$extra-small-breakpoint-width) {
4242
width: 100%;
@@ -51,8 +51,9 @@ table-of-contents {
5151
// sticky positioning
5252
@media (max-width: constants.$extra-small-breakpoint-width) {
5353
order: -1;
54-
position: inherit;
54+
position: relative;
5555
width: auto;
5656
padding-left: 0;
57+
max-height: none;
5758
}
5859
}

‎material.angular.io/src/app/shared/table-of-contents/table-of-contents.scss

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
:host {
22
font-size: 13px;
33
// Width is container width minus content width
4-
width: 19%;
4+
width: 24%;
55
position: sticky;
66
top: 0;
77
padding-left: 25px;
88
box-sizing: border-box;
99
display: inline-flex;
1010
flex-direction: column;
11+
max-height: calc(100vh - 120px);
12+
overflow: auto;
1113
}
1214

1315
.docs-toc-container {
1416
width: 100%;
15-
padding: 5px 0 10px 10px;
17+
padding: 8px 0 8px 16px;
18+
box-sizing: border-box;
1619

1720
& + .docs-toc-container {
18-
padding-top: 8px;
21+
padding-top: 12px;
1922
}
2023
}
2124

@@ -39,5 +42,6 @@ a {
3942
}
4043

4144
.docs-level-h4 {
42-
margin-left: 12px;
45+
padding-left: 12px;
46+
box-sizing: border-box;
4347
}

0 commit comments

Comments
 (0)
Please sign in to comment.