@staticbolt/docs 0.0.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +148 -0
  3. package/lib/collapsible-plugin-Bwt7dmKE.mjs +132 -0
  4. package/lib/ec-config.mjs +59 -0
  5. package/lib/ec.config.d.mts +5 -0
  6. package/lib/index.d.mts +371 -0
  7. package/lib/plugins.mjs +0 -0
  8. package/package.json +113 -0
  9. package/sources/assets/fonts/KaTeX_AMS-Regular.ttf +0 -0
  10. package/sources/assets/fonts/KaTeX_AMS-Regular.woff +0 -0
  11. package/sources/assets/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  12. package/sources/assets/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
  13. package/sources/assets/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
  14. package/sources/assets/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  15. package/sources/assets/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
  16. package/sources/assets/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
  17. package/sources/assets/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  18. package/sources/assets/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
  19. package/sources/assets/fonts/KaTeX_Fraktur-Bold.woff +0 -0
  20. package/sources/assets/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  21. package/sources/assets/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
  22. package/sources/assets/fonts/KaTeX_Fraktur-Regular.woff +0 -0
  23. package/sources/assets/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  24. package/sources/assets/fonts/KaTeX_Main-Bold.ttf +0 -0
  25. package/sources/assets/fonts/KaTeX_Main-Bold.woff +0 -0
  26. package/sources/assets/fonts/KaTeX_Main-Bold.woff2 +0 -0
  27. package/sources/assets/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
  28. package/sources/assets/fonts/KaTeX_Main-BoldItalic.woff +0 -0
  29. package/sources/assets/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  30. package/sources/assets/fonts/KaTeX_Main-Italic.ttf +0 -0
  31. package/sources/assets/fonts/KaTeX_Main-Italic.woff +0 -0
  32. package/sources/assets/fonts/KaTeX_Main-Italic.woff2 +0 -0
  33. package/sources/assets/fonts/KaTeX_Main-Regular.ttf +0 -0
  34. package/sources/assets/fonts/KaTeX_Main-Regular.woff +0 -0
  35. package/sources/assets/fonts/KaTeX_Main-Regular.woff2 +0 -0
  36. package/sources/assets/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
  37. package/sources/assets/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  38. package/sources/assets/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  39. package/sources/assets/fonts/KaTeX_Math-Italic.ttf +0 -0
  40. package/sources/assets/fonts/KaTeX_Math-Italic.woff +0 -0
  41. package/sources/assets/fonts/KaTeX_Math-Italic.woff2 +0 -0
  42. package/sources/assets/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
  43. package/sources/assets/fonts/KaTeX_SansSerif-Bold.woff +0 -0
  44. package/sources/assets/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  45. package/sources/assets/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
  46. package/sources/assets/fonts/KaTeX_SansSerif-Italic.woff +0 -0
  47. package/sources/assets/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  48. package/sources/assets/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
  49. package/sources/assets/fonts/KaTeX_SansSerif-Regular.woff +0 -0
  50. package/sources/assets/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  51. package/sources/assets/fonts/KaTeX_Script-Regular.ttf +0 -0
  52. package/sources/assets/fonts/KaTeX_Script-Regular.woff +0 -0
  53. package/sources/assets/fonts/KaTeX_Script-Regular.woff2 +0 -0
  54. package/sources/assets/fonts/KaTeX_Size1-Regular.ttf +0 -0
  55. package/sources/assets/fonts/KaTeX_Size1-Regular.woff +0 -0
  56. package/sources/assets/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  57. package/sources/assets/fonts/KaTeX_Size2-Regular.ttf +0 -0
  58. package/sources/assets/fonts/KaTeX_Size2-Regular.woff +0 -0
  59. package/sources/assets/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  60. package/sources/assets/fonts/KaTeX_Size3-Regular.ttf +0 -0
  61. package/sources/assets/fonts/KaTeX_Size3-Regular.woff +0 -0
  62. package/sources/assets/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  63. package/sources/assets/fonts/KaTeX_Size4-Regular.ttf +0 -0
  64. package/sources/assets/fonts/KaTeX_Size4-Regular.woff +0 -0
  65. package/sources/assets/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  66. package/sources/assets/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
  67. package/sources/assets/fonts/KaTeX_Typewriter-Regular.woff +0 -0
  68. package/sources/assets/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  69. package/sources/parts/badge/badge.part.html +3 -0
  70. package/sources/parts/badge/badge.style.css +44 -0
  71. package/sources/parts/callouts/callouts.part.html +30 -0
  72. package/sources/parts/color-scheme-switch/color-scheme-switch.part.html +111 -0
  73. package/sources/parts/color-scheme-switch/color-scheme-switch.style.css +77 -0
  74. package/sources/parts/document/document.part.html +66 -0
  75. package/sources/parts/header/header.part.html +62 -0
  76. package/sources/parts/header/header.style.css +123 -0
  77. package/sources/parts/mermaid/mermaid.part.html +15 -0
  78. package/sources/parts/pagefind/pagefind.part.html +75 -0
  79. package/sources/parts/pagefind/pagefind.style.css +57 -0
  80. package/sources/parts/pagination-links/pagination-links.part.html +81 -0
  81. package/sources/parts/pagination-links/pagination-links.style.css +58 -0
  82. package/sources/parts/sidebar/directory.part.html +13 -0
  83. package/sources/parts/sidebar/item.part.html +9 -0
  84. package/sources/parts/sidebar/sidebar.part.html +106 -0
  85. package/sources/parts/sidebar/sidebar.style.css +202 -0
  86. package/sources/parts/table-of-content/table-of-content-desktop.part.html +122 -0
  87. package/sources/parts/table-of-content/table-of-content-mobile.part.html +24 -0
  88. package/sources/parts/table-of-content/table-of-content.style.css +189 -0
  89. package/sources/scripts/global.d.ts +27 -0
  90. package/sources/scripts/mermaid.ts +75 -0
  91. package/sources/styles/docs.css +9 -0
  92. package/sources/styles/document.css +579 -0
  93. package/sources/styles/global.css +149 -0
  94. package/sources/styles/katex.css +1445 -0
@@ -0,0 +1,44 @@
1
+ .badge {
2
+ padding: 0.1em 0.4em;
3
+ padding-block-start: 0.2em;
4
+ margin-block: 0.2em;
5
+ font-family: var(--sb-font-mono);
6
+ font-size: var(--sb-text-xs);
7
+ font-weight: normal;
8
+ line-height: 1;
9
+ color: #fff;
10
+ border: 1px solid #fff;
11
+ border-radius: 5px;
12
+
13
+ &.warning {
14
+ color: var(--sb-warning-text);
15
+ background-color: var(--sb-warning-background);
16
+ border: 1px solid var(--sb-warning-border);
17
+ }
18
+
19
+ &.caution,
20
+ &.danger {
21
+ color: var(--sb-caution-text);
22
+ background-color: var(--sb-caution-background);
23
+ border: 1px solid var(--sb-caution-border);
24
+ }
25
+
26
+ &.note {
27
+ color: var(--sb-note-text);
28
+ background-color: var(--sb-note-background);
29
+ border: 1px solid var(--sb-note-border);
30
+ }
31
+
32
+ &.important {
33
+ color: var(--sb-important-text);
34
+ background-color: var(--sb-important-background);
35
+ border: 1px solid var(--sb-important-border);
36
+ }
37
+
38
+ &.tip,
39
+ &.success {
40
+ color: var(--sb-tip-text);
41
+ background-color: var(--sb-tip-background);
42
+ border: 1px solid var(--sb-tip-border);
43
+ }
44
+ }
@@ -0,0 +1,30 @@
1
+ <!-- ::: Collapsible callouts (`> [!note]-`) render as `<details>`; swap them for sv-accordion ::: -->
2
+ <script build-time>
3
+ for (const callout of document.querySelectorAll("details.callout")) {
4
+ const accordion = document.createElement("sv-accordion");
5
+ accordion.setAttribute("data-callout", callout.getAttribute("data-callout"));
6
+ accordion.setAttribute("class", callout.getAttribute("class"));
7
+ accordion.setAttribute("heading-level", "none");
8
+
9
+ if (callout.hasAttribute("open")) {
10
+ accordion.setAttribute("opened", "");
11
+ }
12
+
13
+ const summary = callout.querySelector(".callout-title");
14
+ if (summary) {
15
+ const span = document.createElement("span");
16
+ span.setAttribute("slot", "summary");
17
+ span.classList.add("callout-title");
18
+ span.innerHTML = summary.innerHTML;
19
+ accordion.append(span);
20
+ }
21
+
22
+ const content = callout.querySelector(".callout-content");
23
+ if (content) {
24
+ accordion.append(content);
25
+ }
26
+
27
+ callout.replaceWith(accordion);
28
+ accordion.querySelector(".callout-fold-icon")?.remove();
29
+ }
30
+ </script>
@@ -0,0 +1,111 @@
1
+ <div class="color-scheme-switch-container">
2
+ <button type="button" class="color-scheme-switch" aria-label="Switch to dark mode" aria-pressed="false" title="Select theme">
3
+ <!-- Sun — shown when light mode is active -->
4
+ <svg
5
+ class="switch-icon switch-icon-sun"
6
+ aria-hidden="true"
7
+ focusable="false"
8
+ viewBox="0 -960 960 960"
9
+ xmlns="http://www.w3.org/2000/svg"
10
+ >
11
+ <path
12
+ d="M480-360q50 0 85-35t35-85q0-50-35-85t-85-35q-50 0-85 35t-35 85q0 50 35 85t85 35Zm0 80q-83 0-141.5-58.5T280-480q0-83 58.5-141.5T480-680q83 0 141.5 58.5T680-480q0 83-58.5 141.5T480-280ZM200-440H40v-80h160v80Zm720 0H760v-80h160v80ZM440-760v-160h80v160h-80Zm0 720v-160h80v160h-80ZM256-650l-101-97 57-59 96 100-52 56Zm492 496-97-101 53-55 101 97-57 59Zm-98-550 97-101 59 57-100 96-56-52ZM154-212l101-97 55 53-97 101-59-57Zm326-268Z"
13
+ />
14
+ </svg>
15
+
16
+ <!-- Moon — shown when dark mode is active -->
17
+ <svg
18
+ class="switch-icon switch-icon-moon"
19
+ aria-hidden="true"
20
+ focusable="false"
21
+ viewBox="0 -960 960 960"
22
+ xmlns="http://www.w3.org/2000/svg"
23
+ >
24
+ <path
25
+ d="M484-87q-81.77 0-154.11-31.27-72.35-31.27-126.35-85.27t-85.27-126.35Q87-402.23 87-484q0-140.38 87.12-248.04 87.11-107.65 224.19-136.65-7.08 97.31 20.34 190.27 27.43 92.96 97.12 162.65 69.69 69.69 162.65 97.12 92.96 27.42 190.27 17.34-28.38 138.08-136.35 226.19Q624.38-87 484-87Z"
26
+ />
27
+ </svg>
28
+ </button>
29
+ </div>
30
+
31
+ <insert selector="head">
32
+ <script>
33
+ // @ts-check
34
+ (() => {
35
+ const STORAGE_KEY = "color-scheme";
36
+ const PREFERS_DARK = window.matchMedia("(prefers-color-scheme: dark)");
37
+
38
+ let currentScheme = PREFERS_DARK.matches ? "dark" : "light";
39
+
40
+ // Override with stored value
41
+ const stored = window.localStorage.getItem(STORAGE_KEY);
42
+ if (stored === "dark" || stored === "light") {
43
+ currentScheme = stored;
44
+ document.documentElement.style.colorScheme = stored;
45
+ }
46
+
47
+ /**
48
+ * @param {"light" | "dark"} scheme
49
+ * @param {NodeListOf<HTMLButtonElement>} buttons
50
+ */
51
+ const applyScheme = (scheme, buttons) => {
52
+ const isDark = scheme === "dark";
53
+
54
+ for (const button of buttons) {
55
+ document.documentElement.style.colorScheme = scheme;
56
+ window.localStorage.setItem(STORAGE_KEY, scheme);
57
+ button.setAttribute("aria-pressed", String(isDark));
58
+ button.setAttribute("aria-label", isDark ? "Switch to light mode" : "Switch to dark mode");
59
+ }
60
+
61
+ document.dispatchEvent(new CustomEvent("color-scheme-changed", { detail: scheme }));
62
+ };
63
+
64
+ const onReady = () => {
65
+ /** @type {NodeListOf<HTMLButtonElement>} */
66
+ const colorSchemeButtons = document.querySelectorAll(".color-scheme-switch");
67
+
68
+ const isDark = currentScheme === "dark";
69
+
70
+ for (const colorSchemeButton of colorSchemeButtons) {
71
+ // Set initial state without triggering storage/event side-effects
72
+ colorSchemeButton.setAttribute("aria-pressed", String(isDark));
73
+ colorSchemeButton.setAttribute("aria-label", isDark ? "Switch to light mode" : "Switch to dark mode");
74
+
75
+ // Add event listener
76
+ colorSchemeButton.addEventListener("click", () => {
77
+ const nextScheme = colorSchemeButton.getAttribute("aria-pressed") === "true" ? "light" : "dark";
78
+ const { left, top, width, height } = colorSchemeButton.getBoundingClientRect();
79
+ viewTransition(() => applyScheme(nextScheme, colorSchemeButtons), left + width / 2, top + height / 2);
80
+ });
81
+ }
82
+ };
83
+
84
+ document.addEventListener("DOMContentLoaded", onReady, { once: true, passive: true });
85
+
86
+ /**
87
+ * @param {() => void} update
88
+ * @param {number} x
89
+ * @param {number} y
90
+ */
91
+ async function viewTransition(update, x, y) {
92
+ if (!document.startViewTransition || matchMedia("(prefers-reduced-motion: reduce)").matches) {
93
+ update();
94
+ return;
95
+ }
96
+
97
+ const transition = document.startViewTransition({ update, types: ["circular-reveal"] });
98
+
99
+ await transition.ready;
100
+
101
+ const xPercent = (x / window.innerWidth) * 100;
102
+ const yPercent = (y / window.innerHeight) * 100;
103
+
104
+ document.documentElement.animate(
105
+ { clipPath: [`circle(0% at ${xPercent}% ${yPercent}%)`, `circle(150vmax at ${xPercent}% ${yPercent}%)`] },
106
+ { duration: 400, easing: "cubic-bezier(0.64, 0, 0.78, 0)", pseudoElement: "::view-transition-new(root)" }
107
+ );
108
+ }
109
+ })();
110
+ </script>
111
+ </insert>
@@ -0,0 +1,77 @@
1
+ :root:active-view-transition-type(circular-reveal) {
2
+ &::view-transition-image-pair(root) {
3
+ isolation: auto;
4
+ }
5
+
6
+ &::view-transition-old(root),
7
+ &::view-transition-new(root) {
8
+ display: block;
9
+ mix-blend-mode: normal;
10
+ animation: none;
11
+ }
12
+ }
13
+
14
+ .color-scheme-switch-container {
15
+ display: flex;
16
+ align-items: center;
17
+ padding: 0.6em 1em;
18
+ }
19
+
20
+ .color-scheme-switch {
21
+ position: relative;
22
+ inline-size: var(--header-icon-size);
23
+ block-size: var(--header-icon-size);
24
+ padding: 0;
25
+ line-height: 0;
26
+ color: inherit;
27
+ appearance: none;
28
+ cursor: pointer;
29
+ outline-offset: 4px;
30
+ background: none;
31
+ border: none;
32
+ border-radius: 50%;
33
+
34
+ &:focus-visible {
35
+ outline: 2px solid var(--sb-color-accent, currentColor);
36
+ }
37
+ }
38
+
39
+ .switch-icon {
40
+ position: absolute;
41
+ inset: 0;
42
+ inline-size: 1.4em;
43
+ block-size: 1.4em;
44
+ fill: currentcolor;
45
+ transition:
46
+ opacity 250ms ease,
47
+ rotate 350ms cubic-bezier(0.34, 1.56, 0.64, 1),
48
+ scale 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
49
+ }
50
+
51
+ .color-scheme-switch[aria-pressed="false"] {
52
+ .switch-icon-sun {
53
+ opacity: 1;
54
+ rotate: 0deg;
55
+ scale: 1;
56
+ }
57
+
58
+ .switch-icon-moon {
59
+ opacity: 0;
60
+ rotate: -180deg;
61
+ scale: 0.5;
62
+ }
63
+ }
64
+
65
+ .color-scheme-switch[aria-pressed="true"] {
66
+ .switch-icon-sun {
67
+ opacity: 0;
68
+ rotate: 180deg;
69
+ scale: 0.5;
70
+ }
71
+
72
+ .switch-icon-moon {
73
+ opacity: 1;
74
+ rotate: 0deg;
75
+ scale: 1;
76
+ }
77
+ }
@@ -0,0 +1,66 @@
1
+ <!--
2
+ @part The whole docs page inside <body>: header, sidebar, content, table of contents, pagination.
3
+ @attr title - Site name shown in the header.
4
+ @attr minHeading - Lowest heading level in the table of contents. Default 2.
5
+ @attr maxHeading - Highest heading level in the table of contents. Default 3.
6
+ @slot - The page content.
7
+ @slot logo - Rendered before the title in the header link.
8
+ @slot icons - Links rendered in the header and the sidebar footer.
9
+ -->
10
+
11
+ <!-- ::: sv-accordion: sidebar, mobile table of contents, collapsible callouts ::: -->
12
+ <script src="@staticview/ui/accordion"></script>
13
+
14
+ <a class="skip-content-link" href="">Skip to content</a>
15
+
16
+ <part src="@staticbolt/docs/parts/header/header.part.html" title="{{ $data.title }}">
17
+ <slot name="logo" slot="logo"></slot>
18
+ <slot name="icons" slot="icons"></slot>
19
+ </part>
20
+
21
+ <div class="markdown-layout">
22
+ <part src="@staticbolt/docs/parts/sidebar/sidebar.part.html">
23
+ <slot name="icons" slot="icons"></slot>
24
+ </part>
25
+
26
+ <div class="markdown-wrapper">
27
+ <part src="@staticbolt/docs/parts/table-of-content/table-of-content-mobile.part.html"></part>
28
+
29
+ <div class="markdown-body">
30
+ <main data-pagefind-body>
31
+ <slot />
32
+ </main>
33
+
34
+ <footer>
35
+ <part src="@staticbolt/docs/parts/pagination-links/pagination-links.part.html"></part>
36
+ </footer>
37
+ </div>
38
+ </div>
39
+
40
+ <part
41
+ maxHeading="{{ $data.maxHeading ?? 3 }}"
42
+ minHeading="{{ $data.minHeading ?? 2 }}"
43
+ src="@staticbolt/docs/parts/table-of-content/table-of-content-desktop.part.html"
44
+ ></part>
45
+ </div>
46
+
47
+ <part src="@staticbolt/docs/parts/callouts/callouts.part.html"></part>
48
+ <part src="@staticbolt/docs/parts/mermaid/mermaid.part.html"></part>
49
+
50
+ <!-- ::: Page title and skip link ::: -->
51
+ <script build-time>
52
+ const heading = document.querySelector("h1[id]");
53
+ const title = document.querySelector("title");
54
+ const ogTitle = document.querySelector('meta[property="og:title"]');
55
+ const skipContent = document.querySelector("a.skip-content-link");
56
+
57
+ if (heading && title && heading.textContent !== title.textContent) {
58
+ const fullTitle = `${heading.textContent} | ${title.textContent}`;
59
+ title.textContent = fullTitle;
60
+ ogTitle?.setAttribute("content", fullTitle);
61
+ }
62
+
63
+ if (heading && skipContent) {
64
+ skipContent.setAttribute("href", `#${heading.id}`);
65
+ }
66
+ </script>
@@ -0,0 +1,62 @@
1
+ <header class="header">
2
+ <div class="header-content">
3
+ <div class="side-menu-trigger-container">
4
+ <button class="side-menu-trigger-button" aria-expanded="false" aria-label="Menu">
5
+ <svg class="menu-open-icon" aria-hidden="true" viewBox="0 -960 960 960" xmlns="http://www.w3.org/2000/svg">
6
+ <path d="M120-240v-80h720v80H120Zm0-200v-80h720v80H120Zm0-200v-80h720v80H120Z" />
7
+ </svg>
8
+
9
+ <svg class="menu-close-icon" aria-hidden="true" viewBox="0 -960 960 960" xmlns="http://www.w3.org/2000/svg">
10
+ <path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z" />
11
+ </svg>
12
+ </button>
13
+ </div>
14
+
15
+ <div class="header-title">
16
+ <div class="title-wrapper">
17
+ <a href="~/" translate="no">
18
+ <slot name="logo"></slot>
19
+ {{ $data.title }}
20
+ </a>
21
+ </div>
22
+ </div>
23
+
24
+ <div class="header-center">
25
+ <part src="../pagefind/pagefind.part.html"></part>
26
+ </div>
27
+
28
+ <div class="header-icons">
29
+ <slot name="icons"></slot>
30
+
31
+ <div class="header-color-scheme-switch">
32
+ <part src="../color-scheme-switch/color-scheme-switch.part.html"></part>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </header>
37
+
38
+ <!-- ::: Toggle the sidebar ::: -->
39
+ <script type="module">
40
+ // @ts-check
41
+
42
+ (() => {
43
+ /** @type {HTMLButtonElement | null} */
44
+ const menuTrigger = document.querySelector(".side-menu-trigger-button");
45
+ if (!menuTrigger) {
46
+ return;
47
+ }
48
+
49
+ /** @type {HTMLDivElement | null} */
50
+ const sidebar = document.querySelector(".sidebar");
51
+ if (!sidebar) {
52
+ menuTrigger.remove();
53
+ return;
54
+ }
55
+
56
+ menuTrigger.addEventListener("click", () => {
57
+ const isOpen = menuTrigger.getAttribute("aria-expanded") === "true";
58
+ menuTrigger.setAttribute("aria-expanded", String(!isOpen));
59
+ sidebar.classList.toggle("open", !isOpen);
60
+ });
61
+ })();
62
+ </script>
@@ -0,0 +1,123 @@
1
+ :root {
2
+ --header-icon-size: 1.5em;
3
+ --sb-header-height: 4rem;
4
+
5
+ @media (max-width: 900px) {
6
+ --sb-header-height: 3rem;
7
+ }
8
+ }
9
+
10
+ .header {
11
+ position: sticky;
12
+ inset-block-start: 0;
13
+ z-index: 100;
14
+ display: grid;
15
+ align-items: center;
16
+ block-size: var(--sb-header-height);
17
+ padding-inline: 1.5em 1em;
18
+ background-color: rgb(from var(--sb-color-black) r g b / 80%);
19
+ border-block-end: 1px solid var(--sb-color-gray-5);
20
+ backdrop-filter: blur(7px);
21
+
22
+ @media (max-width: 900px) {
23
+ padding-inline: 0.8em 0.5em;
24
+ }
25
+
26
+ @media print {
27
+ display: none;
28
+ }
29
+
30
+ .header-content {
31
+ display: grid;
32
+ grid-template-columns: 1fr 2fr 1fr;
33
+ align-content: center;
34
+ inline-size: 100%;
35
+ max-inline-size: 100rem;
36
+ margin: auto;
37
+ }
38
+
39
+ .side-menu-trigger-container {
40
+ display: none;
41
+ align-items: center;
42
+
43
+ .side-menu-trigger-button {
44
+ position: relative;
45
+ inline-size: var(--header-icon-size);
46
+ block-size: var(--header-icon-size);
47
+ color: inherit;
48
+ cursor: pointer;
49
+ background-color: transparent;
50
+ border: none;
51
+
52
+ svg {
53
+ position: absolute;
54
+ inset: 0;
55
+ inline-size: var(--header-icon-size);
56
+ block-size: var(--header-icon-size);
57
+ opacity: 0;
58
+ fill: currentcolor;
59
+ rotate: 0deg;
60
+ scale: 0;
61
+ transition:
62
+ opacity 0.25s ease,
63
+ scale 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
64
+ }
65
+
66
+ &[aria-expanded="true"] .menu-close-icon,
67
+ &[aria-expanded="false"] .menu-open-icon {
68
+ opacity: 1;
69
+ scale: 1;
70
+ }
71
+ }
72
+ }
73
+
74
+ .header-title {
75
+ display: grid;
76
+ align-items: center;
77
+
78
+ .title-wrapper {
79
+ a {
80
+ font-family: var(--sb-md-font);
81
+ font-size: var(--sb-text-h3);
82
+ font-weight: 600;
83
+ color: var(--sb-color-accent-high);
84
+ text-decoration: none;
85
+ }
86
+ }
87
+ }
88
+
89
+ .header-center {
90
+ display: grid;
91
+ place-items: center;
92
+ }
93
+
94
+ .header-icons {
95
+ display: flex;
96
+ align-items: center;
97
+ justify-content: flex-end;
98
+
99
+ .header-color-scheme-switch {
100
+ border-inline-start: solid 1px var(--sb-color-gray-5);
101
+ }
102
+ }
103
+ }
104
+
105
+ @media (max-width: 900px) {
106
+ .header {
107
+ .side-menu-trigger-container {
108
+ display: flex;
109
+ }
110
+
111
+ .header-title {
112
+ text-align: center;
113
+ }
114
+
115
+ .header-center {
116
+ justify-items: end;
117
+ }
118
+
119
+ .header-icons {
120
+ display: none;
121
+ }
122
+ }
123
+ }
@@ -0,0 +1,15 @@
1
+ <!-- ::: Renders ```mermaid fences, themed from the page's CSS variables ::: -->
2
+ <script type="module" data-mermaid-script src="@staticbolt/docs/scripts/mermaid.ts"></script>
3
+
4
+ <!-- ::: Drop the script from pages without a diagram ::: -->
5
+ <script build-time>
6
+ const mermaidScript = document.querySelector("[data-mermaid-script]");
7
+
8
+ if (mermaidScript) {
9
+ mermaidScript.removeAttribute("data-mermaid-script");
10
+
11
+ if (!document.querySelector(".mermaid")) {
12
+ mermaidScript.remove();
13
+ }
14
+ }
15
+ </script>
@@ -0,0 +1,75 @@
1
+ <pagefind-modal-trigger></pagefind-modal-trigger>
2
+
3
+ <button class="pagefind-modal-trigger-button" style="display: none" aria-keyshortcuts="Control+k" aria-label="Search">
4
+ <svg aria-hidden="true" viewBox="0 0 24 24">
5
+ <path
6
+ d="M21.71 20.29 18 16.61A9 9 0 1 0 16.61 18l3.68 3.68a.999.999 0 0 0 1.42 0 1 1 0 0 0 0-1.39ZM11 18a7 7 0 1 1 0-14 7 7 0 0 1 0 14Z"
7
+ ></path>
8
+ </svg>
9
+ </button>
10
+
11
+ <pagefind-modal></pagefind-modal>
12
+
13
+ <!-- ::: Path from this page to the Pagefind bundle, so the site works on any subpath ::: -->
14
+ <script type="module" build-time>
15
+ import { dirname, relative } from "node:path";
16
+
17
+ const modal = document.querySelector("pagefind-modal");
18
+ modal.setAttribute("data-bundle-path", relative(dirname(__filepath), "pagefind") + "/");
19
+ </script>
20
+
21
+ <insert selector="body">
22
+ <link class="pagefind-stylesheet" as="style" bundle href="./pagefind.style.css" rel="preload" />
23
+
24
+ <script type="module">
25
+ // @ts-check
26
+
27
+ (async () => {
28
+ // ::: Lazy-load the Pagefind UI. :::
29
+
30
+ /** @type {HTMLLinkElement | null} */
31
+ const pagefindStyleSheet = document.querySelector(".pagefind-stylesheet");
32
+ if (!pagefindStyleSheet) {
33
+ console.error("Could not find pagefind stylesheet element");
34
+ return;
35
+ }
36
+
37
+ const onLoad = async () => {
38
+ pagefindStyleSheet.rel = "stylesheet";
39
+
40
+ const { getInstanceManager } = await import("@pagefind/component-ui");
41
+
42
+ const relativeBundlePath = document.querySelector("pagefind-modal")?.getAttribute("data-bundle-path") ?? "pagefind/";
43
+ const bundlePath = new URL(relativeBundlePath, import.meta.url).pathname;
44
+ getInstanceManager().instances.get("default").options.bundlePath = bundlePath;
45
+ };
46
+
47
+ const isDownloaded = performance.getEntriesByName(pagefindStyleSheet.href).length > 0;
48
+ if (isDownloaded) {
49
+ await onLoad();
50
+ } else {
51
+ pagefindStyleSheet.addEventListener("load", onLoad, { once: true });
52
+ }
53
+
54
+ // ::: Open the Pagefind modal when the search button is clicked. :::
55
+
56
+ /** @type {(HTMLElement & { openModal(): void }) | null} */
57
+ const pagefindModalTrigger = document.querySelector("pagefind-modal-trigger");
58
+ if (!pagefindModalTrigger) {
59
+ console.error("Could not find pagefind modal trigger element");
60
+ return;
61
+ }
62
+
63
+ /** @type {HTMLButtonElement | null} */
64
+ const triggerModalIconButton = document.querySelector(".pagefind-modal-trigger-button");
65
+ if (!triggerModalIconButton) {
66
+ console.error("Could not find pagefind modal trigger button element");
67
+ return;
68
+ }
69
+
70
+ triggerModalIconButton.addEventListener("click", () => {
71
+ pagefindModalTrigger.openModal();
72
+ });
73
+ })();
74
+ </script>
75
+ </insert>
@@ -0,0 +1,57 @@
1
+ @import url("@pagefind/component-ui/css");
2
+
3
+ :root {
4
+ --pf-text: var(--sb-color-gray-0);
5
+ --pf-text-secondary: var(--sb-color-gray-0);
6
+ --pf-text-muted: var(--sb-color-gray-3);
7
+ --pf-background: var(--sb-color-gray-7);
8
+ --pf-border: var(--sb-color-gray-5);
9
+ --pf-border-focus: var(--sb-color-gray-4);
10
+ --pf-skeleton: var(--sb-color-gray-5);
11
+ --pf-skeleton-shine: var(--sb-color-gray-6);
12
+ --pf-hover: var(--sb-color-gray-5);
13
+ --pf-mark: var(--sb-color-accent-high);
14
+ --pf-error-text: var(--sb-caution-text);
15
+ --pf-error-bg: var(--sb-caution-background);
16
+ --pf-error-border: var(--sb-caution-border);
17
+ }
18
+
19
+ :is(pagefind-modal-trigger, pagefind-modal, pagefind-modal-header, pagefind-summary, pagefind-results, pagefind-input) {
20
+ color-scheme: inherit !important;
21
+
22
+ &:not(:defined) {
23
+ display: none;
24
+ }
25
+ }
26
+
27
+ pagefind-modal-trigger {
28
+ inline-size: 100%;
29
+ max-inline-size: 20em;
30
+ padding-inline: 0.5em;
31
+
32
+ @media (max-width: 900px) {
33
+ display: none;
34
+ }
35
+ }
36
+
37
+ pagefind-modal {
38
+ display: contents;
39
+ }
40
+
41
+ .pagefind-modal-trigger-button {
42
+ display: none;
43
+ color: inherit;
44
+ cursor: pointer;
45
+ background-color: transparent;
46
+ border: none;
47
+
48
+ @media (max-width: 900px) {
49
+ display: block !important;
50
+ }
51
+
52
+ svg {
53
+ inline-size: var(--header-icon-size);
54
+ block-size: var(--header-icon-size);
55
+ fill: currentcolor;
56
+ }
57
+ }