Skip to content

Commit 0ee92a2

Browse files
committed
docs: make nav tabs sticky for easier navigation while scrolling
1 parent 9951497 commit 0ee92a2

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

docs/src/app/pages/component-viewer/component-viewer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="docs-component-viewer">
2-
<nav mat-tab-nav-bar mat-stretch-tabs="false" class="docs-component-viewer-tabbed-content"
2+
<nav mat-tab-nav-bar mat-stretch-tabs="false" class="docs-component-viewer-tabbed-content sticky-top"
33
aria-label="Documentation Sections"
44
id="component-viewer"
55
focusOnNavigation

docs/src/app/pages/component-viewer/component-viewer.scss

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ app-component-viewer {
3030

3131
.docs-component-viewer-tabbed-content {
3232
margin-bottom: 25px;
33+
34+
&.sticky-top {
35+
position: sticky;
36+
top: 0;
37+
z-index: 1;
38+
background: var(--mat-sys-surface);
39+
}
3340
}
3441

3542
.docs-component-viewer-content {
@@ -38,7 +45,8 @@ app-component-viewer {
3845

3946
// Display outlet components with toc as flex and switch to
4047
// vertical direction on small screens
41-
component-overview, component-api {
48+
component-overview,
49+
component-api {
4250
display: flex;
4351
align-items: flex-start;
4452
overflow: visible;
@@ -49,7 +57,7 @@ app-component-viewer {
4957
}
5058

5159
table-of-contents {
52-
top: 35px;
60+
top: 50px;
5361
position: sticky;
5462

5563
// Reposition on top of content on small screens and remove

0 commit comments

Comments
 (0)