-
Notifications
You must be signed in to change notification settings - Fork 297
/
_sidebar-primary.scss
167 lines (145 loc) · 3.34 KB
/
_sidebar-primary.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/**
* The primary sidebar on the left.
* e.g., between-pages navigation.
*/
.bd-sidebar-primary {
display: flex;
flex-direction: column;
max-height: calc(100vh - var(--pst-header-height));
position: sticky;
top: var(--pst-header-height);
@include make-col(3);
// Borders padding and whitespace
padding: 2rem 1rem 1rem 1rem;
border-right: 1px solid var(--pst-color-border);
background-color: var(--pst-color-background);
overflow-y: auto;
@include scrollbar-style();
font-size: var(--pst-sidebar-primary-font-size);
&.no-sidebar {
border-right: 0;
}
&.hide-on-wide {
@include media-breakpoint-up($breakpoint-sidebar-primary) {
display: none;
}
}
.sidebar-primary__section {
padding-top: 1rem;
padding-bottom: 1rem;
}
.sidebar-start-items__item,
.sidebar-end-items__item {
padding: 0.25rem 0;
}
// Hide the sidebar header items on widescreen since they are visible in the header
.sidebar-header-items {
display: flex;
flex-direction: column;
padding-bottom: 1rem;
.sidebar-header-items__title {
font-size: 1.1rem;
color: var(--pst-color-text-base);
margin-bottom: 0.5rem;
}
// The dropdown toggle for extra links just shows them all instead.
.dropdown {
// On mobile, the dropdown behaves like any other link, no hiding
button {
display: none;
}
.dropdown-menu {
display: flex;
flex-direction: column;
padding: 0;
margin: 0;
border: none;
background-color: inherit;
font-size: inherit;
}
}
// Positioning end items
.sidebar-header-items__end {
display: flex;
align-items: center;
gap: 0.5rem;
}
@include media-breakpoint-up($breakpoint-sidebar-primary) {
display: none;
}
}
.sidebar-start-items {
border-top: 1px solid var(--pst-color-border);
}
.sidebar-end-items {
margin-top: auto;
margin-bottom: 1em;
}
.list-caption {
list-style: none;
padding-left: 0px;
}
li {
position: relative;
// If it has children, add a bit more padding to wrap the content to avoid
// overlapping with the <label>
&.has-children {
> .reference {
padding-right: 30px;
}
}
}
// Navigation item chevrons
label {
position: absolute;
top: 0;
right: 0;
height: 30px;
width: 30px;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
&:hover {
background: var(--pst-color-surface);
}
i {
display: inline-block;
font-size: 0.75rem;
text-align: center;
&:hover {
color: var(--pst-color-primary);
}
}
}
.label-parts {
width: 100%;
height: 100%;
&:hover {
background: none;
}
i {
width: 30px;
position: absolute;
top: 0.3em; // aligning chevron with text
right: 0em; // aligning chevron to the right
}
}
}
/* Between-page links and captions */
nav.bd-links {
margin-right: -1rem;
// Toctree captions
p.caption {
font-size: var(--pst-sidebar-primary-caption-font-size);
text-transform: uppercase;
font-weight: bold;
position: relative;
margin-top: 1.25em;
margin-bottom: 0.5em;
color: var(--pst-color-text-base);
&:first-child {
margin-top: 0;
}
}
}