-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path_sidebar.scss
executable file
·222 lines (167 loc) · 6.04 KB
/
_sidebar.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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
// # Sidebar
// Defines styles for the book's sidebar
// *******************************************************
// ## Variables
// *******************************************************
// The width of the entire sidebar
$sidebar-width : 300px !default;
// Amount of time the sidebar animates when toggled
$sidebar-transition-duration : 250ms !default;
// The increment of padding used throughout the sidebar
$sidebar-padding-unit : $spacing-unit;
// The amount of horizontal padding for each section of the sidebar
$sidebar-padding-h : $sidebar-padding-unit * 1.5;
// The amount of vertical padding for each section of the sidebar
$sidebar-padding-v : $sidebar-padding-unit * 2;
// The text color of the sidebar
$sidebar-color : hsl(207, 15%, 25%) !default;
//
$sidebar-font-size : 0.8em !default;
// The background color of the sidebar
$sidebar-background : #fafafa !default;
// The color of right border of the entire sidebar
$sidebar-border-right : 1px solid $color-border !default;
// Styling for logo div
$sidebar-logo-map : (
background: white,
border-bottom: 1px solid $color-border
) !default;
// The height of the logo image
$sidebar-logo-height : 30px !default;
// The amount of indentation for each level of nav links
$sidebar-nested-padding : $sidebar-padding-unit !default;
// Hides/shows nested levels when not active
$sidebar-show-nested-levels : false;
// The vertical padding between links
$sidebar-link-padding-v : $sidebar-padding-unit !default;
// The horizontal padding on the sides of links
$sidebar-link-padding-h : 0 !default;
// Sidebar link headers styling
$sidebar-header-map : (
color: #939da3,
text-transform: uppercase,
font-family: $font-family-headings
) !default;
// Headers that are parent to currently active page
$sidebar-header-selected-map : ( color: $color-primary ) !default;
// Sidebar link styling
$sidebar-link-map : (
color: $color-text,
font-family: $font-family-base
) !default;
// Sidebar link hover styling
$sidebar-link-hover-map : (
color: $color-primary,
text-decoration: none
) !default;
// Links that are parent to current page
$sidebar-link-selected-map : ( font-weight: bold ) !default;
// Sidebar dividers styling
$sidebar-divider-map : ( background: $color-border ) !default;
// *******************************************************
// ## The logo
// *******************************************************
.book-logo
{
padding: $sidebar-padding-v $sidebar-padding-h;
@include print( $sidebar-logo-map );
}
.book-logo img
{
max-height: $sidebar-logo-height;
}
// *******************************************************
// ## The sidebar
// *******************************************************
.book-summary
{
position: absolute;
top: 0;
left: $sidebar-width * -1;
bottom: 0;
z-index: 1;
overflow-y: auto;
width: $sidebar-width;
color: $sidebar-color;
background: $sidebar-background;
border-right: $sidebar-border-right;
font-family: $font-family-sans;
font-size: $sidebar-font-size;
transition: left $sidebar-transition-duration ease;
@media (max-width: $mobile-breakpoint)
{
width: calc( 100% - 60px );
bottom: 0;
left: -100%;
}
}
// When the sidebar is toggled on
.book.with-summary .book-summary { left: 0; }
// When animation is turned off
.book.without-animation .book-summary { transition: none !important; }
// Handle sizing of book body for sidebar states
.book-body
{
transition: left $sidebar-transition-duration ease, transform $sidebar-transition-duration ease;
}
.book.with-summary .book-body
{
@media (min-width: $mobile-breakpoint) { left: $sidebar-width; }
}
// *******************************************************
// ## The list of links
// *******************************************************
.book-summary ul.summary
{
list-style: none;
margin: 0;
padding: $sidebar-padding-v $sidebar-padding-h;
transition: top 0.5s ease;
}
// Hide nested levels when not active
.book-summary .hide { @if $sidebar-show-nested-levels == false { display: none !important } }
.book-summary ul.summary li { list-style: none; }
.book-summary ul.summary li.header
{
padding: $sidebar-link-padding-v $sidebar-link-padding-h;
padding-top: $sidebar-padding-unit * 2;
@include print( $sidebar-header-map );
}
.book-summary ul.summary li.header:first-child { padding-top: 0; }
.book-summary ul.summary li.header.selected
{
@include print( $sidebar-header-selected-map );
}
.book-summary ul.summary li.divider
{
height: 1px;
margin: $sidebar-padding-unit/2 0;
overflow: hidden;
@include print( $sidebar-divider-map );
}
.book-summary ul.summary li a,
.book-summary ul.summary li span
{
position: relative;
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding: $sidebar-link-padding-v $sidebar-link-padding-h;
border-bottom: none;
@include print( $sidebar-link-map );
}
.book-summary ul.summary li.selected > a,
.book-summary ul.summary li.selected > span
{
@include print( $sidebar-link-selected-map );
}
.book-summary ul.summary li.active > a,
.book-summary ul.summary li a:hover
{
@include print( $sidebar-link-hover-map );
}
.book-summary ul.summary li ul
{
padding-left: $sidebar-nested-padding;
}