just-the-docs 0.2.5 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +2 -2
  3. data/_includes/css/custom.scss.liquid +1 -0
  4. data/_includes/css/just-the-docs.scss.liquid +7 -0
  5. data/_includes/head.html +19 -13
  6. data/_includes/head_custom.html +0 -0
  7. data/_includes/js/custom.js +0 -0
  8. data/_includes/nav.html +55 -44
  9. data/_includes/title.html +5 -0
  10. data/_includes/vendor/anchor_headings.html +100 -0
  11. data/_layouts/default.html +146 -55
  12. data/_layouts/table_wrappers.html +7 -0
  13. data/_layouts/vendor/compress.html +10 -0
  14. data/_sass/base.scss +16 -18
  15. data/_sass/buttons.scss +1 -1
  16. data/_sass/code.scss +211 -72
  17. data/_sass/color_schemes/dark.scss +4 -1
  18. data/_sass/color_schemes/light.scss +0 -0
  19. data/_sass/content.scss +80 -1
  20. data/_sass/custom/custom.scss +0 -120
  21. data/_sass/labels.scss +5 -4
  22. data/_sass/layout.scss +118 -62
  23. data/_sass/modules.scss +20 -0
  24. data/_sass/navigation.scss +125 -77
  25. data/_sass/print.scss +40 -0
  26. data/_sass/search.scss +263 -56
  27. data/_sass/support/_functions.scss +2 -3
  28. data/_sass/support/_variables.scss +27 -22
  29. data/_sass/support/mixins/_layout.scss +1 -3
  30. data/_sass/support/mixins/_typography.scss +6 -1
  31. data/_sass/tables.scss +13 -33
  32. data/_sass/typography.scss +9 -7
  33. data/_sass/utilities/_layout.scss +74 -17
  34. data/_sass/utilities/_lists.scss +7 -1
  35. data/_sass/utilities/_spacing.scss +69 -25
  36. data/assets/css/just-the-docs-dark.scss +3 -0
  37. data/assets/css/just-the-docs-default.scss +8 -0
  38. data/assets/css/just-the-docs-light.scss +3 -0
  39. data/assets/js/just-the-docs.js +425 -130
  40. data/assets/js/vendor/lunr.min.js +3 -3
  41. data/assets/js/zzzz-search-data.json +58 -0
  42. data/lib/tasks/search.rake +54 -9
  43. metadata +43 -26
  44. data/assets/css/dark-mode-preview.scss +0 -41
  45. data/assets/css/just-the-docs.scss +0 -44
  46. data/assets/js/search-data.json +0 -12
@@ -0,0 +1,40 @@
1
+ // stylelint-disable selector-max-specificity, selector-max-id, selector-max-type, selector-no-qualifying-type, primer/no-override,
2
+
3
+ @media print {
4
+ .site-footer,
5
+ .site-button,
6
+ #edit-this-page,
7
+ #back-to-top,
8
+ .site-nav,
9
+ .main-header {
10
+ display: none !important;
11
+ }
12
+
13
+ .side-bar {
14
+ width: 100%;
15
+ height: auto;
16
+ border-right: 0 !important;
17
+ }
18
+
19
+ .site-header {
20
+ border-bottom: 1px solid $border-color;
21
+ }
22
+
23
+ .site-title {
24
+ font-size: $root-font-size !important;
25
+ font-weight: 700 !important;
26
+ }
27
+
28
+ .text-small {
29
+ font-size: 8pt !important;
30
+ }
31
+
32
+ pre.highlight {
33
+ border: 1px solid $border-color;
34
+ }
35
+
36
+ .main {
37
+ max-width: none;
38
+ margin-left: 0;
39
+ }
40
+ }
@@ -4,95 +4,122 @@
4
4
 
5
5
  .search {
6
6
  position: relative;
7
- z-index: 99;
8
- display: none;
7
+ z-index: 2;
9
8
  flex-grow: 1;
9
+ height: $sp-10;
10
10
  padding: $sp-2;
11
- margin-bottom: $sp-3;
12
- background-color: $white;
13
- border-radius: 3px;
14
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07), 0 3px 10px rgba(0, 0, 0, 0.05);
11
+ transition: padding linear #{$transition-duration / 2};
15
12
 
16
13
  @include mq(md) {
17
- display: block;
18
- padding-top: $sp-1;
19
- padding-right: 0;
20
- padding-bottom: 0;
21
- padding-left: 0;
22
- margin-bottom: 0;
23
- background-color: transparent;
24
- box-shadow: none;
25
- }
26
-
27
- &.nav-open {
28
- display: block;
14
+ position: relative !important;
15
+ width: auto !important;
16
+ height: 100% !important;
17
+ padding: 0;
18
+ transition: none;
29
19
  }
30
20
  }
31
21
 
32
- .search-results-wrap {
33
- display: none;
22
+ .search-input-wrap {
23
+ position: relative;
24
+ z-index: 1;
25
+ height: $sp-8;
26
+ overflow: hidden;
27
+ border-radius: $border-radius;
28
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 3px 10px rgba(0, 0, 0, 0.08);
29
+ transition: height linear #{$transition-duration / 2};
34
30
 
35
- &.active {
31
+ @include mq(md) {
36
32
  position: absolute;
37
- top: $sp-1;
38
- z-index: 100;
39
- display: block;
40
- width: 300px;
41
- margin-top: $gutter-spacing;
42
- background: lighten($body-background-color, 1%);
43
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 4px 14px rgba(0, 0, 0, 0.05);
33
+ width: 100%;
34
+ max-width: $search-results-width;
35
+ height: 100% !important;
36
+ border-radius: 0;
37
+ box-shadow: none;
38
+ transition: width ease $transition-duration;
44
39
  }
45
40
  }
46
41
 
47
- .search-input-wrap {
48
- display: flex;
49
- background-color: $body-background-color;
50
- }
51
-
52
42
  .search-input {
43
+ position: absolute;
53
44
  width: 100%;
54
- padding-top: $sp-1;
55
- padding-bottom: $sp-1;
56
- background-color: $body-background-color;
45
+ height: 100%;
46
+ padding-top: $sp-2;
47
+ padding-right: $gutter-spacing-sm;
48
+ padding-bottom: $sp-2;
49
+ padding-left: #{$gutter-spacing-sm + $sp-5};
50
+ font-size: 16px;
51
+ background-color: $search-background-color;
57
52
  border-top: 0;
58
53
  border-right: 0;
59
54
  border-bottom: 0;
60
55
  border-left: 0;
61
- order: 2;
56
+ border-radius: 0;
57
+
58
+ @include mq(md) {
59
+ padding-top: $gutter-spacing-sm;
60
+ padding-bottom: $gutter-spacing-sm;
61
+ padding-left: #{$gutter-spacing + $sp-5};
62
+ font-size: 14px;
63
+ background-color: $body-background-color;
64
+ transition: padding-left linear #{$transition-duration / 2};
65
+ }
62
66
 
63
67
  &:focus {
64
68
  outline: 0;
65
- box-shadow: none;
66
69
 
67
- + .search-icon {
68
- fill: $link-color;
70
+ + .search-label .search-icon {
71
+ color: $link-color;
69
72
  }
70
73
  }
74
+ }
71
75
 
72
- @include fs-5;
76
+ .search-label {
77
+ position: absolute;
78
+ display: flex;
79
+ height: 100%;
80
+ padding-left: $gutter-spacing-sm;
73
81
 
74
- @include mq(sm) {
75
- @include fs-3;
82
+ @include mq(md) {
83
+ padding-left: $gutter-spacing;
84
+ transition: padding-left linear #{$transition-duration / 2};
76
85
  }
77
86
 
78
- @include mq(md) {
79
- @include fs-2;
87
+ .search-icon {
88
+ width: #{$sp-4 * 1.2};
89
+ height: #{$sp-4 * 1.2};
90
+ align-self: center;
91
+ color: $grey-dk-000;
80
92
  }
81
93
  }
82
94
 
83
- .search-icon {
84
- align-self: center;
85
- margin-right: $sp-2;
86
- fill: $grey-dk-000;
87
- order: 1;
95
+ .search-results {
96
+ position: absolute;
97
+ left: 0;
98
+ display: none;
99
+ width: 100%;
100
+ max-height: calc(100% - #{$sp-10});
101
+ overflow-y: auto;
102
+ background-color: $search-background-color;
103
+ border-bottom-right-radius: $border-radius;
104
+ border-bottom-left-radius: $border-radius;
105
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 3px 10px rgba(0, 0, 0, 0.08);
106
+
107
+ @include mq(md) {
108
+ top: 100%;
109
+ width: $search-results-width;
110
+ max-height: calc(100vh - 200%) !important;
111
+ }
88
112
  }
89
113
 
90
114
  .search-results-list {
91
115
  padding-left: 0;
92
- margin-top: $sp-1;
93
116
  margin-bottom: $sp-1;
94
117
  list-style: none;
95
- @include fs-3;
118
+ @include fs-4;
119
+
120
+ @include mq(md) {
121
+ @include fs-3;
122
+ }
96
123
  }
97
124
 
98
125
  .search-results-list-item {
@@ -100,15 +127,195 @@
100
127
  margin: 0;
101
128
  }
102
129
 
103
- .search-results-link {
130
+ .search-result {
104
131
  display: block;
105
132
  padding-top: $sp-1;
106
133
  padding-right: $sp-3;
107
134
  padding-bottom: $sp-1;
108
135
  padding-left: $sp-3;
109
136
 
110
- &:hover {
111
- color: $body-heading-color;
112
- background-color: darken($body-background-color, 2%);
137
+ &:hover,
138
+ &.active {
139
+ background-color: $feedback-color;
140
+ }
141
+ }
142
+
143
+ .search-result-title {
144
+ display: block;
145
+ padding-top: $sp-2;
146
+ padding-bottom: $sp-2;
147
+
148
+ @include mq(sm) {
149
+ display: inline-block;
150
+ width: 40%;
151
+ padding-right: $sp-2;
152
+ vertical-align: top;
153
+ }
154
+ }
155
+
156
+ .search-result-doc {
157
+ display: flex;
158
+ align-items: center;
159
+ word-wrap: break-word;
160
+
161
+ &.search-result-doc-parent {
162
+ opacity: 0.5;
163
+ @include fs-3;
164
+
165
+ @include mq(md) {
166
+ @include fs-2;
167
+ }
168
+ }
169
+
170
+ .search-result-icon {
171
+ width: $sp-4;
172
+ height: $sp-4;
173
+ margin-right: $sp-2;
174
+ color: $link-color;
175
+ flex-shrink: 0;
176
+ }
177
+
178
+ .search-result-doc-title {
179
+ overflow: auto;
180
+ }
181
+ }
182
+
183
+ .search-result-section {
184
+ margin-left: #{$sp-4 + $sp-2};
185
+ word-wrap: break-word;
186
+ }
187
+
188
+ .search-result-rel-url {
189
+ display: block;
190
+ margin-left: #{$sp-4 + $sp-2};
191
+ overflow: hidden;
192
+ color: $search-result-preview-color;
193
+ text-overflow: ellipsis;
194
+ white-space: nowrap;
195
+ @include fs-1;
196
+ }
197
+
198
+ .search-result-previews {
199
+ display: block;
200
+ padding-top: $sp-2;
201
+ padding-bottom: $sp-2;
202
+ padding-left: $sp-4;
203
+ margin-left: $sp-2;
204
+ color: $search-result-preview-color;
205
+ word-wrap: break-word;
206
+ border-left: $border;
207
+ border-left-color: $border-color;
208
+ @include fs-2;
209
+
210
+ @include mq(sm) {
211
+ display: inline-block;
212
+ width: 60%;
213
+ padding-left: $sp-2;
214
+ margin-left: 0;
215
+ vertical-align: top;
216
+ }
217
+ }
218
+
219
+ .search-result-preview + .search-result-preview {
220
+ margin-top: $sp-1;
221
+ }
222
+
223
+ .search-result-highlight {
224
+ font-weight: bold;
225
+ }
226
+
227
+ .search-no-result {
228
+ padding-top: $sp-2;
229
+ padding-right: $sp-3;
230
+ padding-bottom: $sp-2;
231
+ padding-left: $sp-3;
232
+ @include fs-3;
233
+ }
234
+
235
+ .search-button {
236
+ position: fixed;
237
+ right: $sp-4;
238
+ bottom: $sp-4;
239
+ display: flex;
240
+ width: $sp-9;
241
+ height: $sp-9;
242
+ background-color: $search-background-color;
243
+ border: 1px solid rgba($link-color, 0.3);
244
+ border-radius: #{$sp-9 / 2};
245
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 3px 10px rgba(0, 0, 0, 0.08);
246
+ align-items: center;
247
+ justify-content: center;
248
+ }
249
+
250
+ .search-overlay {
251
+ position: fixed;
252
+ top: 0;
253
+ left: 0;
254
+ z-index: 1;
255
+ width: 0;
256
+ height: 0;
257
+ background-color: rgba(0, 0, 0, 0.3);
258
+ opacity: 0;
259
+ transition: opacity ease $transition-duration, width 0s $transition-duration,
260
+ height 0s $transition-duration;
261
+ }
262
+
263
+ .search-active {
264
+ .search {
265
+ position: fixed;
266
+ top: 0;
267
+ left: 0;
268
+ width: 100%;
269
+ height: 100%;
270
+ padding: 0;
271
+ }
272
+
273
+ .search-input-wrap {
274
+ height: $sp-10;
275
+ border-radius: 0;
276
+
277
+ @include mq(md) {
278
+ width: $search-results-width;
279
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 3px 10px rgba(0, 0, 0, 0.08);
280
+ }
281
+ }
282
+
283
+ .search-input {
284
+ background-color: $search-background-color;
285
+
286
+ @include mq(md) {
287
+ padding-left: #{$sp-4 * 1.25 + $sp-5};
288
+ }
289
+ }
290
+
291
+ .search-label {
292
+ @include mq(md) {
293
+ padding-left: #{$sp-4 * 1.25};
294
+ }
295
+ }
296
+
297
+ .search-results {
298
+ display: block;
299
+ }
300
+
301
+ .search-overlay {
302
+ width: 100%;
303
+ height: 100%;
304
+ opacity: 1;
305
+ transition: opacity ease $transition-duration, width 0s, height 0s;
306
+ }
307
+
308
+ @include mq(md) {
309
+ .main {
310
+ position: fixed;
311
+ }
312
+ }
313
+
314
+ .main-header {
315
+ padding-top: $sp-10;
316
+
317
+ @include mq(md) {
318
+ padding-top: 0;
319
+ }
113
320
  }
114
321
  }
@@ -1,10 +1,9 @@
1
- @function rem($size, $unit:"") {
1
+ @function rem($size, $unit: "") {
2
2
  $remSize: $size / $root-font-size;
3
3
 
4
4
  @if ($unit == false) {
5
5
  @return #{$remSize};
6
- }
7
- @else {
6
+ } @else {
8
7
  @return #{$remSize}rem;
9
8
  }
10
9
  }
@@ -2,11 +2,13 @@
2
2
  // Typography
3
3
  //
4
4
 
5
- $body-font-family: -apple-system, BlinkMacSystemFont, "helvetica neue", helvetica, roboto, noto, "segoe ui", arial, sans-serif !default;
5
+ $body-font-family: -apple-system, BlinkMacSystemFont, "helvetica neue",
6
+ helvetica, roboto, noto, "segoe ui", arial, sans-serif !default;
6
7
  $mono-font-family: "SFMono-Regular", Menlo, Consolas, Monospace !default;
7
- $root-font-size: 16px !default; // Base font-size for rems
8
+ $root-font-size: 16px !default; // Base font-size for rems
8
9
  $body-line-height: 1.4 !default;
9
- $body-heading-line-height: 1.15 !default !default;
10
+ $content-line-height: 1.6 !default;
11
+ $body-heading-line-height: 1.25 !default;
10
12
 
11
13
  //
12
14
  // Colors
@@ -52,27 +54,19 @@ $red-300: #dd2e2e !default;
52
54
 
53
55
  $body-background-color: $white !default;
54
56
  $sidebar-color: $grey-lt-000 !default;
57
+ $search-background-color: $white !default;
58
+ $table-background-color: $white !default;
55
59
  $code-background-color: $grey-lt-000 !default;
60
+ $feedback-color: darken($sidebar-color, 3%) !default;
56
61
 
57
62
  $body-text-color: $grey-dk-100 !default;
58
63
  $body-heading-color: $grey-dk-300 !default;
64
+ $search-result-preview-color: $grey-dk-000 !default;
59
65
  $nav-child-link-color: $grey-dk-100 !default;
60
66
  $link-color: $purple-000 !default;
61
67
  $btn-primary-color: $purple-100 !default;
62
68
  $base-button-color: #f7f7f7 !default;
63
69
 
64
- //
65
- // Media queries in pixels
66
- //
67
-
68
- $media-queries: (
69
- xs: 320px,
70
- sm: 500px,
71
- md: 740px,
72
- lg: 1120px,
73
- xl: 1400px
74
- ) !default;
75
-
76
70
  //
77
71
  // Spacing
78
72
  //
@@ -90,7 +84,7 @@ $spacers: (
90
84
  sp-7: $spacing-unit * 2.5,
91
85
  sp-8: $spacing-unit * 3,
92
86
  sp-9: $spacing-unit * 3.5,
93
- sp-10: $spacing-unit * 4
87
+ sp-10: $spacing-unit * 4,
94
88
  ) !default;
95
89
 
96
90
  $sp-1: map-get($spacers, sp-1) !default; // 0.25 rem == 4px
@@ -101,8 +95,8 @@ $sp-5: map-get($spacers, sp-5) !default; // 1.5 rem == 24px
101
95
  $sp-6: map-get($spacers, sp-6) !default; // 2 rem == 32px
102
96
  $sp-7: map-get($spacers, sp-7) !default; // 2.5 rem == 40px
103
97
  $sp-8: map-get($spacers, sp-8) !default; // 3 rem == 48px
104
- $sp-9: map-get($spacers, sp-9) !default; // 4 rem == 48px
105
- $sp-10: map-get($spacers, sp-10) !default; // 4.5 rem == 48px
98
+ $sp-9: map-get($spacers, sp-9) !default; // 3.5 rem == 56px
99
+ $sp-10: map-get($spacers, sp-10) !default; // 4 rem == 64px
106
100
 
107
101
  //
108
102
  // Borders
@@ -118,13 +112,24 @@ $border-color: $grey-lt-100 !default;
118
112
 
119
113
  $gutter-spacing: $sp-6 !default;
120
114
  $gutter-spacing-sm: $sp-4 !default;
121
- $nav-width: 232px !default;
115
+ $nav-width: 264px !default;
116
+ $nav-width-md: 248px !default;
117
+ $nav-list-item-height: $sp-6 !default;
118
+ $nav-list-item-height-sm: $sp-8 !default;
119
+ $nav-list-expander-right: true;
122
120
  $content-width: 800px !default;
121
+ $header-height: 60px !default;
122
+ $search-results-width: $content-width - $nav-width !default;
123
+ $transition-duration: 400ms;
124
+
125
+ //
126
+ // Media queries in pixels
127
+ //
123
128
 
124
129
  $media-queries: (
125
130
  xs: 320px,
126
131
  sm: 500px,
127
- md: 740px,
128
- lg: 800px,
129
- xl: 1316px
132
+ md: $content-width,
133
+ lg: $content-width + $nav-width,
134
+ xl: 1400px,
130
135
  ) !default;