UNPKG

2.91 kBSCSSView Raw
1// Copyright (c) 2018 Uber Technologies, Inc.
2//
3// Permission is hereby granted, free of charge, to any person obtaining a copy
4// of this software and associated documentation files (the "Software"), to deal
5// in the Software without restriction, including without limitation the rights
6// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7// copies of the Software, and to permit persons to whom the Software is
8// furnished to do so, subject to the following conditions:
9//
10// The above copyright notice and this permission notice shall be included in
11// all copies or substantial portions of the Software.
12//
13// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19// THE SOFTWARE.
20
21@import 'variables';
22
23.toc {
24 position: fixed;
25 width: $toc-width;
26 height: calc(100% - #{$topbar-height});
27
28 padding: 1rem;
29
30 flex-shrink: 0;
31
32 z-index: 1;
33 overflow-y: auto;
34 -webkit-overflow-scrolling: touch;
35
36 background-color: #fff;
37 border-right: 1px solid #e0e0e0;
38 transition: all 300ms;
39 white-space: nowrap;
40
41 > div {
42 padding-bottom: 80px;
43 }
44
45 .subpages {
46 transition: max-height 0.3s;
47 overflow: hidden;
48 }
49
50 li {
51 list-style: none;
52 line-height: 40px;
53 }
54
55 a {
56 display: block;
57 }
58
59 .link {
60 padding-left: 28px;
61 color: $black-20;
62 background: transparent;
63 border-style: solid;
64 border-width: 0 0 0 4px;
65 border-color: transparent;
66 &:hover {
67 color: $white-40;
68 }
69 &.active {
70 color: $primary;
71 font-weight: bold;
72 border-color: $primary;
73 border-image: $gradient-2;
74 border-image-slice: 2;
75 }
76 }
77
78 .list-header {
79 position: relative;
80 font-weight: 600;
81 font-size: 16px;
82 line-height: 24px;
83 padding: 24px 0 8px 24px;
84 color: $white-40;
85 }
86
87 .list-header:not(.active):not(.expanded):before {
88 content: '+';
89 font-weight: 600;
90 color: $white-40;
91 position: absolute;
92 top: 24px;
93 right: 8px;
94 font-size: 16px;
95 line-height: 24px;
96 }
97
98 .list-header:not(.active):not(.expanded) + .subpages {
99 max-height: 0 !important;
100 }
101}
102
103.toc + * {
104 margin-left: $toc-width;
105}
106
107@media screen and (max-width: $mobile) {
108 .toc {
109 position: absolute;
110 width: 100vw;
111 height: 0;
112 padding: 0;
113
114 > div {
115 padding-top: $topbar-maxheight;
116 padding-bottom: 1rem;
117 }
118
119 &.open {
120 padding: 1rem;
121 height: 100%;
122 & + * {
123 display: none;
124 }
125 }
126
127 & + * {
128 margin-left: 0;
129 }
130 }
131}