let css = {| :root { --bg-color: #f8f9fa; --sidebar-bg: #fff; --content-bg: #fff; --text-color: #24292f; --text-muted: #656d76; --link-color: #0969da; --link-hover: #0550ae; --border-color: #d1d9e0; --code-bg: #f6f8fa; --code-border: #d1d9e0; --highlight-bg: rgba(9, 105, 218, 0.08); --highlight-border: #0969da; --include-bg: rgba(0, 0, 0, 0.02); --sidebar-width: 280px; --header-height: 56px; --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04); --shadow-md: 0 3px 6px rgba(0, 0, 0, 0.08); /* x-ocaml interactive cells */ --xo-bg: var(--code-bg); --xo-text: var(--text-color); --xo-gutter-bg: var(--code-bg); --xo-gutter-text: var(--text-muted); --xo-gutter-border: var(--border-color); --xo-stdout-bg: rgba(9, 105, 218, 0.06); --xo-stdout-text: var(--link-color); --xo-stderr-bg: rgba(218, 9, 9, 0.06); --xo-stderr-text: #cf222e; --xo-meta-bg: var(--code-bg); --xo-meta-text: var(--text-muted); --xo-tooltip-bg: var(--content-bg); --xo-tooltip-text: var(--text-color); --xo-tooltip-border: var(--border-color); --xo-btn-bg: var(--code-bg); --xo-btn-border: var(--border-color); --xo-btn-text: var(--text-muted); --xo-btn-hover-bg: var(--text-muted); --xo-btn-hover-text: var(--content-bg); } @media (prefers-color-scheme: dark) { :root { --bg-color: #0d1117; --sidebar-bg: #161b22; --content-bg: #161b22; --text-color: #e6edf3; --text-muted: #8b949e; --link-color: #58a6ff; --link-hover: #79c0ff; --border-color: #30363d; --code-bg: #21262d; --code-border: #30363d; --highlight-bg: rgba(88, 166, 255, 0.12); --highlight-border: #58a6ff; --include-bg: rgba(255, 255, 255, 0.02); --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2); --shadow-md: 0 3px 6px rgba(0, 0, 0, 0.3); /* x-ocaml interactive cells - dark overrides */ --xo-stdout-bg: rgba(88, 166, 255, 0.08); --xo-stdout-text: #79c0ff; --xo-stderr-bg: rgba(248, 81, 73, 0.08); --xo-stderr-text: #f85149; --xo-meta-text: var(--text-muted); } } * { box-sizing: border-box; margin: 0; padding: 0; } body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 16px; line-height: 1.6; color: var(--text-color); background: var(--bg-color); } /* Site Header */ .docsite-header { position: fixed; top: 0; left: 0; right: 0; height: var(--header-height); background: var(--sidebar-bg); border-bottom: 1px solid var(--border-color); box-shadow: var(--shadow-sm); display: flex; align-items: center; padding: 0 24px; z-index: 100; } .docsite-header-brand { font-weight: 600; font-size: 1.2rem; color: var(--text-color); text-decoration: none; letter-spacing: -0.01em; } .docsite-header-brand:hover { color: var(--link-color); } /* Search */ .docsite-search-container { flex: 1; max-width: 400px; margin: 0 40px; } .search-wrapper { position: relative; } .search-input { width: 100%; padding: 8px 12px 8px 36px; font-size: 14px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-color); color: var(--text-color); transition: border-color 0.2s, box-shadow 0.2s; } .search-input:focus { outline: none; border-color: var(--link-color); box-shadow: 0 0 0 3px rgba(59, 110, 165, 0.15); } .search-input::placeholder { color: var(--text-muted); } .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; } .search-shortcut { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 2px 6px; font-size: 11px; font-family: monospace; background: var(--code-bg); border: 1px solid var(--border-color); border-radius: 3px; color: var(--text-muted); } .search-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; max-height: 400px; overflow-y: auto; background: var(--content-bg); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04); z-index: 1000; display: none; } .search-results.active { display: block; } .search-result { display: block; padding: 10px 14px; color: var(--text-color); text-decoration: none; border-bottom: 1px solid var(--border-color); } .search-result:last-child { border-bottom: none; } .search-result:hover, .search-result:focus { background: var(--highlight-bg); outline: none; } .search-result .entry-name { font-weight: 500; } .search-result .entry-kind { font-size: 0.85em; color: var(--text-muted); margin-left: 8px; } .search-no-result { padding: 16px; text-align: center; color: var(--text-muted); } .search-busy::after { content: ""; display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border-color); border-top-color: var(--link-color); border-radius: 50%; animation: spin 0.8s linear infinite; position: absolute; right: 40px; top: 50%; transform: translateY(-50%); } @keyframes spin { to { transform: translateY(-50%) rotate(360deg); } } /* Layout */ .docsite-layout { display: flex; margin-top: var(--header-height); min-height: calc(100vh - var(--header-height)); } /* Sidebar */ .docsite-sidebar { position: fixed; top: var(--header-height); left: 0; width: var(--sidebar-width); height: calc(100vh - var(--header-height)); background: var(--sidebar-bg); border-right: 1px solid var(--border-color); overflow-y: auto; padding: 8px 0; z-index: 50; scrollbar-width: thin; scrollbar-color: var(--border-color) transparent; } .docsite-sidebar::-webkit-scrollbar { width: 6px; } .docsite-sidebar::-webkit-scrollbar-track { background: transparent; } .docsite-sidebar::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; } .docsite-sidebar::-webkit-scrollbar-thumb:hover { background: var(--text-muted); } .sidebar-nav { padding: 0 8px; } .sidebar-section { margin-bottom: 4px; } .sidebar-link { display: block; padding: 3px 8px; color: var(--text-color); text-decoration: none; border-radius: 3px; font-size: 13px; line-height: 1.4; } .sidebar-link:hover:not(.active) { background: var(--bg-color); } .sidebar-link.active { background: var(--highlight-bg); color: var(--link-color); font-weight: 600; } .sidebar-group { margin-left: 0; } .sidebar-group-header { display: flex; align-items: center; padding: 3px 8px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-color); border-radius: 3px; user-select: none; } .sidebar-group-header:hover { background: var(--bg-color); } .sidebar-toggle { width: 14px; height: 14px; margin-right: 4px; flex-shrink: 0; transition: transform 0.2s; } .sidebar-toggle-spacer { display: inline-block; width: 14px; height: 14px; margin-right: 4px; flex-shrink: 0; } .sidebar-leaf { display: flex; align-items: center; } /* Package selector */ .package-selector { padding: 8px; border-bottom: 1px solid var(--border-color); margin-bottom: 4px; } .package-selector select { width: 100%; padding: 6px 10px; font-size: 13px; font-weight: 500; border: 1px solid var(--border-color); border-radius: 6px; background: var(--content-bg); color: var(--text-color); cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; } .package-selector select:hover { border-color: var(--link-color); } .package-selector select:focus { outline: none; border-color: var(--link-color); box-shadow: 0 0 0 3px rgba(59, 110, 165, 0.15); } .sidebar-group.collapsed .sidebar-toggle { transform: rotate(-90deg); } .sidebar-group.collapsed .sidebar-children { display: none; } .sidebar-children { margin-left: 8px; border-left: 1px solid var(--border-color); padding-left: 4px; } /* Sidebar entry type indicators */ .sidebar-kind { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-right: 5px; border-radius: 3px; font-size: 9px; font-weight: 700; flex-shrink: 0; } .sidebar-kind-package { background: #8250df; color: white; } .sidebar-kind-module { background: #bf8700; color: white; } .sidebar-kind-page { background: #1a7f37; color: white; } .sidebar-kind-leaf-page { background: #57606a; color: white; } .sidebar-kind-class, .sidebar-kind-class-type { background: #0550ae; color: white; } .sidebar-kind-library { background: #6e7781; color: white; } .sidebar-group-header .sidebar-kind { margin-left: 0; } .sidebar-link .sidebar-kind { margin-left: 0; } /* Non-link labels in sidebar (e.g. library headings) */ .sidebar-label { color: var(--text-muted); font-size: 13px; line-height: 1.4; } /* Main Content */ .docsite-main { flex: 1; margin-left: var(--sidebar-width); padding: 24px 40px 60px; max-width: calc(100% - var(--sidebar-width)); background: var(--content-bg); min-height: calc(100vh - var(--header-height)); } /* Breadcrumbs */ .odoc-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 12px 0; margin-bottom: 16px; font-size: 14px; border-bottom: 1px solid var(--border-color); } .breadcrumb-item { color: var(--link-color); text-decoration: none; } .breadcrumb-item:hover { text-decoration: underline; } .breadcrumb-separator { color: var(--text-muted); margin: 0 4px; } .breadcrumb-current { color: var(--text-color); font-weight: 500; } /* Content Styles */ .odoc-content { max-width: 900px; } .odoc-content h1 { font-size: 2rem; font-weight: 600; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--border-color); } .odoc-content h2 { font-size: 1.5rem; font-weight: 600; margin-top: 32px; margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border-color); } .odoc-content h3 { font-size: 1.25rem; font-weight: 600; margin-top: 24px; margin-bottom: 8px; } .odoc-content h4, .odoc-content h5, .odoc-content h6 { font-size: 1.1rem; font-weight: 600; margin-top: 20px; margin-bottom: 8px; } .odoc-content p { margin-bottom: 16px; } .odoc-content a { color: var(--link-color); text-decoration: none; } .odoc-content a:hover { text-decoration: underline; } .odoc-content code { font-family: "SF Mono", Consolas, "Liberation Mono", Menlo, monospace; font-size: 0.9em; background: var(--code-bg); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--code-border); } .odoc-content pre { background: var(--code-bg); border: 1px solid var(--code-border); border-radius: 8px; padding: 16px; overflow-x: auto; margin-bottom: 16px; box-shadow: var(--shadow-sm); } .odoc-content pre code { background: none; border: none; padding: 0; font-size: 0.875rem; line-height: 1.5; } .odoc-content ul, .odoc-content ol { margin-bottom: 16px; padding-left: 24px; } .odoc-content li { margin-bottom: 4px; } .odoc-content blockquote { border-left: 4px solid var(--link-color); margin: 16px 0; padding: 8px 16px; background: var(--code-bg); color: var(--text-muted); } .odoc-content table { width: 100%; border-collapse: collapse; margin-bottom: 16px; } .odoc-content th, .odoc-content td { padding: 10px 12px; border: 1px solid var(--border-color); text-align: left; } .odoc-content th { background: var(--code-bg); font-weight: 600; } /* odoc-specific styles */ .odoc-spec { margin: 16px 0; padding: 12px 16px; background: var(--code-bg); border: 1px solid var(--code-border); border-radius: 8px; border-left: 3px solid var(--link-color); box-shadow: var(--shadow-sm); } .odoc-spec code { background: none; border: none; padding: 0; font-size: inherit; } .spec { font-family: "SF Mono", Consolas, monospace; font-size: 0.9rem; } .spec-doc { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-color); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; font-size: 0.95rem; } /* Hide OCaml comment delimiters in documentation */ .comment-delim { display: none; } .odoc-spec ol { list-style: none; margin: 0; padding: 0; } .odoc-spec li { margin: 4px 0; } .def-doc { display: inline; margin-left: 8px; color: var(--text-muted); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; font-size: 0.9rem; } .def-doc p { display: inline; margin: 0; } /* Include blocks */ .odoc-include { margin: 16px 0; margin-left: 12px; padding: 12px; border: 1px solid var(--border-color); border-left: 3px solid var(--text-muted); border-radius: 8px; background: var(--include-bg); } .odoc-include > details { margin: 0; } .odoc-include > details > summary { padding: 8px 0; cursor: pointer; font-family: "SF Mono", Consolas, monospace; font-size: 0.9rem; list-style: none; } .odoc-include > details > summary::-webkit-details-marker { display: none; } .odoc-include > details > summary::before { content: "\25B6"; display: inline-block; margin-right: 8px; transition: transform 0.2s; font-size: 0.7em; color: var(--text-muted); } .odoc-include > details[open] > summary::before { transform: rotate(90deg); } .anchor { color: var(--text-muted); text-decoration: none; margin-left: 4px; opacity: 0; transition: opacity 0.15s; } h1:hover .anchor, h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, h5:hover .anchor, h6:hover .anchor, .spec:hover .anchor { opacity: 1; } .anchor:hover { color: var(--link-color); } /* Highlight target element from URL hash */ :target, .hash-highlight { position: relative; background: var(--highlight-bg); border-radius: 4px; box-shadow: inset 3px 0 0 var(--highlight-border); padding-left: 12px; margin-left: -12px; } .hash-highlight { animation: highlight-pulse 1.5s ease-out; } @keyframes highlight-pulse { 0% { background: rgba(9, 105, 218, 0.2); box-shadow: inset 3px 0 0 var(--highlight-border), 0 0 12px rgba(9, 105, 218, 0.3); } 100% { background: var(--highlight-bg); box-shadow: inset 3px 0 0 var(--highlight-border); } } @media (prefers-color-scheme: dark) { @keyframes highlight-pulse { 0% { background: rgba(88, 166, 255, 0.25); box-shadow: inset 3px 0 0 var(--highlight-border), 0 0 12px rgba(88, 166, 255, 0.3); } 100% { background: var(--highlight-bg); box-shadow: inset 3px 0 0 var(--highlight-border); } } } @keyframes highlight-fade { 0% { background-color: var(--highlight-bg); } 100% { background-color: transparent; } } /* Table of Contents (in-page) */ .odoc-tocs { position: fixed; right: 24px; top: calc(var(--header-height) + 24px); width: 200px; max-height: calc(100vh - var(--header-height) - 48px); overflow-y: auto; font-size: 13px; padding: 16px; background: var(--sidebar-bg); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: var(--shadow-sm); } .odoc-tocs .odoc-toc-title { font-weight: 600; margin-bottom: 12px; color: var(--text-color); font-size: 12px; letter-spacing: 0.02em; } .odoc-tocs ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border-color); } .odoc-tocs li { margin: 0; } .odoc-tocs a { color: var(--text-muted); text-decoration: none; display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 2px solid transparent; transition: color 0.15s, border-color 0.15s; } .odoc-tocs a:hover { color: var(--link-color); border-left-color: var(--link-color); } .odoc-tocs ul ul { margin-left: 12px; border-left: none; } .odoc-tocs ul ul a { padding-left: 12px; font-size: 12px; } @media (max-width: 1400px) { .odoc-tocs { display: none; } } /* Responsive */ @media (max-width: 768px) { :root { --sidebar-width: 0; } .docsite-sidebar { transform: translateX(-100%); transition: transform 0.3s; } .docsite-sidebar.open { transform: translateX(0); width: 280px; } .docsite-main { margin-left: 0; max-width: 100%; padding: 16px 20px; } .menu-toggle { display: block; } } .menu-toggle { display: none; background: none; border: none; padding: 8px; cursor: pointer; color: var(--text-color); } |}