RFC6901 JSON Pointer implementation in OCaml using jsont
1@charset "UTF-8";
2/* Copyright (c) 2016 The odoc contributors. All rights reserved.
3 Distributed under the ISC license, see terms at the end of the file.
4 odoc 3.1.0 */
5
6/* Fonts */
7/* noticia-text-regular - latin */
8@font-face {
9 font-family: 'Noticia Text';
10 font-style: normal;
11 font-weight: 400;
12 src: url('fonts/noticia-text-v15-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
13}
14
15/* noticia-text-italic - latin */
16@font-face {
17 font-family: 'Noticia Text';
18 font-style: italic;
19 font-weight: 400;
20 src: url('fonts/noticia-text-v15-latin-italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
21}
22
23/* noticia-text-700 - latin */
24@font-face {
25 font-family: 'Noticia Text';
26 font-style: normal;
27 font-weight: 700;
28 src: url('fonts/noticia-text-v15-latin-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
29}
30
31/* fira-mono-regular - latin */
32@font-face {
33 font-family: 'Fira Mono';
34 font-style: normal;
35 font-weight: 400;
36 src: url('fonts/fira-mono-v14-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
37}
38
39/* fira-mono-500 - latin */
40@font-face {
41 font-family: 'Fira Mono';
42 font-style: normal;
43 font-weight: 500;
44 src: url('fonts/fira-mono-v14-latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
45}
46
47/* fira-sans-regular - latin */
48@font-face {
49 font-family: 'Fira Sans';
50 font-style: normal;
51 font-weight: 400;
52 src: url('fonts/fira-sans-v17-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
53}
54
55/* fira-sans-italic - latin */
56@font-face {
57 font-family: 'Fira Sans';
58 font-style: italic;
59 font-weight: 400;
60 src: url('fonts/fira-sans-v17-latin-italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
61}
62
63/* fira-sans-500 - latin */
64@font-face {
65 font-family: 'Fira Sans';
66 font-style: normal;
67 font-weight: 500;
68 src: url('fonts/fira-sans-v17-latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
69}
70
71/* fira-sans-500italic - latin */
72@font-face {
73 font-family: 'Fira Sans';
74 font-style: italic;
75 font-weight: 500;
76 src: url('fonts/fira-sans-v17-latin-500italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
77}
78
79/* fira-sans-700 - latin */
80@font-face {
81 font-family: 'Fira Sans';
82 font-style: normal;
83 font-weight: 700;
84 src: url('fonts/fira-sans-v17-latin-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
85}
86
87/* fira-sans-700italic - latin */
88@font-face {
89 font-family: 'Fira Sans';
90 font-style: italic;
91 font-weight: 700;
92 src: url('fonts/fira-sans-v17-latin-700italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
93}
94
95
96:root,
97.light:root {
98
99 scroll-padding-top: calc(var(--search-bar-height) + var(--search-padding-top) + 1em);
100
101 /* light gruvbox theme colors */
102 --bg_h: #f9f5d7;
103 --bg: #f6f8fa; /*#fbf1c7;*/
104 --bg_s: #f2e5bc;
105 --bg1: #ebdbb2;
106 --bg2: #d5c4a1;
107 --bg3: #bdae93;
108 --bg4: #a89984;
109
110 --fg: #282828;
111 --fg1: #3c3836;
112 --fg2: #504945;
113 --fg3: #665c54;
114 --fg4: #7c6f64;
115
116 --red: #9d0006;
117 --green: #79740e;
118 --yellow: #b57614;
119 --blue: #076678;
120 --purple: #8f3f71;
121 --aqua: #427b58;
122 --orange: #af3a03;
123 --gray: #928374;
124
125 --red-dim: #cc2412;
126 --green-dim: #98971a;
127 --yellow-dim: #d79921;
128 --blue-dim: #458598;
129 --purple-dim: #b16286;
130 --aqua-dim: #689d6a;
131 --orange-dim: #d65d0e;
132 --gray-dim: #7c6f64;
133
134 /* odoc colors */
135 --odoc-blue: #5c9cf5;
136 --odoc-bg: #FFFFFF;
137 --odoc-bg1: #f6f8fa;
138 --odoc-fg: #333333;
139 --odoc-fg1: #1F2D3D;
140
141}
142
143@media (prefers-color-scheme: dark) {
144 :root {
145 /* dark gruvbox theme colors */
146 --bg_h: #1d2021;
147 --bg: #282828;
148 --bg_s: #32302f;
149 --bg1: #3c3836;
150 --bg2: #504945;
151 --bg3: #665c54;
152 --bg4: #7c6f64;
153
154 --fg: #fbf1c7;
155 --fg1: #ebdbb2;
156 --fg2: #d5c4a1;
157 --fg3: #bdae93;
158 --fg4: #a89984;
159
160 --red: #fb4934;
161 --green: #b8bb26;
162 --yellow: #fabd2f;
163 --blue: #83a598;
164 --purple: #d3869b;
165 --aqua: #8ec07c;
166 --gray: #928374;
167 --orange: #fe8019;
168
169 --red-dim: #cc2412;
170 --green-dim: #98971a;
171 --yellow-dim: #d79921;
172 --blue-dim: #458588;
173 --purple-dim: #b16286;
174 --aqua-dim: #689d6a;
175 --gray-dim: #a89984;
176 --orange-dim: #d65d0e;
177
178 /* odoc colors */
179 --odoc-blue: #5c9cf5;
180 --odoc-bg: #202020;
181 --odoc-bg1: #252525;
182 --odoc-fg: #bebebe;
183 --odoc-fg1: #777;
184 }
185}
186
187:root {
188 --main-background: var(--odoc-bg);
189 --color: var(--odoc-fg);
190 --anchor-hover: var(--fg1);
191 --anchor-color: var(--bg2);
192 --xref-shadow: var(--red-dim);
193 --xref-unresolved: var(--blue-dim);
194 --header-shadow: var(--bg3);
195 --by-name-version-color: var(--bg4);
196 --by-name-nav-link-color: var(--fg2);
197 --target-background: color-mix(in srgb, var(--main-background) 70%, var(--odoc-blue) 30%);
198 --target-border: var(--odoc-blue);
199 --pre-border-color: var(--fg4);
200 --link-color: var(--odoc-blue);
201 --source-link-color: var(--fg4);
202
203
204 --toc-color: var(--fg);
205 --toc-before-color: var(--odoc-fg1);
206 --toc-background: var(--odoc-bg1);
207 --toc-list-border: var(--fg1);
208
209 --hljs-bg: var(--code-background);
210 --hljs-link: var(--fg2);
211 --source-code-keyword: var(--orange);
212 --hljs-regexp: var(--yellow);
213 --hljs-title: var(--yellow-dim);
214
215 --spec-label-color: var(--aqua);
216 --spec-summary-background: var(--code-background);
217 --spec-summary-border-color: var(--odoc-blue);
218 --spec-summary-hover-background: var(--odoc-bg1);
219 --spec-details-after-background: var(--odoc-bg1);
220 --spec-details-after-border: var(--fg3);
221 --search-results-border: var(--fg1);
222 --search-results-shadow: var(--bg3);
223 --search-highlight-color: var(--odoc-blue);
224 --search-snake-color: var(--odoc-blue);
225 /* code colors */
226 --code-color: var(--fg);
227 --code-background: var(--bg);
228 --li-code-background: var(--bg);
229 --li-code-color: var(--fg);
230
231
232 --source-line-column: var(--fg3);
233 --source-line-column-bg: var(--bg_h);
234
235 --source-code-comment: var(--gray);
236 --source-code-docstring: var(--green-dim);
237 --source-code-lident: var(--fg1);
238 --source-code-uident: var(--blue);
239 --source-code-literal: var(--yellow);
240 --source-code-keyword: var(--red);
241 --source-code-underscore: var(--fg3);
242 --source-code-operator: var(--purple);
243 --source-code-parens: var(--orange-dim);
244 --source-code-separator: var(--orange-dim);
245
246 --hljs-variable: var(--yellow);
247 --hljs-literal: var(--red);
248 --hljs-name: var(--green-dim);
249 --hljs-tag: var(--fg4);
250 --hljs-attr: var(--purple);
251 --hljs-addition: var(--green-dim);
252 --hljs-addition-bg: color-mix(in srgb, var(--hljs-addition) 10%, var(--hljs-bg) 90%);
253 --hljs-deletion: var(--red-dim);
254 --hljs-deletion-bg: color-mix(in srgb, var(--hljs-deletion) 10%, var(--hljs-bg) 90%);
255
256
257
258}
259
260/* Reset a few things. */
261
262html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
263 padding: 0;
264 border: 0;
265 font: inherit;
266 vertical-align: baseline;
267
268}
269
270table {
271 border-collapse: collapse;
272 border-spacing: 0;
273}
274
275*, *:before, *:after {
276 box-sizing: border-box;
277}
278
279html {
280 font-size: 15px;
281 scroll-behavior: smooth;
282}
283
284body {
285 text-align: left;
286 color: var(--color);
287 background-color: var(--main-background);
288 font-family: "Noticia Text", Georgia, serif;
289 line-height: 1.5;
290}
291
292body {
293 margin-left: auto;
294 margin-right: auto;
295 padding: 0 4ex;
296 margin-top: 0;
297}
298
299body.odoc {
300 max-width: 181ex;
301 display: grid;
302 grid-template-columns: min-content 1fr min-content;
303 grid-template-areas:
304 "search-bar nav ."
305 "toc-global preamble toc-local"
306 "toc-global content toc-local";
307 column-gap: 4ex;
308 grid-template-rows: auto auto 1fr;
309}
310
311body.odoc:has(> .odoc-search:focus-within) {
312 grid-template-areas:
313 "search-bar search-bar search-bar"
314 ". nav ."
315 "toc-global preamble toc-local"
316 "toc-global content toc-local";
317}
318
319body.odoc:not(:has(> .odoc-tocs .odoc-global-toc)) {
320 grid-template-areas:
321 "search-bar search-bar"
322 "nav ."
323 "preamble toc-local"
324 "content toc-local";
325 grid-template-columns: 1fr min-content;
326}
327
328/* When there is no global sidebar */
329body.odoc:not(:has(> .odoc-tocs .odoc-global-toc)) nav.odoc-nav {
330 padding-top: 0;
331}
332
333/* When there is no global sidebbar and the searchbar is focused */
334body.odoc:not(:has(> .odoc-tocs .odoc-global-toc)) nav.odoc-nav:has(+ .odoc-search:focus-within) {
335 padding-top: var(--search-padding-top);
336}
337
338nav.odoc-nav:has(+ .odoc-search:focus-within) {
339 padding-top: 0;
340}
341
342body.odoc-src {
343 display: grid;
344 grid-template-columns: min-content 1fr;
345 grid-template-areas:
346 "search-bar nav "
347 "toc-global preamble"
348 "toc-global content ";
349 column-gap: 4ex;
350 grid-template-rows: auto auto 1fr;
351}
352
353.odoc-content {
354 grid-area: content;
355}
356
357.odoc-content > *:first-child {
358 margin-top: 0;
359}
360
361.odoc-preamble > *:first-child {
362 /* This make the first thing in the preamble align with the sidebar */
363 padding-top: 0;
364 margin-top: 0;
365}
366
367/* Add margin after the preamble if it contains more than one element. */
368header.odoc-preamble:has(> :nth-child(2)) {
369 margin-bottom: 30px;
370}
371
372header.odoc-preamble {
373 grid-area: preamble;
374}
375
376nav {
377 font-family: "Fira Sans", sans-serif;
378}
379
380nav.odoc-nav {
381 grid-area: nav;
382 padding-top: var(--search-padding-top);
383 padding-bottom: var(--search-padding-top);
384}
385
386/* Basic markup elements */
387
388b, strong {
389 font-weight: bold;
390}
391
392i {
393 font-style: italic;
394}
395
396em, i em.odd{
397 font-style: italic;
398}
399
400em.odd, i em {
401 font-style: normal;
402}
403
404sup {
405 vertical-align: super;
406}
407
408sub {
409 vertical-align: sub;
410}
411
412sup, sub {
413 font-size: 12px;
414 line-height: 0;
415 margin-left: 0.2ex;
416}
417
418ul, ol {
419 list-style-position: outside
420}
421
422ul>li {
423 margin-left: 22px;
424}
425
426ol>li {
427 margin-left: 27.2px;
428}
429
430li>*:first-child {
431 margin-top: 0
432}
433
434/* Text alignements, this should be forbidden. */
435
436.left {
437 text-align: left;
438}
439
440.right {
441 text-align: right;
442}
443
444.center {
445 text-align: center;
446}
447
448/* Links and anchors */
449
450a {
451 text-decoration: none;
452 color: var(--link-color);
453}
454
455.odoc-src pre a {
456 color: inherit;
457}
458
459a:hover:not(.img-link) {
460 box-shadow: 0 1px 0 0 var(--link-color);
461}
462
463/* Linked highlight */
464*:target, .current_unit {
465 background-color: var(--target-background) !important;
466 border-radius: 1px;
467 border: var(--target-border) 1px solid !important;
468}
469
470*:hover > a.anchor {
471 visibility: visible;
472}
473
474a.anchor:before {
475 content: "#";
476}
477
478a.anchor:hover {
479 box-shadow: none;
480 text-decoration: none;
481 color: var(--anchor-hover);
482}
483
484a.anchor {
485 visibility: hidden;
486 position: absolute;
487 /* top: 0px; */
488 /* margin-left: -3ex; */
489 margin-left: -1.3em;
490 font-weight: normal;
491 font-style: normal;
492 padding-right: 0.4em;
493 padding-left: 0.4em;
494 /* To remain selectable */
495 color: var(--anchor-color);
496}
497
498.spec > a.anchor {
499 margin-left: -2.3em;
500 padding-right: 0.9em;
501}
502
503.xref-unresolved {
504 color: var(--xref-unresolved);
505}
506.xref-unresolved:hover {
507 box-shadow: 0 1px 0 0 var(--xref-shadow);
508}
509
510/* Source links float inside preformated text or headings. */
511a.source_link {
512 float: right;
513 color: var(--source-link-color);
514 font-family: "Fira Sans", sans-serif;
515 font-size: initial;
516}
517
518/* Section and document divisions.
519 Until at least 4.03 many of the modules of the stdlib start at .h7,
520 we restart the sequence there like h2 */
521
522h1, h2, h3, h4, h5, h6, .h7, .h8, .h9, .h10 {
523 font-family: "Fira Sans", sans-serif;
524 font-weight: 400;
525 padding-top: 0.1em;
526 line-height: 1.2;
527 overflow-wrap: break-word;
528}
529
530.odoc-preamble h1 {
531 margin-top: 10px;
532}
533
534h1 {
535 font-weight: 500;
536 font-size: 2.441em;
537}
538
539h1 {
540 font-weight: 500;
541 font-size: 1.953em;
542 box-shadow: 0 1px 0 0 var(--header-shadow);
543}
544
545h2 {
546 font-size: 1.563em;
547}
548
549h3 {
550 font-size: 1.25em;
551}
552
553small, .font_small {
554 font-size: 0.8em;
555}
556
557h1 code, h1 tt {
558 font-size: inherit;
559 font-weight: inherit;
560}
561
562h2 code, h2 tt {
563 font-size: inherit;
564 font-weight: inherit;
565}
566
567h3 code, h3 tt {
568 font-size: inherit;
569 font-weight: inherit;
570}
571
572h3 code, h3 tt {
573 font-size: inherit;
574 font-weight: inherit;
575}
576
577h4 {
578 font-size: 1.12em;
579}
580
581/* Comment delimiters, hidden but accessible to screen readers and
582 selected for copy/pasting */
583
584/* Taken from bootstrap */
585/* See also https://stackoverflow.com/a/27769435/4220738 */
586.comment-delim {
587 position: absolute;
588 width: 1px;
589 height: 1px;
590 padding: 0;
591 margin: -1px;
592 overflow: hidden;
593 clip: rect(0, 0, 0, 0);
594 white-space: nowrap;
595 border: 0;
596}
597
598/* Preformatted and code */
599
600tt, code, pre {
601 font-family: "Fira Mono", monospace;
602 font-weight: 400;
603}
604
605.odoc pre {
606 padding: 0.1em;
607 border: 1px solid var(--pre-border-color);
608 border-radius: 5px;
609 overflow-x: auto;
610 text-indent: initial;
611}
612
613.odoc p code,
614.odoc li code {
615 background-color: var(--li-code-background);
616 color: var(--li-code-color);
617 border-radius: 3px;
618 padding: 0 0.3ex;
619}
620
621p a > code, li a > code {
622 color: var(--link-color);
623}
624
625.odoc code {
626 white-space: pre-wrap;
627}
628
629/* Code blocks (e.g. Examples) */
630
631.odoc pre code {
632 font-size: 0.893rem;
633}
634
635/* Code lexemes */
636
637.keyword {
638 font-weight: 500;
639}
640
641.arrow { white-space: nowrap }
642
643/* Module member specification */
644
645.spec {
646 background-color: var(--spec-summary-background);
647 border-radius: 3px;
648 border-left: 4px solid var(--spec-summary-border-color);
649 border-right: 5px solid transparent;
650 padding: 0.35em 0.5em;
651}
652
653.spec .label, .spec .optlabel {
654 color: var(--spec-label-color);
655}
656
657li:not(:last-child) > .def-doc {
658 margin-bottom: 15px;
659}
660
661/* Spacing between items */
662div.odoc-spec,.odoc-include {
663 margin-bottom: 2em;
664}
665
666.spec.type .variant p, .spec.type .record p {
667 margin: 5px;
668}
669
670.spec.type .variant, .spec.type .record {
671 margin-left: 2ch;
672}
673
674.spec.type li.variant, .spec.type li.record {
675 list-style: none;
676}
677
678.spec.type .record > code, .spec.type .variant > code {
679 min-width: 40%;
680}
681
682.spec.type > ol {
683 margin-top: 0;
684 margin-bottom: 0;
685}
686
687.spec.type .record > .def-doc, .spec.type .variant > .def-doc {
688 min-width:50%;
689 padding: 0.25em 0.5em;
690 margin-left: 10%;
691 border-radius: 3px;
692 background: var(--main-background);
693 box-shadow: 1px 1px 2px lightgrey;
694}
695
696div.def {
697 margin-top: 0;
698 text-indent: -2ex;
699 padding-left: 2ex;
700}
701
702div.def-doc>*:first-child {
703 margin-top: 0;
704}
705
706/* Collapsible inlined include and module */
707
708.odoc-include details {
709 position: relative;
710}
711
712.odoc-include.shadowed-include {
713 display: none;
714}
715
716.odoc-include details:after {
717 z-index: -100;
718 display: block;
719 content: " ";
720 position: absolute;
721 border-radius: 0 1ex 1ex 0;
722 right: -20px;
723 top: 1px;
724 bottom: 1px;
725 width: 15px;
726 background: var(--spec-details-after-background, rgba(0, 4, 15, 0.05));
727 box-shadow: 0 0px 0 1px var(--spec-details-after-border, rgba(204, 204, 204, 0.53));
728}
729
730.odoc-include summary {
731 position: relative;
732 margin-bottom: 1em;
733 cursor: pointer;
734 outline: none;
735}
736
737.odoc-include summary:hover {
738 background-color: var(--spec-summary-hover-background);
739}
740
741/* FIXME: Does not work in Firefox. */
742.odoc-include summary::-webkit-details-marker {
743 color: #888; /* todo : use color from palette */
744 transform: scaleX(-1);
745 position: absolute;
746 top: calc(50% - 5px);
747 height: 11px;
748 right: -29px;
749}
750
751/* Records and variants FIXME */
752
753div.def table {
754 text-indent: 0em;
755 padding: 0;
756 margin-left: -2ex;
757}
758
759td.def {
760 padding-left: 2ex;
761}
762
763td.def-doc *:first-child {
764 margin-top: 0em;
765}
766
767/* Lists of @tags */
768
769.at-tags { list-style-type: none; margin-left: -3ex; }
770.at-tags li { padding-left: 3ex; text-indent: -3ex; }
771.at-tags .at-tag { text-transform: capitalize }
772
773/* Alert emoji */
774
775.alert::before, .deprecated::before {
776 content: '⚠️ ' / '';
777}
778
779/* Since emoji */
780
781.since::before {
782 content: '🕚 ' / '';
783}
784
785/* Lists of modules */
786
787.modules { list-style-type: none; margin-left: -3ex; }
788.modules li { padding-left: 3ex; text-indent: -3ex; margin-top: 5px }
789.modules .synopsis { padding-left: 1ch; }
790
791/* Odig package index */
792
793.packages { list-style-type: none; margin-left: -3ex; }
794.packages li { padding-left: 3ex; text-indent: -3ex }
795.packages li a.anchor { padding-right: 0.5ch; padding-left: 3ch; }
796.packages .version { font-size: 10px; color: var(--by-name-version-color); }
797.packages .synopsis { padding-left: 1ch }
798
799.by-name nav a {
800 text-transform: uppercase;
801 font-size: 18px;
802 margin-right: 1ex;
803 color: var(--by-name-nav-link-color,);
804 display: inline-block;
805}
806
807.by-tag nav a {
808 margin-right: 1ex;
809 color: var(--by-name-nav-link-color);
810 display: inline-block;
811}
812
813.by-tag ol { list-style-type: none; }
814.by-tag ol.tags li { margin-left: 1ch; display: inline-block }
815.by-tag td:first-child { text-transform: uppercase; }
816
817/* Odig package page */
818
819.package nav, h1 nav {
820 display: inline;
821 font-size: 14px;
822 font-weight: normal;
823}
824
825.package .version, h1 .version {
826 font-size: 14px;
827}
828
829.package.info {
830 margin: 0;
831}
832
833.package.info td:first-child {
834 font-style: italic;
835 padding-right: 2ex;
836}
837
838.package.info ul {
839 list-style-type: none;
840 display: inline;
841 margin: 0;
842}
843
844.package.info li {
845 display: inline-block;
846 margin: 0;
847 margin-right: 1ex;
848}
849
850#info-authors li, #info-maintainers li {
851 display: block;
852}
853
854/* Sidebar and TOC */
855
856.odoc-toc:before {
857 display: block;
858 content: "Contents";
859 text-transform: uppercase;
860 font-size: 1em;
861 margin: 1.414em 0 0.5em;
862 font-weight: 500;
863 color: var(--toc-before-color);
864 line-height: 1.2;
865}
866
867.odoc-toc.odoc-local-toc:has(~ .odoc-global-toc):before {
868 content: "Local content";
869
870}
871.odoc-toc.odoc-global-toc:has(~ .odoc-local-toc):before {
872 content: "Global content";
873}
874
875/* When a search bar is present, we need the sticky sidebar to be a bit lower,
876 so `top` is higher */
877
878body.odoc:has( .odoc-search) .odoc-toc {
879 --toc-top: calc(var(--search-bar-height) + 2 * var(--search-padding-top));
880 max-height: calc(100vh - 2 * var(--toc-top));
881 top: var(--toc-top)
882}
883
884.odoc-tocs {
885 display: contents;
886}
887
888.odoc-local-toc {
889 grid-area: toc-local;
890}
891
892.odoc-global-toc {
893 grid-area: toc-global;
894}
895
896.odoc-toc {
897 --toc-top: 20px;
898 width: 42ex;
899 background: var(--toc-background);
900 overflow: auto;
901 color: var(--toc-color);
902 padding-left: 2ex;
903 padding-right: 2ex;
904 height: fit-content;
905 border: solid 1px var(--border);
906 border-radius: 5px;
907 position:sticky;
908 max-height: calc(100vh - 2 * var(--toc-top));
909 top: var(--toc-top)
910}
911
912.odoc-toc ul li a {
913 font-family: "Fira Sans", sans-serif;
914 font-size: 0.95em;
915 color: var(--color);
916 font-weight: 400;
917 line-height: 1.2em;
918 display: block;
919}
920
921.odoc-toc.odoc-global-toc > ul > li {
922 margin-left:0;
923}
924
925.odoc-toc.odoc-global-toc > ul > li > ul > li {
926 margin-left:0;
927 padding-left:0;
928 border: 0;
929 margin-top: 10px;
930 margin-bottom: 10px;
931}
932
933.odoc-toc.odoc-global-toc > ul > li > ul > li {
934 font-weight: 500;
935}
936
937.odoc-toc.odoc-global-toc > ul > li > ul > li > a {
938 font-weight: inherit;
939 font-size: inherit;
940}
941
942.odoc-toc.odoc-global-toc > ul > li > a {
943 font-size: 1.2em;
944}
945
946:root {
947 --search-bar-height: 25px;
948 --search-padding-top: 1rem;
949}
950
951.odoc-search {
952 position: sticky;
953 top: 0;
954 background: var(--main-background);
955 /* This amounts to fit-content when the search is not active, but when you
956 have the search results displayed, you do not want the height of the search
957 container to change. */
958 height: calc(var(--search-bar-height) + 2 * var(--search-padding-top));
959 width: 100%;
960 padding-top: var(--search-padding-top);
961 padding-bottom: var(--search-padding-top);
962 z-index: 1;
963 grid-area: search-bar;
964
965}
966
967
968.odoc-search .search-inner {
969 width: 100%;
970 position: relative;
971 left: 0;
972 display: grid;
973 /* The second column is for the search snake, which has 0 width */
974 grid-template-columns: 1fr 0fr;
975 grid-row-gap: 1rem;
976 /* The second row is for the search results. It has a width, but only */
977 grid-template-rows: min-content 0px;
978 background: transparent;
979}
980
981.odoc-search .search-bar {
982 position: relative;
983 z-index: 2;
984 font-size: 1em;
985 transition: font-size 0.3s;
986 box-shadow: 0px 0px 0.2rem 0.3em var(--main-background);
987 height: var(--search-bar-height);
988 border: 1px solid var(--fg4);
989 /* inputs are of fixed size by default, even if you display:block them */
990 width: 100%;
991 color: var(--odoc-fg);
992 background: var(--odoc-bg1);
993 border-radius: 5px;
994 outline: none;
995}
996
997.odoc-search:focus-within {
998 width: 100%;
999}
1000
1001.odoc-search:focus-within .search-bar {
1002 font-size: 1.1em;
1003 border-color: var(--search-highlight-color);
1004}
1005
1006.search-bar:focus-visible {
1007 outline: 2px solid var(--search-highlight-color);
1008}
1009
1010.search-bar::placeholder {
1011 color: var(--fg3);
1012}
1013
1014.odoc-search:not(:focus-within) .search-result {
1015 display: none;
1016}
1017
1018.odoc-search .search-result:empty {
1019 display: none;
1020}
1021
1022.odoc-search .search-result {
1023 grid-row: 2;
1024 background: var(--toc-background);
1025 position: absolute;
1026 left: 0;
1027 right: 0;
1028 border: solid;
1029 border-color: var(--search-results-border);
1030 border-width: 1px;
1031 border-radius: 6px;
1032 box-shadow: 0 3px 10px 2px var(--search-results-shadow), 0 0 3px 4px var(--main-background), 0px -1rem 0px 0px var(--main-background);
1033 /* Works better on smallish screens with this */
1034 max-height: calc(min(40rem, 50vh));
1035 overflow-y: auto;
1036}
1037
1038
1039.odoc-search .search-no-result {
1040 color: var(--color);
1041 border-bottom: var(--search-results-border) solid 1px;
1042 background-color: inherit;
1043 outline: 0;
1044 padding: 10px;
1045 padding-right: 0.5rem;
1046}
1047
1048.search-bar-container {
1049 display: flex;
1050 align-items: stretch;
1051 border-bottom: 1rem solid var(--main-background);
1052}
1053
1054.search-snake {
1055 grid-row: 1;
1056 grid-column: 2;
1057 display: flex;
1058 align-items: center;
1059 width: 0;
1060 z-index: 2;
1061 position: relative;
1062 left: 0;
1063 margin-top: 4px;
1064 margin-bottom: 4px;
1065 /* Otherwise the search snake flickers for very fast searches. */
1066 transition: opacity 0.2s;
1067 opacity: 0;
1068}
1069
1070.search-snake.search-busy {
1071 opacity: 1;
1072}
1073
1074.search-snake:before {
1075 content: " ";
1076 display: block;
1077 aspect-ratio: 1 / 1;
1078 height: 100%;
1079 margin-right: 4px;
1080 border-radius: 50%;
1081 border: 3px solid #aaa;
1082 border-color: var(--search-snake-color) transparent var(--search-snake-color) transparent;
1083 animation: search-snake 1.2s linear infinite;
1084 position: absolute;
1085 right: 0;
1086}
1087
1088@keyframes search-snake {
1089 0% {
1090 transform: rotate(0deg);
1091 }
1092
1093 100% {
1094 transform: rotate(360deg);
1095 }
1096}
1097
1098:root {
1099 --kind-font-size-factor: 0.8;
1100}
1101
1102.odoc-search .search-entry {
1103 color: var(--color);
1104 display: grid;
1105 /* Possible kinds are the following :
1106 "doc" "type" "mod" "exn" "class" "meth" "cons" "sig" "cons" "field" "val"
1107 and "ext".
1108 As the longest is 5 characters (and the font monospace), we give 5
1109 character size to the column. However the font used for kind is a little
1110 smaller, so we adjust by this factor.
1111 */
1112 grid-template-columns: [kinds] calc(var(--kind-font-size-factor) * 5ch) [titles] 1fr;
1113 column-gap: 0.5rem;
1114 border-bottom: var(--search-results-border) solid 1px;
1115 background-color: inherit;
1116 outline: 0;
1117 padding: 0.4rem 0.4rem 0.7rem 0.7rem;
1118}
1119.odoc-search .search-entry p {
1120 margin: 0;
1121 overflow: hidden;
1122 text-overflow: ellipsis;
1123 white-space: nowrap;
1124}
1125
1126.odoc-search .search-result .search-entry:focus-visible {
1127 box-shadow: none;
1128 background-color: var(--target-background);
1129}
1130
1131.odoc-search .search-entry:hover {
1132 box-shadow: none;
1133 background-color: var(--main-background);
1134}
1135
1136.odoc-search .search-entry .entry-kind {
1137 grid-row: 1/2;
1138 grid-column: 1/2;
1139 line-height: 1.4rem;
1140 font-size: calc(var(--kind-font-size-factor) * 1em);
1141 font-weight: bold;
1142 text-align: right;
1143 position: relative;
1144 bottom: 0;
1145}
1146
1147.odoc-search .search-entry pre {
1148 border: none;
1149 margin: 0;
1150}
1151
1152.odoc-search .search-entry pre code {
1153 font-size: 1em;
1154 background-color: var(--code-background);
1155 color: var(--code-color);
1156 border-radius: 3px;
1157 padding: 0 0.3ex;
1158}
1159
1160.odoc-search .search-entry .entry-title {
1161 width: 100%;
1162 display: block;
1163 grid-column: 2/2;
1164 grid-row: 1/2;
1165 align-self: end;
1166 line-height: 1.4rem;
1167 white-space: nowrap;
1168 overflow: hidden;
1169 text-overflow: ellipsis;
1170}
1171
1172.odoc-search .entry-name {
1173 font-weight: bold;
1174}
1175
1176.odoc-search .prefix-name {
1177 font-weight: bold;
1178}
1179
1180.odoc-search .search-entry .prefix-name {
1181 opacity: 0.7;
1182}
1183
1184.odoc-search .entry-rhs {
1185 white-space: nowrap;
1186}
1187
1188.odoc-search .search-entry .entry-content {
1189 flex-grow: 1;
1190 flex-shrink: 1;
1191 min-width: 0;
1192}
1193
1194.odoc-search .search-entry .entry-comment {
1195 max-height: 1.5em;
1196 overflow: hidden;
1197 text-overflow: ellipsis;
1198 white-space: nowrap;
1199 font-size: 0.95em;
1200 grid-row: 2/2;
1201 grid-column: 2/2;
1202}
1203
1204.odoc-search .search-entry .entry-comment ul {
1205 white-space: nowrap;
1206 display: inline;
1207}
1208
1209.odoc-search .search-entry .entry-comment li {
1210 display: inline;
1211 white-space: nowrap;
1212}
1213
1214.odoc-search .search-entry .entry-comment ul>li::before {
1215 content: '•';
1216}
1217
1218.odoc-search .search-entry .entry-comment div {
1219 display: inline;
1220 white-space: nowrap;
1221}
1222
1223.odoc-search .search-entry .entry-comment p {
1224 display: inline;
1225 white-space: nowrap;
1226}
1227
1228.odoc-search .search-entry .entry-comment code {
1229 display: inline;
1230 white-space: nowrap;
1231}
1232
1233/* First level titles */
1234
1235.odoc-toc>ul>li>a {
1236 font-weight: 500;
1237}
1238
1239.odoc-toc ul li ul {
1240 margin: 0px;
1241 padding-top: 0.25em;
1242}
1243
1244.odoc-toc ul {
1245 list-style-type: none;
1246}
1247
1248.odoc-toc ul li {
1249 padding: 0.25em 0;
1250}
1251
1252.odoc-toc>ul>li {
1253 margin-left: 0;
1254 margin-bottom: 0.3em;
1255}
1256
1257.odoc-toc ul li li {
1258 border-left: 1px solid var(--toc-list-border);
1259 margin-left: 5px;
1260 padding-left: 12px;
1261}
1262
1263/* Tables */
1264
1265.odoc-table {
1266 margin: 1em;
1267}
1268
1269.odoc-table td,
1270.odoc-table th {
1271 padding-left: 0.5em;
1272 padding-right: 0.5em;
1273 border: 1px solid black;
1274}
1275
1276.odoc-table th {
1277 font-weight: bold;
1278}
1279
1280/* Mobile adjustements. */
1281
1282@media only screen and (max-width: 210ex) {
1283 body.odoc {
1284 max-width: 132ex;
1285 grid-template-areas:
1286 "search-bar nav"
1287 "sidebar preamble"
1288 "sidebar content";
1289 }
1290 body.odoc .odoc-tocs {
1291 display: flex;
1292 grid-area: sidebar;
1293 flex-direction : column;
1294 gap: 20px;
1295 }
1296 body.odoc .odoc-tocs .odoc-toc {
1297 position: unset;
1298 max-height: unset;
1299 }
1300 body.odoc:has(.odoc-search:focus-within) {
1301 grid-template-areas:
1302 "search-bar search-bar"
1303 ". nav"
1304 "sidebar preamble"
1305 "sidebar content";
1306 }
1307 body.odoc:not(:has(> .odoc-tocs .odoc-global-toc)) {
1308 grid-template-areas:
1309 "search-bar nav"
1310 "sidebar preamble"
1311 "sidebar content";
1312 grid-template-columns: min-content 1fr;
1313 }
1314}
1315
1316@media only screen and (max-width: 110ex) {
1317 body.odoc {
1318 margin: 2em;
1319 padding: 0;
1320 grid-template-areas:
1321 "search-bar"
1322 "nav"
1323 "preamble"
1324 "toc-local"
1325 "content"
1326 "toc-global";
1327 grid-template-columns: 1fr;
1328 }
1329 body.odoc:has(> .odoc-search:focus-within) {
1330 /* This is the same as when there is no focus on the search bar, this is
1331 just to prevent the default "wide layout" rule from changing anything. */
1332 grid-template-areas:
1333 "search-bar"
1334 "nav"
1335 "preamble"
1336 "toc-local"
1337 "content"
1338 "toc-global";
1339 grid-template-columns: 1fr;
1340 }
1341 body.odoc:not(:has(> .odoc-tocs .odoc-global-toc)) {
1342 grid-template-areas:
1343 "search-bar"
1344 "nav"
1345 "preamble"
1346 "toc-local"
1347 "content"
1348 "toc-global";
1349 grid-template-columns: 1fr;
1350 }
1351 body.odoc .odoc-search {
1352 position: relative;
1353 height: calc(var(--search-bar-height) + 2 * var(--search-padding-top));
1354 }
1355 body.odoc nav.odoc-nav {
1356 padding-top: 0;
1357 padding-bottom: var(--search-padding-top);
1358 }
1359 body.odoc .odoc-tocs {
1360 display: contents;
1361 }
1362 body.odoc .odoc-tocs .odoc-toc {
1363 position: static;
1364 width: auto;
1365 min-width: unset;
1366 max-width: unset;
1367 max-height: unset;
1368 border: none;
1369 padding: 0.2em 1em;
1370 border-radius: 5px;
1371 margin-bottom: 2em;
1372 }
1373}
1374
1375/* Print adjustements. */
1376
1377@media print {
1378 body {
1379 color: black;
1380 background: white;
1381 }
1382
1383 body nav:first-child {
1384 visibility: hidden;
1385 }
1386}
1387
1388/* Source code. */
1389
1390.source_container {
1391 display: flex;
1392 grid-area: content;
1393 margin-top: 0;
1394}
1395
1396.source_line_column {
1397 padding-right: 0.5em;
1398 text-align: right;
1399 color: var(--source-line-column);
1400 background: var(--source-line-column-bg);
1401}
1402
1403.source_line {
1404 padding: 0 1em;
1405}
1406
1407.source_code {
1408 flex-grow: 1;
1409 background: var(--code-background);
1410 padding: 0 0.3em;
1411 color: var(--code-color);
1412}
1413
1414/* Source directories */
1415
1416.odoc-directory::before {
1417 content: "📁";
1418 margin: 0.3em;
1419 font-size: 1.3em;
1420}
1421
1422.odoc-file::before {
1423 content: "📄";
1424 margin: 0.3em;
1425 font-size: 1.3em;
1426}
1427
1428.odoc-folder-list {
1429 list-style: none;
1430}
1431
1432/* Syntax highlighting (based on github-gist) */
1433
1434.hljs {
1435 display: block;
1436 background: var(--code-background);
1437 padding: 0.5em;
1438 color: var(--color);
1439 overflow-x: auto;
1440}
1441
1442.hljs-comment,
1443.hljs-meta {
1444 color: var(--source-code-comment);
1445}
1446
1447.hljs-string,
1448.hljs-variable,
1449.hljs-template-variable,
1450.hljs-strong,
1451.hljs-emphasis,
1452.hljs-quote,
1453.hljs-literal {
1454 color: var(--source-code-literal);
1455}
1456
1457.hljs-keyword,
1458.hljs-selector-tag {
1459 color: var(--source-code-keyword);
1460}
1461
1462.hljs-type,
1463.hljs-class .hljs-title {
1464 color: var(--source-code-uident);
1465 font-weight: 500;
1466}
1467
1468.hljs-symbol,
1469.hljs-bullet,
1470.hljs-attribute {
1471 color: var(--hljs-literal);
1472}
1473
1474.hljs-section,
1475.hljs-name {
1476 color: var(--hljs-name);
1477}
1478
1479.hljs-tag {
1480 color: var(--hljs-tag);
1481}
1482
1483.hljs-attr,
1484.hljs-selector-id,
1485.hljs-selector-class,
1486.hljs-selector-attr,
1487.hljs-selector-pseudo {
1488 color: var(--hljs-attr);
1489}
1490
1491.hljs-addition {
1492 color: var(--hljs-addition);
1493 background-color: var(--hljs-addition-bg);
1494}
1495
1496.hljs-deletion {
1497 color: var(--hljs-deletion);
1498 background-color: var(--hljs-deletion-bg);
1499}
1500
1501.hljs-link {
1502 text-decoration: underline;
1503}
1504
1505/* Keywords */
1506.AND, .ANDOP, .AS, .ASSERT,
1507.BAR, .BEGIN,
1508.CLASS, .CONSTRAINT,
1509.DO, .DONE, .DOWNTO,
1510.ELSE, .END, .EXCEPTION, .EXTERNAL,
1511.FOR, .FUN, .FUNCTION, .FUNCTOR,
1512.IF, .IN, .INCLUDE, .INHERIT, .INITIALIZER,
1513.LAZY, .LESSMINUS, .LET, .LETOP,
1514.MATCH, .METHOD, .MINUSGREATER, .MODULE, .MUTABLE,
1515.NEW, .NONREC,
1516.OBJECT, .OF, .OPEN,
1517.PERCENT, .PRIVATE,
1518.REC,
1519.SEMISEMI, .SIG, .STRUCT,
1520.THEN, .TO, .TRY, .TYPE,
1521.VAL, .VIRTUAL,
1522.WHEN, .WITH, .WHILE
1523{
1524 color: var(--source-code-keyword);;
1525}
1526
1527/* Separators */
1528.COMMA, .COLON, .COLONGREATER, .SEMI {
1529 color: var(--source-code-separator);
1530}
1531
1532/* Parens
1533 `begin` and `end ` are excluded because `end` is used in other, more
1534 keyword-y contexts*/
1535.BARRBRACKET,
1536.LBRACE,
1537.LBRACELESS,
1538.LBRACKET,
1539.LBRACKETAT,
1540.LBRACKETATAT,
1541.LBRACKETATATAT,
1542.LBRACKETBAR,
1543.LBRACKETGREATER,
1544.LBRACKETLESS,
1545.LBRACKETPERCENT,
1546.LBRACKETPERCENTPERCENT,
1547.LPAREN,
1548.RBRACE,
1549.RBRACKET,
1550.RPAREN
1551{
1552 color: var(--source-code-parens);
1553}
1554
1555/* Prefix operators */
1556.ASSERT, .BANG, .PREFIXOP,
1557/* Infix operators.
1558 A choice had to be made for equal `=` which is both a keyword and an operator.
1559 It looked better having it as an operator, because when it is a keyword,
1560 there are already loads of keyword around.
1561 It would look even nicer if there was a way to distinguish between these
1562 two cases.*/
1563.INFIXOP0, .INFIXOP1, .INFIXOP2, .INFIXOP3, .INFIXOP4,
1564.BARBAR, .PLUS, .STAR, .AMPERAMPER, .AMPERAND, .COLONEQUAL, .GREATER, .LESS,
1565.MINUS, .MINUSDOT, .MINUSGREATER, .OR, .PLUSDOT, .PLUSEQ, .EQUAL
1566{
1567 color: var(--source-code-operator);
1568}
1569
1570/* Upper case ident
1571 `true` and `false` are considered uident here, because you can bind them in a
1572 constructor defintion :
1573 ```ocaml
1574 type my_bool =
1575 | true of string
1576 | false
1577 | Other of int
1578 ```
1579*/
1580.UIDENT, .COLONCOLON, .TRUE, .FALSE {
1581 color: var(--source-code-uident);
1582
1583}
1584
1585/* Lower case idents.
1586 Quotes are here because of `type 'a t = 'a list`,
1587 and question mark and tildes because of
1588 ```ocaml
1589 let f ~a ?b () = Option.map a b
1590 ```
1591*/
1592.LIDENT, .QUESTION, .QUOTE, .TILDE {
1593 color: var(--source-code-lident);
1594}
1595
1596/* Litterals */
1597 .STRING, .CHAR, .INT, .FLOAT, .QUOTED_STRING_EXPR, .QUOTED_STRING_ITEM {
1598 color: var(--source-code-literal);
1599}
1600
1601.UNDERSCORE {
1602 color: var(--source-code-underscore);
1603}
1604
1605.DOCSTRING {
1606 color: var(--source-code-docstring);
1607}
1608
1609.COMMENT {
1610 color: var(--source-code-comment);
1611}
1612
1613/*---------------------------------------------------------------------------
1614 Copyright (c) 2016 The odoc contributors
1615
1616 Permission to use, copy, modify, and/or distribute this software for any
1617 purpose with or without fee is hereby granted, provided that the above
1618 copyright notice and this permission notice appear in all copies.
1619
1620 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
1621 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
1622 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
1623 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1624 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
1625 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
1626 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1627 ---------------------------------------------------------------------------*/