/
styles.css
818 lines (782 loc) · 18.1 KB
/
styles.css
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';
@import 'nextra/code-highlighting/variables.css';
@import 'nextra/code-highlighting/code-blocks.css';
:root {
--nextra-primary-hue: 212deg;
}
.dark {
--nextra-primary-hue: 204deg;
}
html {
@apply antialiased;
font-size: 16px;
font-feature-settings: 'rlig' 1, 'calt' 1, 'ss01' 1, 'ss06' 1;
-webkit-tap-highlight-color: transparent;
}
body {
@apply w-full bg-white;
}
.dark body {
@apply bg-dark text-gray-100;
}
a {
@apply text-primary-500 underline;
text-underline-position: under;
text-decoration-thickness: from-font;
}
p {
@apply leading-7;
}
p:not(:first-child),
blockquote:not(:first-child),
.table-container:not(:first-child) {
@apply mt-6;
}
.main-container {
min-height: 100vh;
}
.nextra-container {
/* Navbar */
.nextra-nav-container {
a:focus,
summary:focus {
@apply select-none outline-none;
}
a:focus-visible,
summary:focus-visible {
@apply select-none outline-none ring ring-primary-200;
}
.nextra-nav-container-blur {
z-index: -1;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02),
0 -1px 0 rgba(0, 0, 0, 0.06) inset;
.dark & {
box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.1) inset;
}
}
@media (prefers-contrast: more) {
.nextra-nav-container-blur {
box-shadow: 0 0 0 1px black;
.dark & {
box-shadow: 0 0 0 1px white;
}
}
}
@supports (
(-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))
) {
.nextra-nav-container-blur {
backdrop-filter: blur(12px);
@apply bg-opacity-[.85] dark:bg-opacity-80;
}
}
.nextra-nav-link {
@apply text-sm;
}
.nextra-menu-icon {
@apply select-none rounded outline-none;
&:active {
@apply bg-gray-400/20;
}
}
.nextra-menu-icon svg {
g {
transform-origin: center;
}
path {
opacity: 1;
transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1) 0.2s,
opacity 0.2s ease 0.2s;
}
g {
transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}
&.open {
path {
transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1),
opacity 0s ease 0.2s;
}
g {
transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1) 0.2s;
}
}
&.open > {
path {
opacity: 0;
}
g:nth-of-type(1) {
transform: rotate(45deg);
path {
transform: translate3d(0, 6px, 0);
}
}
g:nth-of-type(2) {
transform: rotate(-45deg);
path {
transform: translate3d(0, -6px, 0);
}
}
}
}
}
.nextra-sidebar-container {
mask-image: linear-gradient(to bottom, transparent, #000 20px),
linear-gradient(to left, #000 10px, transparent 10px);
&.with-menu.nextra-scrollbar {
&::-webkit-scrollbar-track {
margin-bottom: 76px;
}
}
}
/* Sidebar */
.nextra-sidebar {
-webkit-touch-callout: none;
ul {
a:focus-visible,
button:focus-visible {
@apply ring ring-primary-200;
}
.active-anchor {
@apply font-semibold text-gray-900;
@apply dark:text-white;
}
li.active > a,
li.active > a:hover {
@apply bg-primary-50 font-bold text-primary-500;
@apply dark:bg-primary-500/10 dark:text-primary-500;
}
@media (prefers-contrast: more) {
li.active > a {
@apply border border-primary-500 dark:border-primary-500;
}
}
button,
summary,
li a {
@apply mt-1 block w-full select-none rounded px-2 py-1.5 text-left text-sm text-gray-500 no-underline outline-none transition-[background-color];
@apply dark:text-neutral-500;
-webkit-tap-highlight-color: transparent;
-webkit-touch-callout: none;
&:hover {
@apply bg-gray-100 text-gray-900;
@apply dark:bg-primary-100/5 dark:text-gray-50;
}
@media (prefers-contrast: more) {
& {
@apply border border-transparent text-gray-900;
&:hover {
@apply border-gray-900;
}
}
.dark & {
@apply border border-transparent text-gray-50;
&:hover {
@apply border-gray-50;
}
}
}
}
ul {
@apply relative;
padding-left: 0.75rem;
margin-left: 0.75rem;
background-image: linear-gradient(
to right,
#e5e7eb 1px,
transparent 1px
);
.dark & {
background-image: linear-gradient(
to right,
rgba(224, 243, 255, 0.1) 1px,
transparent 1px
);
}
background-size: 1px calc(100% - 12px);
background-position: 0 6px;
background-repeat: no-repeat;
}
}
.locale .menu {
@apply right-0;
}
.nextra-sidebar-search {
@apply sticky top-0 -mt-4 bg-white pt-4 dark:bg-dark;
box-shadow: 0 2px 14px 6px white;
z-index: 1;
.dark & {
box-shadow: 0 2px 14px 6px #111;
}
}
.nextra-sidebar-menu {
@apply sticky bottom-0;
@media (prefers-contrast: more) {
& {
box-shadow: none;
border-top: 1px solid #999;
}
}
}
}
.nextra-scrollbar {
scrollbar-gutter: stable;
&::-webkit-scrollbar {
width: 6px;
}
&::-webkit-scrollbar-track {
margin-top: 20px;
margin-bottom: 16px;
background-color: transparent;
}
&::-webkit-scrollbar-thumb {
box-shadow: inset 0 0 0 5px rgba(128, 128, 128, 0);
border-radius: 20px;
}
&:hover {
&::-webkit-scrollbar-thumb {
box-shadow: inset 0 0 0 5px rgba(128, 128, 128, 0.2);
&:hover {
box-shadow: inset 0 0 0 5px rgba(128, 128, 128, 0.4);
}
}
}
}
}
@media (max-width: 767px) {
article:before {
content: '';
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: -200px;
pointer-events: none;
transition: opacity 1.5s ease;
opacity: 0;
z-index: 14;
background-color: black;
.nextra-container.menu-active & {
opacity: 0.8;
}
}
.nextra-sidebar-container {
@apply top-0 overscroll-contain bg-white pt-16 dark:bg-dark;
height: 100vh;
height: -webkit-fill-available;
opacity: 0;
transform: translate3d(0, -110%, 0);
transition: transform 0.8s cubic-bezier(0.52, 0.16, 0.04, 1),
opacity 0s linear 1s;
will-change: transform, opacity;
contain: layout style;
backface-visibility: hidden;
&.open {
opacity: 1;
transform: translate3d(0, 0, 0);
transition: transform 0.8s cubic-bezier(0.52, 0.16, 0.04, 1);
}
body.resizing & {
transition: none;
}
}
.nextra-banner-container ~ div {
.nextra-sidebar-container {
@apply pt-[6.5rem];
}
&.nextra-nav-container {
@apply top-10 md:top-0;
}
}
.nextra-banner-hidden .nextra-banner-container ~ div {
.nextra-sidebar-container {
@apply pt-16;
}
}
.nextra-banner-hidden div.nextra-nav-container {
@apply top-0;
}
.nextra-container {
.nextra-scrollbar {
scrollbar-gutter: auto;
}
}
}
@media (prefers-reduced-motion: reduce) and (max-width: 767px) {
article:before {
transition: none;
}
.nextra-sidebar-container {
transition: none;
&.open {
transition: none;
}
}
}
@media (prefers-contrast: more) {
.nextra-toc-meta {
box-shadow: none;
border-top: 1px solid #999 !important;
a {
@apply text-gray-800 dark:!text-gray-50;
}
}
article h2 {
border-color: #999 !important;
}
.nextra-nav-container nav .nextra-nav-link {
@apply text-gray-700 dark:text-gray-100;
&.active {
@apply font-bold;
}
}
article pre {
@apply border border-primary-900/20 contrast-150 dark:border-primary-100/40;
}
.nextra-callout {
@apply border-current dark:!border-current;
}
.nextra-search {
input {
box-shadow: 0 0 0 1px !important;
}
input::placeholder {
@apply !text-gray-600 dark:!text-gray-400;
}
kbd {
@apply border-gray-900 text-gray-900 dark:border-gray-100 dark:text-gray-100;
}
ul {
@apply border border-gray-900 dark:border-gray-50;
div.nextra-search-section {
@apply border-gray-600 text-gray-900 dark:border-gray-50 dark:text-gray-50;
}
li {
@apply border border-transparent;
.excerpt {
@apply dark:text-gray-50;
}
}
li.active {
@apply border border-primary-500;
}
}
}
.nextra-navigation-links {
border-color: #999 !important;
}
.nextra-breadcrumb {
@apply text-current;
.active {
@apply font-bold !text-current;
}
}
.nextra-toc ul li a {
@apply text-gray-900 underline dark:text-gray-50;
&[aria-selected='true'] {
@apply text-primary-500;
}
}
}
/* Content Typography */
.nextra-body {
&.full {
width: 100%;
&.expand {
width: 100vw;
margin: 0 calc(50% - 50vw);
}
}
}
article {
min-height: calc(100vh - 64px);
h1 {
@apply mt-2 text-4xl font-bold tracking-tight;
}
h2 {
@apply mt-10 text-3xl font-semibold tracking-tight;
@apply border-b pb-1;
.dark & {
@apply border-primary-100/10;
}
}
h3 {
@apply mt-8 text-2xl font-semibold tracking-tight;
}
h4 {
@apply mt-8 text-xl font-semibold tracking-tight;
}
h5 {
@apply mt-8 text-lg font-semibold tracking-tight;
}
h6 {
@apply mt-8 text-base font-semibold tracking-tight;
}
ul {
@apply ml-6 mt-6 list-disc;
&:first-child {
@apply mt-0;
}
}
li {
@apply my-2;
}
ol {
@apply ml-6 mt-6 list-decimal;
}
blockquote {
@apply border-l-2 border-gray-300 pl-6 italic text-gray-700;
@apply dark:border-gray-700 dark:text-gray-400;
}
h2 a {
@apply no-underline;
}
a {
@apply ring-primary-500/30 focus:outline-none focus-visible:ring;
}
hr {
@apply my-8;
.dark & {
@apply border-gray-900;
}
}
details {
@apply my-4 rounded border border-gray-200 bg-white p-2 shadow-sm;
.dark & {
@apply border-neutral-800 bg-neutral-900;
}
&:first-child {
@apply mt-0;
}
&:last-child {
@apply mb-0;
}
.nextra-collapse-content {
@apply p-2;
}
}
summary {
@apply cursor-pointer rounded p-1 outline-none transition-colors;
&:hover {
@apply bg-gray-100;
}
.dark &:hover {
@apply bg-neutral-800;
}
&::-webkit-details-marker {
display: none;
}
}
details > summary {
list-style-type: none;
&::before {
content: '';
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z' clip-rule='evenodd' /%3E%3C/svg%3E");
height: 1.2em;
width: 1.2em;
margin-right: 0.125em;
vertical-align: -4px;
@apply inline-block transition-transform;
}
.dark &::before {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z' clip-rule='evenodd' /%3E%3C/svg%3E");
}
}
details[data-open] > summary {
list-style-type: none;
&::before {
@apply rotate-90;
}
}
.subheading-anchor {
margin-top: -84px;
display: inline-block;
position: absolute;
width: 1px;
}
.subheading-anchor + a:hover .anchor-icon {
@apply opacity-100;
}
.subheading-anchor:target + a .anchor-icon {
@apply text-gray-400 opacity-100 dark:text-neutral-500;
}
.anchor-icon {
@apply absolute select-none pl-2 text-gray-300 opacity-0 transition-opacity dark:text-neutral-700;
}
&.nextra-body-typesetting-article {
font-size: 17px;
font-feature-settings: 'rlig' 1, 'calt' 1;
h1 {
@apply mt-6 mb-4 text-center;
font-size: 2.5rem;
}
h2 {
@apply border-none;
}
a:not(.anchor) {
@apply no-underline hover:underline;
}
p {
@apply leading-8;
}
code {
@apply border-none dark:bg-neutral-700;
}
pre code {
@apply dark:bg-transparent;
}
.anchor-icon {
display: none;
}
}
}
.nextra-toc {
.nextra-toc-content {
mask-image: linear-gradient(to bottom, transparent, #000 20px),
linear-gradient(to left, #000 10px, transparent 10px);
}
ul {
@apply m-0 list-none break-words;
hyphens: auto;
&:first-child {
@apply mt-0;
}
}
li {
@apply my-2;
}
}
/* Search */
.nextra-search {
input {
@apply bg-black/[.03] text-sm text-gray-900;
@apply dark:bg-gray-50/10 dark:text-gray-300;
@apply dark:border-gray-800;
}
input::placeholder {
@apply text-gray-400;
@apply dark:text-gray-500;
}
&.nextra-flexsearch ul {
@apply left-0 overflow-auto md:-left-80 md:right-0;
min-height: 100px;
max-height: min(calc(100vh - 5rem - env(safe-area-inset-bottom)), 400px);
max-width: min(calc(100vw - 2rem), calc(100% + 20rem));
transition: max-height 0.2s ease;
width: 100vw;
}
ul {
a {
scroll-margin: 50px;
}
/* Using bg-white as background-color when the browser didn't support backdrop-filter */
@apply bg-white text-gray-100 ring-1 ring-black/5;
li {
@apply mx-2.5 break-words rounded-md px-2.5 py-2 text-gray-800;
.highlight {
@apply text-primary-500 underline decoration-primary-400;
}
}
li.active,
a:focus li {
@apply bg-primary-400/10 text-primary-500;
}
.nextra-search-section {
@apply border-b border-black/10;
.dark & {
@apply border-b border-white/20;
}
}
}
.dark & {
/* Using bg-white as background-color when the browser didn't support backdrop-filter */
ul {
@apply bg-neutral-900 text-gray-100 ring-white/10;
li {
@apply text-gray-300;
.highlight {
@apply text-primary-500 underline decoration-primary-400;
}
}
li.active,
a:focus li {
@apply bg-primary-500/10 text-primary-500;
}
}
}
@supports (
(-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))
) {
ul {
backdrop-filter: blur(16px);
@apply bg-opacity-70;
}
.dark & {
ul {
@apply bg-opacity-80;
}
}
}
}
@media screen and (max-width: 767px) {
.nextra-search .excerpt {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
line-clamp: 1;
-webkit-box-orient: vertical;
}
.nextra-search.nextra-flexsearch ul {
max-height: min(calc(50vh - 11rem - env(safe-area-inset-bottom)), 400px);
}
}
.search-overlay {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
input[type='search']::-webkit-search-decoration,
input[type='search']::-webkit-search-cancel-button,
input[type='search']::-webkit-search-results-button,
input[type='search']::-webkit-search-results-decoration {
-webkit-appearance: none;
}
/* Locale */
.locale-switch summary::-webkit-details-marker {
content: '';
display: none;
}
.locale-switch summary::marker {
content: '';
display: none;
}
.locale-switch[open] summary:before {
content: ' ';
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 10;
display: block;
cursor: default;
background: transparent;
}
.locale-switch .locale-dropdown {
position: absolute;
z-index: 11;
}
/* Table */
table {
@apply mt-2 p-0;
&:first-child {
@apply mt-0;
}
}
table tr {
@apply m-0 border-t border-gray-300 p-0;
@apply dark:border-gray-600;
}
table tr:nth-child(2n) {
@apply bg-gray-100;
@apply dark:bg-gray-600/20;
}
table tr th {
@apply font-semibold;
}
table tr th[align='center'],
table tr td[align='center'] {
@apply text-center;
}
table tr th[align='right'],
table tr td[align='right'] {
@apply text-right;
}
table tr th,
table tr td {
@apply text-left;
@apply m-0 border border-gray-300 px-4 py-2;
@apply dark:border-gray-600;
}
.table-container {
overflow: auto;
}
.contains-task-list {
@apply ml-0 list-none;
}
.contains-task-list input[type='checkbox'] {
@apply mr-1;
}
/* RTL */
.nextra-container.rtl {
direction: rtl;
.nextra-sidebar ul ul {
@apply mr-5 ml-0;
}
.nextra-sidebar button,
.nextra-sidebar a {
@apply text-right;
}
article blockquote {
@apply border-r-2 border-l-0 pr-6 pl-0;
}
}
.nextra-container:not(.rtl):not(.page) article {
}
.nextra-container.rtl:not(.page) article {
}
@screen md {
.nextra-container:not(.page) article .bleed.full {
margin-left: calc(-50vw + 50% + 8rem);
margin-right: calc(-50vw + 50% + 8rem);
}
.nextra-container.page article .bleed.full {
margin-left: calc(-50vw + 50%);
margin-right: calc(-50vw + 50%);
}
}
@screen xl {
.nextra-container:not(.rtl):not(.page) article .bleed.full {
margin-left: calc(50% - 50vw + 16rem);
margin-right: calc(50% - 50vw);
}
.nextra-container.rtl:not(.page) article .bleed.full {
margin-left: calc(50% - 50vw);
margin-right: calc(50% - 50vw + 16rem);
}
.nextra-container.page article .bleed.full {
margin-left: calc(50% - 50vw);
margin-right: calc(50% - 50vw);
}
}
.nextra-container.rtl {
code {
direction: ltr;
}
.anchor-icon {
@apply ml-0 mr-2 inline-block;
}
article ul,
article ol {
@apply ml-0 mr-6;
}
.nextra-sidebar {
@apply md:border-l;
}
}
/* Hide scrollbar for Chrome, Safari and Opera */
.no-scrollbar::-webkit-scrollbar {
display: none;
}
/* Hide scrollbar for IE, Edge and Firefox */
.no-scrollbar {
-ms-overflow-style: none; /* IE and Edge */
scrollbar-width: none; /* Firefox */
}
.nextra-banner-hidden .nextra-banner-container {
display: none;
}