@robert-stackflow/oneui 0.6.7 → 0.6.16

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 (114) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/README.md +255 -188
  3. package/components/AccountItem.module.css +103 -103
  4. package/components/Alert.d.ts +2 -9
  5. package/components/Alert.js +2 -40
  6. package/components/AppShell.d.ts +7 -7
  7. package/components/AppShell.js +37 -33
  8. package/components/AppShell.module.css +223 -271
  9. package/components/AppearanceSettings.js +25 -32
  10. package/components/Badge.module.css +30 -30
  11. package/components/Banner.d.ts +17 -0
  12. package/components/Banner.js +99 -0
  13. package/components/Banner.module.css +143 -0
  14. package/components/BarChart.module.css +35 -34
  15. package/components/Breadcrumb.module.css +97 -97
  16. package/components/Button.module.css +120 -120
  17. package/components/Cascader.js +1 -0
  18. package/components/CharacterPicker.js +2 -0
  19. package/components/Checkbox.module.css +95 -95
  20. package/components/Combobox.js +1 -0
  21. package/components/Combobox.module.css +6 -1
  22. package/components/CommandPalette.js +2 -2
  23. package/components/ContributionCalendar.module.css +121 -121
  24. package/components/Control.module.css +86 -86
  25. package/components/DataTable.d.ts +3 -2
  26. package/components/DataTable.js +92 -66
  27. package/components/DataTable.module.css +3 -31
  28. package/components/DatePicker.js +1 -0
  29. package/components/DateRangePicker.js +1 -0
  30. package/components/Dialog.d.ts +3 -1
  31. package/components/Dialog.js +11 -4
  32. package/components/Dialog.module.css +139 -97
  33. package/components/DialogVariants.d.ts +2 -1
  34. package/components/DialogVariants.js +35 -7
  35. package/components/HierarchyPicker.module.css +185 -181
  36. package/components/IconPicker.js +2 -0
  37. package/components/Indicator.module.css +83 -83
  38. package/components/Layout.module.css +82 -82
  39. package/components/Markdown.d.ts +13 -0
  40. package/components/Markdown.js +164 -0
  41. package/components/Markdown.module.css +227 -0
  42. package/components/MenuItem.module.css +172 -172
  43. package/components/MultiSelect.js +1 -0
  44. package/components/MultiSelect.module.css +2 -0
  45. package/components/NavBar.d.ts +20 -0
  46. package/components/NavBar.js +197 -0
  47. package/components/NavBar.module.css +130 -0
  48. package/components/NavigationSurface.module.css +27 -0
  49. package/components/Picker.module.css +7 -0
  50. package/components/Popover.d.ts +6 -1
  51. package/components/Popover.js +39 -13
  52. package/components/Popover.module.css +8 -0
  53. package/components/Progress.module.css +33 -33
  54. package/components/RadioGroup.module.css +87 -87
  55. package/components/RangeSlider.module.css +141 -141
  56. package/components/ResizablePanel.module.css +101 -101
  57. package/components/ResourceCard.module.css +98 -98
  58. package/components/SelectSettingRow.d.ts +7 -0
  59. package/components/SelectSettingRow.js +58 -0
  60. package/components/SettingRow.d.ts +9 -3
  61. package/components/SettingRow.js +32 -8
  62. package/components/SettingRow.module.css +17 -0
  63. package/components/SettingsLayout.d.ts +15 -3
  64. package/components/SettingsLayout.js +46 -29
  65. package/components/SideBar.d.ts +9 -0
  66. package/components/SideBar.js +30 -0
  67. package/components/SidebarNavigation.d.ts +24 -3
  68. package/components/SidebarNavigation.js +274 -47
  69. package/components/SidebarNavigation.module.css +352 -130
  70. package/components/Slider.module.css +19 -19
  71. package/components/Steps.module.css +176 -176
  72. package/components/Switch.d.ts +3 -1
  73. package/components/Switch.js +5 -1
  74. package/components/Switch.module.css +59 -59
  75. package/components/SwitchSettingRow.d.ts +7 -0
  76. package/components/SwitchSettingRow.js +45 -0
  77. package/components/Tab.module.css +148 -148
  78. package/components/Table.d.ts +8 -1
  79. package/components/Table.js +34 -17
  80. package/components/Table.module.css +87 -48
  81. package/components/TableMarkup.d.ts +2 -1
  82. package/components/TableMarkup.js +18 -1
  83. package/components/TableOfContents.d.ts +22 -0
  84. package/components/TableOfContents.js +462 -0
  85. package/components/TableOfContents.module.css +252 -0
  86. package/components/TextAreaSettingRow.d.ts +9 -0
  87. package/components/TextAreaSettingRow.js +47 -0
  88. package/components/TextSettingRow.d.ts +9 -0
  89. package/components/TextSettingRow.js +45 -0
  90. package/components/ThemePicker.module.css +178 -178
  91. package/components/ThemeProvider.js +2 -0
  92. package/components/TimeColumns.module.css +47 -47
  93. package/components/Timeline.module.css +202 -202
  94. package/components/Toast.d.ts +8 -1
  95. package/components/Toast.js +49 -17
  96. package/components/Toast.module.css +25 -0
  97. package/components/ToastProvider.d.ts +4 -1
  98. package/components/ToastProvider.js +67 -12
  99. package/components/TreeSelect.js +1 -0
  100. package/components/TreeTable.d.ts +3 -3
  101. package/components/TreeTable.js +12 -2
  102. package/components/TreeTable.module.css +57 -53
  103. package/components/createToaster.d.ts +2 -1
  104. package/components/createToaster.js +28 -14
  105. package/components/index.d.ts +18 -1
  106. package/components/index.js +24 -0
  107. package/components/motion.d.ts +1 -0
  108. package/components/motion.js +18 -6
  109. package/components/settingRowControl.d.ts +7 -0
  110. package/components/settingRowControl.js +15 -0
  111. package/package.json +57 -3
  112. package/styles/base.css +206 -206
  113. package/styles/blue.css +270 -268
  114. package/styles/minimal.css +4 -25
@@ -1,82 +1,82 @@
1
- .text {
2
- margin: 0;
3
- line-height: 1.65;
4
- overflow-wrap: anywhere;
5
- }
6
- .heading {
7
- margin: 0;
8
- line-height: 1.35;
9
- font-weight: 600;
10
- letter-spacing: -0.02em;
11
- overflow-wrap: anywhere;
12
- }
13
- .truncate {
14
- white-space: nowrap;
15
- overflow: hidden;
16
- text-overflow: ellipsis;
17
- }
18
- .grid {
19
- display: grid;
20
- grid-template-columns: repeat(var(--grid-base), minmax(0, 1fr));
21
- }
22
- @media (min-width: 768px) {
23
- .grid {
24
- grid-template-columns: repeat(var(--grid-sm), minmax(0, 1fr));
25
- }
26
- }
27
- @media (min-width: 1200px) {
28
- .grid {
29
- grid-template-columns: repeat(var(--grid-lg), minmax(0, 1fr));
30
- }
31
- }
32
- @media (min-width: 1440px) {
33
- .grid {
34
- grid-template-columns: repeat(var(--grid-xl), minmax(0, 1fr));
35
- }
36
- }
37
- .code {
38
- font:
39
- 12px/1.7 Consolas,
40
- monospace;
41
- background: var(--soft);
42
- border-radius: 5px;
43
- padding: 2px 5px;
44
- color: var(--fg);
45
- overflow-wrap: anywhere;
46
- }
47
- .codeBlock {
48
- margin: 0;
49
- padding: 16px;
50
- white-space: pre-wrap;
51
- overflow: auto;
52
- }
53
- .icon {
54
- display: inline-flex;
55
- align-items: center;
56
- justify-content: center;
57
- color: var(--accent);
58
- background: var(--selected);
59
- flex-shrink: 0;
60
- }
61
- .scroll {
62
- overflow: auto;
63
- min-width: 0;
64
- }
65
- .interactive {
66
- text-decoration: none;
67
- color: inherit;
68
- transition:
69
- border-color var(--motion-hover),
70
- background var(--motion-hover);
71
- }
72
- .interactive:hover {
73
- border-color: var(--accent);
74
- background: var(--field);
75
- }
76
- .mark {
77
- background: var(--selected);
78
- color: var(--fg);
79
- border-radius: 3px;
80
- padding: 0 1px;
81
- font-weight: 600;
82
- }
1
+ .text {
2
+ margin: 0;
3
+ line-height: 1.65;
4
+ overflow-wrap: anywhere;
5
+ }
6
+ .heading {
7
+ margin: 0;
8
+ line-height: 1.35;
9
+ font-weight: 600;
10
+ letter-spacing: -0.02em;
11
+ overflow-wrap: anywhere;
12
+ }
13
+ .truncate {
14
+ white-space: nowrap;
15
+ overflow: hidden;
16
+ text-overflow: ellipsis;
17
+ }
18
+ .grid {
19
+ display: grid;
20
+ grid-template-columns: repeat(var(--grid-base), minmax(0, 1fr));
21
+ }
22
+ @media (min-width: 768px) {
23
+ .grid {
24
+ grid-template-columns: repeat(var(--grid-sm), minmax(0, 1fr));
25
+ }
26
+ }
27
+ @media (min-width: 1200px) {
28
+ .grid {
29
+ grid-template-columns: repeat(var(--grid-lg), minmax(0, 1fr));
30
+ }
31
+ }
32
+ @media (min-width: 1440px) {
33
+ .grid {
34
+ grid-template-columns: repeat(var(--grid-xl), minmax(0, 1fr));
35
+ }
36
+ }
37
+ .code {
38
+ font:
39
+ 12px/1.7 Consolas,
40
+ monospace;
41
+ background: var(--soft);
42
+ border-radius: 5px;
43
+ padding: 2px 5px;
44
+ color: var(--fg);
45
+ overflow-wrap: anywhere;
46
+ }
47
+ .codeBlock {
48
+ margin: 0;
49
+ padding: 16px;
50
+ white-space: pre-wrap;
51
+ overflow: auto;
52
+ }
53
+ .icon {
54
+ display: inline-flex;
55
+ align-items: center;
56
+ justify-content: center;
57
+ color: var(--accent-ink, var(--accent));
58
+ background: var(--selected);
59
+ flex-shrink: 0;
60
+ }
61
+ .scroll {
62
+ overflow: auto;
63
+ min-width: 0;
64
+ }
65
+ .interactive {
66
+ text-decoration: none;
67
+ color: inherit;
68
+ transition:
69
+ border-color var(--motion-hover),
70
+ background var(--motion-hover);
71
+ }
72
+ .interactive:hover {
73
+ border-color: var(--accent);
74
+ background: var(--field);
75
+ }
76
+ .mark {
77
+ background: var(--selected);
78
+ color: var(--fg);
79
+ border-radius: 3px;
80
+ padding: 0 1px;
81
+ font-weight: 600;
82
+ }
@@ -0,0 +1,13 @@
1
+ import { type Components } from "react-markdown";
2
+ import type { TableAppearance } from "./Table";
3
+ export type MarkdownCodeTheme = "auto" | "github-light" | "github-dark" | "nord" | "dracula";
4
+ export type MarkdownProps = {
5
+ children: string;
6
+ className?: string;
7
+ codeTheme?: MarkdownCodeTheme;
8
+ tableProps?: TableAppearance;
9
+ /** Override individual elements while retaining the shared parser and styles. */
10
+ components?: Components;
11
+ };
12
+ /** Shared GFM rendering; raw HTML is omitted and URL filtering stays enabled. */
13
+ export declare function Markdown({ children, className, components, codeTheme, tableProps, }: MarkdownProps): import("react").JSX.Element;
@@ -0,0 +1,164 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import {
3
+ useId,
4
+ useContext,
5
+ createContext,
6
+ useMemo
7
+ } from "react";
8
+ import ReactMarkdown from "react-markdown";
9
+ import remarkGfm from "remark-gfm";
10
+ import { Check, Copy } from "lucide-react";
11
+ import { CopyButton } from "./CopyButton.js";
12
+ import { IconButton } from "./IconButton.js";
13
+ import { TableMarkup } from "./TableMarkup.js";
14
+ import { common, createLowlight } from "lowlight";
15
+ import { toJsxRuntime } from "hast-util-to-jsx-runtime";
16
+ import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
17
+ const syntax = createLowlight(common);
18
+ syntax.registerAlias({ typescript: ["ts", "tsx"], javascript: ["js", "jsx"] });
19
+ const MarkdownOptions = createContext({ codeTheme: "auto", tableProps: { striped: true } });
20
+ import s from "./Markdown.module.css";
21
+ function CodeBlock({
22
+ value,
23
+ language,
24
+ children
25
+ }) {
26
+ const { codeTheme } = useContext(MarkdownOptions);
27
+ const highlighted = useMemo(
28
+ () => language && syntax.registered(language) ? toJsxRuntime(syntax.highlight(language, value), {
29
+ Fragment,
30
+ jsx: jsx2,
31
+ jsxs: jsxs2
32
+ }) : null,
33
+ [language, value]
34
+ );
35
+ return /* @__PURE__ */ jsxs("figure", { className: s.codeBlock, "data-code-theme": codeTheme, children: [
36
+ /* @__PURE__ */ jsxs("figcaption", { children: [
37
+ /* @__PURE__ */ jsx("span", { children: language || "\u6587\u672C" }),
38
+ /* @__PURE__ */ jsx(CopyButton, { value, children: ({ copied, copy }) => /* @__PURE__ */ jsx(
39
+ IconButton,
40
+ {
41
+ size: "small",
42
+ label: copied ? "\u5DF2\u590D\u5236\u4EE3\u7801" : "\u590D\u5236\u4EE3\u7801",
43
+ onClick: copy,
44
+ children: copied ? /* @__PURE__ */ jsx(Check, { size: 15 }) : /* @__PURE__ */ jsx(Copy, { size: 15 })
45
+ }
46
+ ) })
47
+ ] }),
48
+ /* @__PURE__ */ jsx("pre", { children: highlighted ? /* @__PURE__ */ jsx("code", { className: "hljs", children: highlighted }) : children })
49
+ ] });
50
+ }
51
+ function MarkdownTable({
52
+ node: _node,
53
+ children,
54
+ ...props
55
+ }) {
56
+ const { tableProps } = useContext(MarkdownOptions);
57
+ return /* @__PURE__ */ jsx(
58
+ "div",
59
+ {
60
+ className: s.tableScroll,
61
+ tabIndex: 0,
62
+ role: "region",
63
+ "aria-label": "Markdown \u8868\u683C",
64
+ children: /* @__PURE__ */ jsx(TableMarkup, { ...props, ...tableProps, className: s.table, children })
65
+ }
66
+ );
67
+ }
68
+ const renderers = {
69
+ pre({ node, children }) {
70
+ const code = node?.children[0];
71
+ const value = code?.type === "element" ? code.children.map((child) => child.type === "text" ? child.value : "").join("") : "";
72
+ const classes = code?.type === "element" ? String(code.properties.className ?? "") : "";
73
+ const language = /language-([^\s,]+)/.exec(classes)?.[1];
74
+ return /* @__PURE__ */ jsx(CodeBlock, { value, language, children });
75
+ },
76
+ table: MarkdownTable,
77
+ a({ node: _node, href, children, ...props }) {
78
+ const external = /^https?:\/\//i.test(href ?? "") || href?.startsWith("//");
79
+ return /* @__PURE__ */ jsx(
80
+ "a",
81
+ {
82
+ ...props,
83
+ href,
84
+ target: external ? "_blank" : void 0,
85
+ rel: external ? "noopener noreferrer" : void 0,
86
+ children
87
+ }
88
+ );
89
+ },
90
+ img({ node: _node, ...props }) {
91
+ return /* @__PURE__ */ jsx("img", { ...props, loading: "lazy", decoding: "async" });
92
+ },
93
+ input({ node: _node, ...props }) {
94
+ return /* @__PURE__ */ jsx(
95
+ "input",
96
+ {
97
+ ...props,
98
+ disabled: true,
99
+ "aria-label": props.checked ? "\u5DF2\u5B8C\u6210\u4EFB\u52A1" : "\u5F85\u5B8C\u6210\u4EFB\u52A1"
100
+ }
101
+ );
102
+ }
103
+ };
104
+ const plugins = [remarkGfm];
105
+ function footnoteLabels({ id, prefix }) {
106
+ return (tree) => {
107
+ const slugs = /* @__PURE__ */ new Map();
108
+ const text = (node) => node.type === "text" ? node.value : "children" in node ? node.children.map(text).join("") : "";
109
+ const visit = (node) => {
110
+ if (node.type === "element") {
111
+ if (/^h[1-6]$/.test(node.tagName) && !node.properties.id) {
112
+ const slug = text(node).trim().toLowerCase().replace(/[^\p{L}\p{N}\s-]/gu, "").replace(/\s+/g, "-") || "section";
113
+ const index = slugs.get(slug) ?? 0;
114
+ slugs.set(slug, index + 1);
115
+ node.properties.id = prefix + slug + (index ? `-${index + 1}` : "");
116
+ }
117
+ if (node.properties.id === "footnote-label") node.properties.id = id;
118
+ const describedBy = node.properties.ariaDescribedBy;
119
+ if (Array.isArray(describedBy)) {
120
+ node.properties.ariaDescribedBy = describedBy.map(
121
+ (value) => value === "footnote-label" ? id : value
122
+ );
123
+ }
124
+ }
125
+ if ("children" in node) node.children.forEach(visit);
126
+ };
127
+ visit(tree);
128
+ };
129
+ }
130
+ function Markdown({
131
+ children,
132
+ className = "",
133
+ components,
134
+ codeTheme = "auto",
135
+ tableProps = { striped: true }
136
+ }) {
137
+ const id = useId();
138
+ return /* @__PURE__ */ jsx(MarkdownOptions, { value: { codeTheme, tableProps }, children: /* @__PURE__ */ jsx("div", { className: `${s.markdown} ${className}`, "data-markdown": true, children: /* @__PURE__ */ jsx(
139
+ ReactMarkdown,
140
+ {
141
+ remarkPlugins: plugins,
142
+ rehypePlugins: [
143
+ [
144
+ footnoteLabels,
145
+ {
146
+ id: `oneui-markdown-${id.replaceAll(":", "")}-footnote-label`,
147
+ prefix: `oneui-markdown-${id.replaceAll(":", "")}-`
148
+ }
149
+ ]
150
+ ],
151
+ skipHtml: true,
152
+ remarkRehypeOptions: {
153
+ clobberPrefix: `oneui-markdown-${id.replaceAll(":", "")}-`,
154
+ footnoteLabel: "\u6CE8\u91CA",
155
+ footnoteBackLabel: "\u8FD4\u56DE\u6B63\u6587"
156
+ },
157
+ components: components ? { ...renderers, ...components } : renderers,
158
+ children
159
+ }
160
+ ) }) });
161
+ }
162
+ export {
163
+ Markdown
164
+ };
@@ -0,0 +1,227 @@
1
+ .markdown {
2
+ min-width: 0;
3
+ color: var(--fg);
4
+ font: 14px/1.75 var(--ui-font, system-ui, sans-serif);
5
+ overflow-wrap: anywhere;
6
+ }
7
+ .markdown.markdown :is(h1, h2, h3, h4, h5, h6) {
8
+ margin: 1.6em 0 0.6em;
9
+ color: var(--fg);
10
+ font-family: inherit;
11
+ font-weight: 600;
12
+ line-height: 1.4;
13
+ letter-spacing: -0.02em;
14
+ }
15
+ .markdown.markdown h1 {
16
+ font-size: 1.9em;
17
+ }
18
+ .markdown.markdown h2 {
19
+ font-size: 1.45em;
20
+ }
21
+ .markdown.markdown h3 {
22
+ font-size: 1.2em;
23
+ }
24
+ .markdown.markdown :is(h4, h5, h6) {
25
+ font-size: 1em;
26
+ }
27
+ .markdown :is(p, ul, ol, blockquote, figure, .tableScroll) {
28
+ margin: 0 0 1em;
29
+ }
30
+ .markdown.markdown > :first-child {
31
+ margin-top: 0;
32
+ }
33
+ .markdown.markdown > :last-child {
34
+ margin-bottom: 0;
35
+ }
36
+ .markdown :is(ul, ol) {
37
+ padding-left: 1.6em;
38
+ }
39
+ .markdown li + li {
40
+ margin-top: 0.3em;
41
+ }
42
+ .markdown li > :is(ul, ol) {
43
+ margin-block: 0.3em;
44
+ }
45
+ .markdown a {
46
+ color: var(--accent-ink, var(--accent));
47
+ text-decoration: underline;
48
+ text-underline-offset: 3px;
49
+ }
50
+ .markdown a:hover {
51
+ text-decoration-thickness: 2px;
52
+ }
53
+ .markdown :is(a, .tableScroll):focus-visible {
54
+ outline: 2px solid var(--accent-ink, var(--accent));
55
+ outline-offset: 3px;
56
+ }
57
+ .markdown blockquote {
58
+ padding: 0.3em 1em;
59
+ border-left: 3px solid var(--line);
60
+ color: var(--muted);
61
+ }
62
+ .markdown blockquote > :last-child {
63
+ margin-bottom: 0;
64
+ }
65
+ .markdown hr {
66
+ border: 0;
67
+ border-top: 1px solid var(--line);
68
+ margin: 1.5em 0;
69
+ }
70
+ .markdown img {
71
+ display: block;
72
+ max-width: 100%;
73
+ height: auto;
74
+ border-radius: var(--radius);
75
+ }
76
+ .markdown code {
77
+ font:
78
+ 0.9em/1.65 ui-monospace,
79
+ SFMono-Regular,
80
+ Consolas,
81
+ monospace;
82
+ padding: 0.15em 0.4em;
83
+ border-radius: 4px;
84
+ background: var(--hover);
85
+ }
86
+ .codeBlock {
87
+ overflow: hidden;
88
+ border: 1px solid var(--line);
89
+ border-radius: var(--radius);
90
+ background: var(--canvas);
91
+ }
92
+ .codeBlock > figcaption {
93
+ display: flex;
94
+ align-items: center;
95
+ justify-content: space-between;
96
+ gap: 12px;
97
+ min-height: 38px;
98
+ padding: 5px 12px;
99
+ border-bottom: 1px solid var(--line);
100
+ color: var(--muted);
101
+ font-size: 11px;
102
+ }
103
+ .codeBlock > pre {
104
+ max-width: 100%;
105
+ margin: 0;
106
+ padding: 16px;
107
+ overflow: auto;
108
+ tab-size: 2;
109
+ }
110
+ .codeBlock code {
111
+ display: block;
112
+ padding: 0;
113
+ border-radius: 0;
114
+ background: transparent;
115
+ white-space: pre;
116
+ overflow-wrap: normal;
117
+ }
118
+ .tableScroll {
119
+ max-width: 100%;
120
+ overflow-x: auto;
121
+ border: 1px solid var(--line);
122
+ border-radius: var(--radius);
123
+ }
124
+ .markdown .table {
125
+ min-width: 400px;
126
+ white-space: normal;
127
+ }
128
+ .markdown :global(.contains-task-list) {
129
+ list-style: none;
130
+ padding-left: 0.2em;
131
+ }
132
+ .markdown input[type="checkbox"] {
133
+ width: 14px;
134
+ height: 14px;
135
+ margin: 0 0.5em 0 0;
136
+ vertical-align: -0.1em;
137
+ accent-color: var(--accent);
138
+ }
139
+ .markdown :global(.footnotes) {
140
+ margin-top: 2em;
141
+ padding-top: 1em;
142
+ border-top: 1px solid var(--line);
143
+ color: var(--muted);
144
+ font-size: 0.9em;
145
+ }
146
+ @media (max-width: 540px) {
147
+ .markdown {
148
+ font-size: 13px;
149
+ }
150
+ .codeBlock > pre {
151
+ padding: 12px;
152
+ }
153
+ }
154
+
155
+ .codeBlock {
156
+ --code-bg: #f6f8fa;
157
+ --code-fg: #24292f;
158
+ --code-keyword: #cf222e;
159
+ --code-string: #0a3069;
160
+ --code-number: #0550ae;
161
+ --code-title: #8250df;
162
+ --code-comment: #6e7781;
163
+ background: var(--code-bg);
164
+ color: var(--code-fg);
165
+ }
166
+ :global([data-theme="dark"]) .codeBlock[data-code-theme="auto"],
167
+ .codeBlock[data-code-theme="github-dark"] {
168
+ --code-bg: #0d1117;
169
+ --code-fg: #c9d1d9;
170
+ --code-keyword: #ff7b72;
171
+ --code-string: #a5d6ff;
172
+ --code-number: #79c0ff;
173
+ --code-title: #d2a8ff;
174
+ --code-comment: #8b949e;
175
+ }
176
+ .codeBlock[data-code-theme="nord"] {
177
+ --code-bg: #2e3440;
178
+ --code-fg: #d8dee9;
179
+ --code-keyword: #81a1c1;
180
+ --code-string: #a3be8c;
181
+ --code-number: #b48ead;
182
+ --code-title: #88c0d0;
183
+ --code-comment: #8a97ad;
184
+ }
185
+ .codeBlock[data-code-theme="dracula"] {
186
+ --code-bg: #282a36;
187
+ --code-fg: #f8f8f2;
188
+ --code-keyword: #ff79c6;
189
+ --code-string: #f1fa8c;
190
+ --code-number: #bd93f9;
191
+ --code-title: #50fa7b;
192
+ --code-comment: #9baddb;
193
+ }
194
+ .codeBlock > figcaption {
195
+ color: var(--code-comment);
196
+ border-color: color-mix(in srgb, var(--code-fg) 15%, transparent);
197
+ }
198
+ .codeBlock pre code {
199
+ color: var(--code-fg);
200
+ }
201
+ .codeBlock :global(.hljs-keyword),
202
+ .codeBlock :global(.hljs-selector-tag),
203
+ .codeBlock :global(.hljs-tag) {
204
+ color: var(--code-keyword);
205
+ }
206
+ .codeBlock :global(.hljs-string),
207
+ .codeBlock :global(.hljs-regexp),
208
+ .codeBlock :global(.hljs-addition) {
209
+ color: var(--code-string);
210
+ }
211
+ .codeBlock :global(.hljs-number),
212
+ .codeBlock :global(.hljs-literal),
213
+ .codeBlock :global(.hljs-attr) {
214
+ color: var(--code-number);
215
+ }
216
+ .codeBlock :global(.hljs-title),
217
+ .codeBlock :global(.hljs-function),
218
+ .codeBlock :global(.hljs-built_in) {
219
+ color: var(--code-title);
220
+ }
221
+ .codeBlock :global(.hljs-comment),
222
+ .codeBlock :global(.hljs-meta) {
223
+ color: var(--code-comment);
224
+ }
225
+ .markdown :is(h1, h2, h3, h4, h5, h6)[id] {
226
+ scroll-margin-top: 32px;
227
+ }