|
1 | | -$sidenav-spacing-unit: 8px; |
2 | | -$sidenav-width: 240px; |
| 1 | +@import '../../../styles/constants'; |
3 | 2 |
|
4 | | -app-component-sidenav { |
5 | | - display: flex; |
6 | | -} |
| 3 | +$sidenav-width: 240px; |
7 | 4 |
|
8 | 5 | .docs-component-viewer-sidenav-container { |
9 | | - width: 100%; |
10 | | - |
11 | | - .mat-drawer-content { |
12 | | - position: absolute; |
13 | | - right: 0; |
14 | | - left: 0; |
15 | | - } |
| 6 | + box-sizing: border-box; |
16 | 7 | } |
17 | 8 |
|
18 | 9 | .docs-component-viewer-sidenav { |
19 | | - box-shadow: 3px 0 6px rgba(0, 0, 0, .24); |
20 | | - padding-bottom: 72px; |
21 | | - width: $sidenav-width; |
22 | | - bottom: 0; |
23 | 10 | overflow: auto; |
24 | | - height: 100%; |
| 11 | +} |
25 | 12 |
|
26 | | - &.mat-sidenav-opened { |
27 | | - box-shadow: 3px 0 6px rgba(0, 0, 0, .24); |
28 | | - } |
| 13 | +.docs-component-sidenav-inner-content { |
| 14 | + display: flex; |
| 15 | + flex-direction: row; |
29 | 16 |
|
30 | | - // Section divider |
31 | | - h3 { |
32 | | - border: none; |
33 | | - font-size: 10px; |
34 | | - letter-spacing: 1px; |
35 | | - line-height: $sidenav-spacing-unit * 3; |
36 | | - text-transform: uppercase; |
37 | | - font-weight: 400; |
38 | | - margin: 0; |
39 | | - padding: 0 ($sidenav-spacing-unit * 2); |
| 17 | + // The rule will match the element following the router-outlet which will be the routed component. |
| 18 | + router-outlet + * { |
| 19 | + flex-grow: 1; |
40 | 20 | } |
| 21 | +} |
41 | 22 |
|
42 | | - ul { |
43 | | - list-style-type: none; |
44 | | - margin: 0; |
45 | | - padding: 0; |
| 23 | +.mat-drawer { |
| 24 | + &::-webkit-scrollbar { |
| 25 | + height: 4px; |
| 26 | + width: 4px; |
46 | 27 | } |
| 28 | +} |
47 | 29 |
|
48 | | - // Sidenav navigation item |
49 | | - li { |
50 | | - border-bottom-width: 1px; |
51 | | - border-bottom-style: solid; |
52 | | - margin: 0; |
53 | | - padding: 0; |
| 30 | +.docs-component-viewer-nav { |
| 31 | + position: sticky; |
| 32 | + top: 25px; |
54 | 33 |
|
| 34 | + .docs-component-viewer-nav-content { |
| 35 | + margin: 25px; |
| 36 | + width: $sidenav-width; |
| 37 | + max-height: 75vh; |
| 38 | + overflow: auto; |
55 | 39 |
|
56 | | - // Hide the border on the last item |
57 | | - &:last-child { |
58 | | - border-color: transparent; |
| 40 | + &::-webkit-scrollbar { |
| 41 | + height: 4px; |
| 42 | + width: 4px; |
59 | 43 | } |
60 | 44 |
|
61 | | - > a { |
62 | | - box-sizing: border-box; |
63 | | - display: block; |
64 | | - font-size: 14px; |
65 | | - font-weight: 400; |
66 | | - line-height: ($sidenav-spacing-unit * 6) - 1; |
67 | | - text-decoration: none; |
68 | | - transition: all .3s; |
69 | | - padding: 0 ($sidenav-spacing-unit * 2); |
| 45 | + button { |
| 46 | + padding: 10px 15px; |
| 47 | + font-weight: 700; |
| 48 | + line-height: 16px; |
| 49 | + margin: 0; |
| 50 | + font-size: 13px; |
| 51 | + cursor: pointer; |
70 | 52 | position: relative; |
| 53 | + display: block; |
| 54 | + width: 100%; |
| 55 | + text-align: left; |
| 56 | + background: none; |
| 57 | + border: none; |
71 | 58 |
|
72 | | - &.docs-component-viewer-sidenav-item-selected { |
73 | | - font-weight: 600; |
| 59 | + &:focus { |
| 60 | + outline: none; |
74 | 61 | } |
| 62 | + |
| 63 | + .mat-icon { |
| 64 | + position: absolute; |
| 65 | + right: 5px; |
| 66 | + font-size: 18px; |
| 67 | + } |
| 68 | + } |
| 69 | + |
| 70 | + hr { |
| 71 | + padding: 0; |
| 72 | + margin: 0; |
| 73 | + } |
| 74 | + |
| 75 | + ul { |
| 76 | + list-style-type: none; |
| 77 | + margin: -5px 0 5px 0; |
| 78 | + padding: 0; |
| 79 | + overflow: hidden; |
| 80 | + } |
| 81 | + |
| 82 | + li { |
| 83 | + font-size: 13px; |
| 84 | + line-height: 16px; |
| 85 | + margin: 0; |
| 86 | + padding: 5px 15px 5px 20px; |
| 87 | + } |
| 88 | + |
| 89 | + a { |
| 90 | + display: block; |
| 91 | + text-decoration: none; |
75 | 92 | } |
76 | 93 | } |
77 | 94 | } |
78 | 95 |
|
79 | 96 | .docs-component-sidenav-content { |
80 | | - min-height: 100%; |
81 | 97 | display: flex; |
82 | 98 | flex-direction: column; |
| 99 | +} |
83 | 100 |
|
84 | | - // The rule will match the element following the router-outlet which will be the routed component. |
85 | | - router-outlet + * { |
86 | | - flex-grow: 1; |
| 101 | +// Add specific rule to prevent default rule conflict |
| 102 | +.docs-component-viewer-sidenav-container.mat-drawer-container{ |
| 103 | + display: block; |
| 104 | + overflow: hidden; |
| 105 | + position: absolute; |
| 106 | + // Offset the top by the toolbar height |
| 107 | + top: 50px; |
| 108 | + bottom: 0; |
| 109 | + left: 0; |
| 110 | + right: 0; |
| 111 | +} |
| 112 | + |
| 113 | +.docs-component-sidenav-inner-content { |
| 114 | + display: flex; |
| 115 | + flex-direction: column; |
| 116 | +} |
| 117 | + |
| 118 | +.docs-component-sidenav-body-content { |
| 119 | + display: flex; |
| 120 | + // footer should always reside at the bottom of the screen. |
| 121 | + // if container not 100vh, push min height to that minus |
| 122 | + // the offset of the top bar and the footer height |
| 123 | + min-height: calc(100vh - 264px); |
| 124 | +} |
| 125 | + |
| 126 | +@media (max-width: $small-breakpoint-width) { |
| 127 | + // Add specific rule to prevent default rule conflict |
| 128 | + .docs-component-viewer-sidenav-container .docs-component-viewer-sidenav { |
| 129 | + // offset the top by the header + tabs on a small screen |
| 130 | + top: 42px; |
| 131 | + } |
| 132 | + |
| 133 | + .mat-sidenav-content { |
| 134 | + // offset the top by the header + tabs on a small screen |
| 135 | + margin-top: 42px; |
| 136 | + } |
| 137 | + |
| 138 | + .docs-component-viewer-nav { |
| 139 | + position: relative; |
| 140 | + top: 0; |
| 141 | + |
| 142 | + .docs-component-viewer-nav-content { |
| 143 | + box-sizing: border-box; |
| 144 | + margin: 0; |
| 145 | + max-height: initial; |
| 146 | + box-sizing: border-box; |
| 147 | + } |
87 | 148 | } |
88 | 149 | } |
0 commit comments