Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit f42d5f4

Browse files
willshowelljelbourn
authored andcommitted
refactor(toc): move layout styles out of component and into parents (#323)
This also removes a class from header-link that was being used in two different contexts.
1 parent f494c67 commit f42d5f4

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

Diff for: src/app/pages/component-viewer/component-viewer.scss

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ app-component-viewer {
4040

4141
table-of-contents {
4242
top: 35px;
43+
position: sticky;
4344

4445
// Reposition on top of content on small screens and remove
4546
// sticky positioning

Diff for: src/app/pages/guide-viewer/guide-viewer.scss

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ $guide-content-margin-side-xs: 15px;
4646

4747
table-of-contents {
4848
top: 35px;
49+
position: sticky;
4950

5051
// Reposition on top of content on small screens and remove
5152
// sticky positioning

Diff for: src/app/shared/doc-viewer/header-link.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {Router} from '@angular/router';
2020
<a
2121
title="Link to this heading"
2222
[attr.aria-describedby]="example"
23-
class="docs-markdown-a docs-header-link"
23+
class="docs-markdown-a"
2424
aria-label="Link to this heading"
2525
[href]="url">
2626
<mat-icon>link</mat-icon>

Diff for: src/app/shared/table-of-contents/table-of-contents.scss

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
:host {
22
font-size: 13px;
3-
width: 19%;
4-
position: sticky;
5-
top: 0;
63
padding-left: 20px;
74
box-sizing: border-box;
85
}
96

107
.docs-toc-container {
8+
box-sizing: border-box;
119
padding: 5px 0 10px 12px;
12-
width: 100%;
1310
}
1411

1512
.docs-toc-heading {
16-
margin: 0;
17-
padding: 0;
1813
font-size: 13px;
1914
font-weight: bold;
2015
}
@@ -26,7 +21,6 @@ a {
2621
text-decoration: none;
2722
display: block;
2823
text-overflow: ellipsis;
29-
width: 100%;
3024
overflow: hidden;
3125
}
3226

0 commit comments

Comments
 (0)