radiant-docs 0.1.46 → 0.1.48
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.
- package/package.json +1 -1
- package/template/package-lock.json +10 -0
- package/template/package.json +1 -0
- package/template/src/components/OpenApiPage.astro +121 -64
- package/template/src/components/PagePagination.astro +1 -1
- package/template/src/components/SidebarSubgroup.astro +1 -1
- package/template/src/components/endpoint/RequestSnippets.astro +175 -16
- package/template/src/components/endpoint/ResponseDisplay.astro +21 -16
- package/template/src/components/endpoint/ResponseSnippets.astro +175 -16
- package/template/src/components/ui/CodeTabEdge.astro +11 -60
- package/template/src/components/user/Callout.astro +117 -62
- package/template/src/components/user/CodeBlock.astro +31 -20
- package/template/src/components/user/CodeGroup.astro +46 -36
- package/template/src/lib/code/code-block.ts +89 -10
- package/template/src/lib/code/shiki-theme-config.ts +16 -0
- package/template/src/lib/validation.ts +137 -0
- package/template/src/styles/global.css +75 -12
- package/template/src/assets/icons/check.svg +0 -33
- package/template/src/assets/icons/danger.svg +0 -37
- package/template/src/assets/icons/info.svg +0 -36
- package/template/src/assets/icons/lightbulb.svg +0 -74
- package/template/src/assets/icons/sparkle.svg +0 -22
- package/template/src/assets/icons/warning.svg +0 -37
|
@@ -7,6 +7,12 @@ import {
|
|
|
7
7
|
type ThemedToken,
|
|
8
8
|
} from "shiki";
|
|
9
9
|
import { DEFAULT_FILE, getIconForFile } from "vscode-icons-js";
|
|
10
|
+
import { getConfig } from "../validation";
|
|
11
|
+
import {
|
|
12
|
+
DEFAULT_SHIKI_DARK_THEME,
|
|
13
|
+
DEFAULT_SHIKI_LIGHT_THEME,
|
|
14
|
+
type CodeSyntaxThemeByMode,
|
|
15
|
+
} from "./shiki-theme-config";
|
|
10
16
|
|
|
11
17
|
export const DEFAULT_CODE_BLOCK_LANGUAGE = "plaintext";
|
|
12
18
|
|
|
@@ -137,9 +143,8 @@ const CODE_BLOCK_LANGUAGE_ICON_FILE_BY_VALUE: Record<string, string> = {
|
|
|
137
143
|
yaml: "file_type_yaml_official.svg",
|
|
138
144
|
};
|
|
139
145
|
|
|
140
|
-
const
|
|
141
|
-
const
|
|
142
|
-
const SHIKI_THEMES = [SHIKI_LIGHT_THEME, SHIKI_DARK_THEME] as const;
|
|
146
|
+
const SHIKI_LIGHT_LINE_HIGHLIGHT_FALLBACK = "#f6f8fa";
|
|
147
|
+
const SHIKI_DARK_LINE_HIGHLIGHT_FALLBACK = "#2b3036";
|
|
143
148
|
const BUNDLED_LANGUAGE_SET = new Set(Object.keys(bundledLanguages));
|
|
144
149
|
const LANGUAGE_RUNTIME_DEPENDENCIES: Record<string, string[]> = {
|
|
145
150
|
// MDX tokenization relies on TSX grammar injections for JSX-style tags.
|
|
@@ -159,6 +164,7 @@ let iconFileNameSetPromise: Promise<Set<string>> | null = null;
|
|
|
159
164
|
let highlighterPromise:
|
|
160
165
|
| Promise<Awaited<ReturnType<typeof getSingletonHighlighter>>>
|
|
161
166
|
| null = null;
|
|
167
|
+
let highlighterThemeKey = "";
|
|
162
168
|
const loadedLanguageSet = new Set<string>([DEFAULT_CODE_BLOCK_LANGUAGE]);
|
|
163
169
|
const languageLoadPromiseByName = new Map<string, Promise<void>>();
|
|
164
170
|
|
|
@@ -371,10 +377,30 @@ function namespaceSvgIds(svg: string, namespace: string): string {
|
|
|
371
377
|
return namespacedSvg;
|
|
372
378
|
}
|
|
373
379
|
|
|
374
|
-
async function
|
|
375
|
-
|
|
380
|
+
async function getConfiguredCodeSyntaxThemes(): Promise<CodeSyntaxThemeByMode> {
|
|
381
|
+
const config = await getConfig();
|
|
382
|
+
const configuredSyntaxTheme = config.theme?.code?.syntaxTheme;
|
|
383
|
+
|
|
384
|
+
if (typeof configuredSyntaxTheme === "string") {
|
|
385
|
+
return {
|
|
386
|
+
light: configuredSyntaxTheme,
|
|
387
|
+
dark: configuredSyntaxTheme,
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
return {
|
|
392
|
+
light: configuredSyntaxTheme?.light ?? DEFAULT_SHIKI_LIGHT_THEME,
|
|
393
|
+
dark: configuredSyntaxTheme?.dark ?? DEFAULT_SHIKI_DARK_THEME,
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
async function getHighlighter(syntaxThemes: CodeSyntaxThemeByMode) {
|
|
398
|
+
const nextThemeKey = `${syntaxThemes.light}\u0000${syntaxThemes.dark}`;
|
|
399
|
+
|
|
400
|
+
if (!highlighterPromise || highlighterThemeKey !== nextThemeKey) {
|
|
401
|
+
highlighterThemeKey = nextThemeKey;
|
|
376
402
|
highlighterPromise = getSingletonHighlighter({
|
|
377
|
-
themes: [
|
|
403
|
+
themes: Array.from(new Set([syntaxThemes.light, syntaxThemes.dark])),
|
|
378
404
|
langs: [DEFAULT_CODE_BLOCK_LANGUAGE],
|
|
379
405
|
});
|
|
380
406
|
}
|
|
@@ -382,6 +408,40 @@ async function getHighlighter() {
|
|
|
382
408
|
return highlighterPromise;
|
|
383
409
|
}
|
|
384
410
|
|
|
411
|
+
function getThemeColor(
|
|
412
|
+
highlighter: Awaited<ReturnType<typeof getSingletonHighlighter>>,
|
|
413
|
+
themeName: string,
|
|
414
|
+
colorName: string,
|
|
415
|
+
fallback: string,
|
|
416
|
+
): string {
|
|
417
|
+
const colorValue = highlighter.getTheme(themeName)?.colors?.[colorName];
|
|
418
|
+
return typeof colorValue === "string" && colorValue.trim().length > 0
|
|
419
|
+
? colorValue.trim()
|
|
420
|
+
: fallback;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
function getCodeThemeColors(
|
|
424
|
+
highlighter: Awaited<ReturnType<typeof getSingletonHighlighter>>,
|
|
425
|
+
syntaxThemes: CodeSyntaxThemeByMode,
|
|
426
|
+
): CodeThemeColors {
|
|
427
|
+
return {
|
|
428
|
+
lineHighlightBackground: {
|
|
429
|
+
light: getThemeColor(
|
|
430
|
+
highlighter,
|
|
431
|
+
syntaxThemes.light,
|
|
432
|
+
"editor.lineHighlightBackground",
|
|
433
|
+
SHIKI_LIGHT_LINE_HIGHLIGHT_FALLBACK,
|
|
434
|
+
),
|
|
435
|
+
dark: getThemeColor(
|
|
436
|
+
highlighter,
|
|
437
|
+
syntaxThemes.dark,
|
|
438
|
+
"editor.lineHighlightBackground",
|
|
439
|
+
SHIKI_DARK_LINE_HIGHLIGHT_FALLBACK,
|
|
440
|
+
),
|
|
441
|
+
},
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
|
|
385
445
|
function resolveLoadableLanguage(
|
|
386
446
|
highlighter: Awaited<ReturnType<typeof getSingletonHighlighter>>,
|
|
387
447
|
normalizedLanguage: string,
|
|
@@ -496,8 +556,11 @@ export async function getCodeLineTokens({
|
|
|
496
556
|
}): Promise<{
|
|
497
557
|
normalizedLanguage: string;
|
|
498
558
|
lines: CodeLineToken[][];
|
|
559
|
+
themeColors: CodeThemeColors;
|
|
499
560
|
}> {
|
|
500
|
-
const
|
|
561
|
+
const syntaxThemes = await getConfiguredCodeSyntaxThemes();
|
|
562
|
+
const highlighter = await getHighlighter(syntaxThemes);
|
|
563
|
+
const themeColors = getCodeThemeColors(highlighter, syntaxThemes);
|
|
501
564
|
const normalizedLanguage = normalizeCodeLanguageValue(language);
|
|
502
565
|
const loadableLanguage = resolveLoadableLanguage(
|
|
503
566
|
highlighter,
|
|
@@ -525,26 +588,41 @@ export async function getCodeLineTokens({
|
|
|
525
588
|
}
|
|
526
589
|
|
|
527
590
|
try {
|
|
528
|
-
const themedTokenLines = getThemedTokenLines(
|
|
591
|
+
const themedTokenLines = getThemedTokenLines(
|
|
592
|
+
highlighter,
|
|
593
|
+
code,
|
|
594
|
+
targetLanguage,
|
|
595
|
+
syntaxThemes,
|
|
596
|
+
);
|
|
529
597
|
|
|
530
598
|
return {
|
|
531
599
|
normalizedLanguage: targetLanguage,
|
|
532
600
|
lines: mergeTokenLines(themedTokenLines.light, themedTokenLines.dark),
|
|
601
|
+
themeColors,
|
|
533
602
|
};
|
|
534
603
|
} catch {
|
|
535
604
|
const themedTokenLines = getThemedTokenLines(
|
|
536
605
|
highlighter,
|
|
537
606
|
code,
|
|
538
607
|
DEFAULT_CODE_BLOCK_LANGUAGE,
|
|
608
|
+
syntaxThemes,
|
|
539
609
|
);
|
|
540
610
|
|
|
541
611
|
return {
|
|
542
612
|
normalizedLanguage: DEFAULT_CODE_BLOCK_LANGUAGE,
|
|
543
613
|
lines: mergeTokenLines(themedTokenLines.light, themedTokenLines.dark),
|
|
614
|
+
themeColors,
|
|
544
615
|
};
|
|
545
616
|
}
|
|
546
617
|
}
|
|
547
618
|
|
|
619
|
+
export type CodeThemeColors = {
|
|
620
|
+
lineHighlightBackground: {
|
|
621
|
+
light: string;
|
|
622
|
+
dark: string;
|
|
623
|
+
};
|
|
624
|
+
};
|
|
625
|
+
|
|
548
626
|
export type CodeLineToken = {
|
|
549
627
|
content: string;
|
|
550
628
|
color?: string;
|
|
@@ -560,6 +638,7 @@ function getThemedTokenLines(
|
|
|
560
638
|
highlighter: Awaited<ReturnType<typeof getSingletonHighlighter>>,
|
|
561
639
|
code: string,
|
|
562
640
|
lang: string,
|
|
641
|
+
syntaxThemes: CodeSyntaxThemeByMode,
|
|
563
642
|
): {
|
|
564
643
|
light: ThemedToken[][];
|
|
565
644
|
dark: ThemedToken[][];
|
|
@@ -567,11 +646,11 @@ function getThemedTokenLines(
|
|
|
567
646
|
const shikiLanguage = lang as keyof typeof bundledLanguages;
|
|
568
647
|
const lightTokenResult = highlighter.codeToTokens(code, {
|
|
569
648
|
lang: shikiLanguage,
|
|
570
|
-
theme:
|
|
649
|
+
theme: syntaxThemes.light,
|
|
571
650
|
});
|
|
572
651
|
const darkTokenResult = highlighter.codeToTokens(code, {
|
|
573
652
|
lang: shikiLanguage,
|
|
574
|
-
theme:
|
|
653
|
+
theme: syntaxThemes.dark,
|
|
575
654
|
});
|
|
576
655
|
|
|
577
656
|
return {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { bundledThemes } from "shiki";
|
|
2
|
+
|
|
3
|
+
export const DEFAULT_SHIKI_LIGHT_THEME = "github-light";
|
|
4
|
+
export const DEFAULT_SHIKI_DARK_THEME = "github-dark";
|
|
5
|
+
|
|
6
|
+
export type CodeSyntaxThemeByMode = {
|
|
7
|
+
light: string;
|
|
8
|
+
dark: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const SHIKI_BUNDLED_THEME_NAMES = Object.keys(bundledThemes).sort();
|
|
12
|
+
const SHIKI_BUNDLED_THEME_NAME_SET = new Set(SHIKI_BUNDLED_THEME_NAMES);
|
|
13
|
+
|
|
14
|
+
export function isBundledShikiThemeName(value: string): boolean {
|
|
15
|
+
return SHIKI_BUNDLED_THEME_NAME_SET.has(value);
|
|
16
|
+
}
|
|
@@ -6,6 +6,12 @@ import { oas } from "@stoplight/spectral-rulesets";
|
|
|
6
6
|
import { compile } from "@mdx-js/mdx";
|
|
7
7
|
import yaml from "yaml";
|
|
8
8
|
import { docsSchema } from "./frontmatter-schema";
|
|
9
|
+
import {
|
|
10
|
+
DEFAULT_SHIKI_DARK_THEME,
|
|
11
|
+
DEFAULT_SHIKI_LIGHT_THEME,
|
|
12
|
+
SHIKI_BUNDLED_THEME_NAMES,
|
|
13
|
+
isBundledShikiThemeName,
|
|
14
|
+
} from "./code/shiki-theme-config";
|
|
9
15
|
|
|
10
16
|
// --- Configuration Constants ---
|
|
11
17
|
const CWD = process.cwd();
|
|
@@ -226,10 +232,20 @@ export type CardTheme = {
|
|
|
226
232
|
cover?: CardCoverTheme;
|
|
227
233
|
button?: CardButtonTheme;
|
|
228
234
|
};
|
|
235
|
+
export type CodeSyntaxThemeConfig =
|
|
236
|
+
| string
|
|
237
|
+
| {
|
|
238
|
+
light?: string;
|
|
239
|
+
dark?: string;
|
|
240
|
+
};
|
|
241
|
+
export type CodeTheme = {
|
|
242
|
+
syntaxTheme?: CodeSyntaxThemeConfig;
|
|
243
|
+
};
|
|
229
244
|
export type DocsTheme = {
|
|
230
245
|
baseColor?: BaseColorOption | BaseColorByMode;
|
|
231
246
|
themeColor?: string | ThemeColorByMode;
|
|
232
247
|
card?: CardTheme;
|
|
248
|
+
code?: CodeTheme;
|
|
233
249
|
};
|
|
234
250
|
export type AssistantIcon = {
|
|
235
251
|
src?: string;
|
|
@@ -1718,6 +1734,127 @@ function validateTheme(theme: DocsConfig["theme"]): void {
|
|
|
1718
1734
|
}
|
|
1719
1735
|
}
|
|
1720
1736
|
|
|
1737
|
+
const normalizeShikiThemeName = (
|
|
1738
|
+
value: unknown,
|
|
1739
|
+
currentPath: Path,
|
|
1740
|
+
label: string,
|
|
1741
|
+
): string => {
|
|
1742
|
+
checkType(value, "string", currentPath, label);
|
|
1743
|
+
if (typeof value !== "string") {
|
|
1744
|
+
throwConfigError(`${label} must be a string.`, currentPath);
|
|
1745
|
+
}
|
|
1746
|
+
|
|
1747
|
+
const normalizedThemeName = value.trim().toLowerCase();
|
|
1748
|
+
if (normalizedThemeName.length === 0) {
|
|
1749
|
+
throwConfigError(`${label} cannot be empty.`, currentPath);
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
if (!isBundledShikiThemeName(normalizedThemeName)) {
|
|
1753
|
+
throwConfigError(
|
|
1754
|
+
`${label} must be a bundled Shiki theme name. Supported themes include: ${SHIKI_BUNDLED_THEME_NAMES.join(", ")}.`,
|
|
1755
|
+
currentPath,
|
|
1756
|
+
);
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
return normalizedThemeName;
|
|
1760
|
+
};
|
|
1761
|
+
|
|
1762
|
+
if (theme.code !== undefined) {
|
|
1763
|
+
checkType(theme.code, "object", ["theme", "code"], "Theme code");
|
|
1764
|
+
if (
|
|
1765
|
+
typeof theme.code !== "object" ||
|
|
1766
|
+
theme.code === null ||
|
|
1767
|
+
Array.isArray(theme.code)
|
|
1768
|
+
) {
|
|
1769
|
+
throwConfigError("Theme code must be an object.", ["theme", "code"]);
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
const codeTheme = theme.code as CodeTheme & Record<string, unknown>;
|
|
1773
|
+
const allowedCodeKeys = new Set(["syntaxTheme"]);
|
|
1774
|
+
for (const key of Object.keys(codeTheme)) {
|
|
1775
|
+
if (!allowedCodeKeys.has(key)) {
|
|
1776
|
+
throwConfigError(
|
|
1777
|
+
"Theme code configuration only supports 'syntaxTheme'.",
|
|
1778
|
+
["theme", "code", key],
|
|
1779
|
+
);
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
if (codeTheme.syntaxTheme !== undefined) {
|
|
1784
|
+
if (typeof codeTheme.syntaxTheme === "string") {
|
|
1785
|
+
const themeName = normalizeShikiThemeName(
|
|
1786
|
+
codeTheme.syntaxTheme,
|
|
1787
|
+
["theme", "code", "syntaxTheme"],
|
|
1788
|
+
"Theme code syntax theme",
|
|
1789
|
+
);
|
|
1790
|
+
codeTheme.syntaxTheme = {
|
|
1791
|
+
light: themeName,
|
|
1792
|
+
dark: themeName,
|
|
1793
|
+
};
|
|
1794
|
+
} else {
|
|
1795
|
+
checkType(
|
|
1796
|
+
codeTheme.syntaxTheme,
|
|
1797
|
+
"object",
|
|
1798
|
+
["theme", "code", "syntaxTheme"],
|
|
1799
|
+
"Theme code syntax theme",
|
|
1800
|
+
);
|
|
1801
|
+
if (
|
|
1802
|
+
typeof codeTheme.syntaxTheme !== "object" ||
|
|
1803
|
+
codeTheme.syntaxTheme === null ||
|
|
1804
|
+
Array.isArray(codeTheme.syntaxTheme)
|
|
1805
|
+
) {
|
|
1806
|
+
throwConfigError(
|
|
1807
|
+
"Theme code syntax theme must be a string or an object with light/dark values.",
|
|
1808
|
+
["theme", "code", "syntaxTheme"],
|
|
1809
|
+
);
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
const syntaxThemeByMode = codeTheme.syntaxTheme as Record<
|
|
1813
|
+
string,
|
|
1814
|
+
unknown
|
|
1815
|
+
>;
|
|
1816
|
+
const allowedSyntaxThemeKeys = new Set(["light", "dark"]);
|
|
1817
|
+
for (const key of Object.keys(syntaxThemeByMode)) {
|
|
1818
|
+
if (!allowedSyntaxThemeKeys.has(key)) {
|
|
1819
|
+
throwConfigError(
|
|
1820
|
+
"Theme code syntax theme object only supports 'light' and 'dark'.",
|
|
1821
|
+
["theme", "code", "syntaxTheme", key],
|
|
1822
|
+
);
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
const light =
|
|
1827
|
+
syntaxThemeByMode.light !== undefined
|
|
1828
|
+
? normalizeShikiThemeName(
|
|
1829
|
+
syntaxThemeByMode.light,
|
|
1830
|
+
["theme", "code", "syntaxTheme", "light"],
|
|
1831
|
+
"Theme code syntax theme light",
|
|
1832
|
+
)
|
|
1833
|
+
: undefined;
|
|
1834
|
+
const dark =
|
|
1835
|
+
syntaxThemeByMode.dark !== undefined
|
|
1836
|
+
? normalizeShikiThemeName(
|
|
1837
|
+
syntaxThemeByMode.dark,
|
|
1838
|
+
["theme", "code", "syntaxTheme", "dark"],
|
|
1839
|
+
"Theme code syntax theme dark",
|
|
1840
|
+
)
|
|
1841
|
+
: undefined;
|
|
1842
|
+
|
|
1843
|
+
if (!light && !dark) {
|
|
1844
|
+
throwConfigError(
|
|
1845
|
+
"Theme code syntax theme object must include 'light', 'dark', or both.",
|
|
1846
|
+
["theme", "code", "syntaxTheme"],
|
|
1847
|
+
);
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
codeTheme.syntaxTheme = {
|
|
1851
|
+
light: light ?? DEFAULT_SHIKI_LIGHT_THEME,
|
|
1852
|
+
dark: dark ?? DEFAULT_SHIKI_DARK_THEME,
|
|
1853
|
+
};
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1721
1858
|
if (theme.card !== undefined) {
|
|
1722
1859
|
checkType(theme.card, "object", ["theme", "card"], "Theme card");
|
|
1723
1860
|
if (
|
|
@@ -55,9 +55,18 @@
|
|
|
55
55
|
--border-light: var(--color-neutral-100);
|
|
56
56
|
--input: oklch(0.922 0 0);
|
|
57
57
|
--ring: oklch(0.708 0 0);
|
|
58
|
-
--rd-code-surface:
|
|
58
|
+
--rd-code-surface: color-mix(
|
|
59
|
+
in srgb,
|
|
60
|
+
var(--color-neutral-100) 60%,
|
|
61
|
+
var(--background) 40%
|
|
62
|
+
);
|
|
63
|
+
--rd-code-header-surface: var(--color-white);
|
|
59
64
|
--rd-code-tab-edge-bg: var(--rd-code-surface);
|
|
60
|
-
--rd-code-tab-edge-border:
|
|
65
|
+
--rd-code-tab-edge-border: color-mix(
|
|
66
|
+
in oklab,
|
|
67
|
+
var(--color-neutral-900) 4%,
|
|
68
|
+
var(--color-white) 96%
|
|
69
|
+
);
|
|
61
70
|
}
|
|
62
71
|
|
|
63
72
|
/* 3. Dark Mode */
|
|
@@ -85,8 +94,17 @@
|
|
|
85
94
|
var(--color-neutral-800) 55%,
|
|
86
95
|
var(--color-neutral-900) 45%
|
|
87
96
|
);
|
|
97
|
+
--rd-code-header-surface: color-mix(
|
|
98
|
+
in srgb,
|
|
99
|
+
var(--color-neutral-900) 100%,
|
|
100
|
+
var(--rd-code-surface) 0%
|
|
101
|
+
);
|
|
88
102
|
--rd-code-tab-edge-bg: var(--rd-code-surface);
|
|
89
|
-
--rd-code-tab-edge-border:
|
|
103
|
+
--rd-code-tab-edge-border: color-mix(
|
|
104
|
+
in oklab,
|
|
105
|
+
white 4%,
|
|
106
|
+
var(--rd-code-tab-edge-bg) 96%
|
|
107
|
+
);
|
|
90
108
|
}
|
|
91
109
|
|
|
92
110
|
@variant dark (&:where(.dark, .dark *));
|
|
@@ -140,7 +158,7 @@
|
|
|
140
158
|
--tw-prose-invert-links: white;
|
|
141
159
|
--tw-prose-invert-bold: white;
|
|
142
160
|
--tw-prose-invert-counters: var(--color-neutral-400);
|
|
143
|
-
--tw-prose-invert-bullets:
|
|
161
|
+
--tw-prose-invert-bullets: inherit;
|
|
144
162
|
--tw-prose-invert-hr: var(--color-neutral-700);
|
|
145
163
|
--tw-prose-invert-quotes: var(--color-neutral-100);
|
|
146
164
|
--tw-prose-invert-quote-borders: var(--color-neutral-700);
|
|
@@ -197,6 +215,16 @@
|
|
|
197
215
|
}
|
|
198
216
|
|
|
199
217
|
@layer base {
|
|
218
|
+
.prose-rules > :first-child {
|
|
219
|
+
margin-block-start: 0 !important;
|
|
220
|
+
margin-top: 0 !important;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.prose-rules > :last-child {
|
|
224
|
+
margin-block-end: 0 !important;
|
|
225
|
+
margin-bottom: 0 !important;
|
|
226
|
+
}
|
|
227
|
+
|
|
200
228
|
.prose-rules > .rd-prose-block:first-child,
|
|
201
229
|
.prose-rules > .react-renderer:first-child > .rd-prose-block,
|
|
202
230
|
.prose-rules > [data-node-view-content-react]:first-child > :first-child,
|
|
@@ -291,21 +319,25 @@
|
|
|
291
319
|
|
|
292
320
|
/* Markdown table styling */
|
|
293
321
|
.prose-rules :where(table) {
|
|
294
|
-
@apply w-full overflow-hidden rounded-
|
|
322
|
+
@apply w-full overflow-hidden rounded-[12px] border border-neutral-900/7 dark:border-white/4 dark:bg-neutral-800/15;
|
|
295
323
|
border-collapse: separate;
|
|
296
324
|
border-spacing: 0;
|
|
297
325
|
}
|
|
298
326
|
|
|
299
327
|
.prose-rules :where(thead th) {
|
|
300
|
-
@apply bg-neutral-
|
|
328
|
+
@apply bg-neutral-100/60 dark:bg-neutral-800/40;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.prose-rules :where(tbody tr:nth-child(even) td) {
|
|
332
|
+
@apply bg-neutral-50/50 dark:bg-neutral-800/10;
|
|
301
333
|
}
|
|
302
334
|
|
|
303
335
|
.prose-rules :where(th, td) {
|
|
304
|
-
@apply border-b border-neutral-
|
|
336
|
+
@apply border-b border-neutral-900/4 px-4 py-2 align-top dark:border-white/2;
|
|
305
337
|
}
|
|
306
338
|
|
|
307
339
|
.prose-rules :where(th + th, td + td) {
|
|
308
|
-
@apply border-l border-neutral-
|
|
340
|
+
@apply border-l border-neutral-900/4 dark:border-white/2;
|
|
309
341
|
}
|
|
310
342
|
|
|
311
343
|
.prose-rules :where(tbody tr:last-child td) {
|
|
@@ -314,7 +346,7 @@
|
|
|
314
346
|
|
|
315
347
|
/* Code single-line styling */
|
|
316
348
|
:is(.prose, .prose-rules) :not(pre) > code {
|
|
317
|
-
@apply px-1
|
|
349
|
+
@apply mx-px px-[5px] pr-1 bg-neutral-100/80 text-neutral-700/90 rounded-sm leading-none font-mono font-normal border border-neutral-900/4 after:hidden before:hidden dark:bg-neutral-800/90 dark:text-neutral-200/90 dark:border-white/3;
|
|
318
350
|
}
|
|
319
351
|
|
|
320
352
|
[data-rd-code-theme] [data-rd-token] {
|
|
@@ -322,6 +354,26 @@
|
|
|
322
354
|
background-color: var(--rd-token-bg, transparent);
|
|
323
355
|
}
|
|
324
356
|
|
|
357
|
+
[data-rd-code-block-root] {
|
|
358
|
+
--rd-code-line-highlight-bg: color-mix(
|
|
359
|
+
in srgb,
|
|
360
|
+
var(--rd-code-line-highlight-theme-bg-light) 90%,
|
|
361
|
+
var(--color-neutral-400) 10%
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.dark [data-rd-code-block-root] {
|
|
366
|
+
--rd-code-line-highlight-bg: color-mix(
|
|
367
|
+
in srgb,
|
|
368
|
+
var(--rd-code-line-highlight-theme-bg-dark) 80%,
|
|
369
|
+
var(--color-neutral-700) 20%
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
[data-rd-code-line-highlighted="true"] {
|
|
374
|
+
background-color: var(--rd-code-line-highlight-bg);
|
|
375
|
+
}
|
|
376
|
+
|
|
325
377
|
.dark [data-rd-code-theme] [data-rd-token] {
|
|
326
378
|
color: var(--rd-token-color-dark, var(--rd-token-color, currentColor));
|
|
327
379
|
background-color: var(--rd-token-bg-dark, var(--rd-token-bg, transparent));
|
|
@@ -336,9 +388,20 @@
|
|
|
336
388
|
margin-bottom: 0;
|
|
337
389
|
}
|
|
338
390
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
391
|
+
:is(.prose, .prose-rules) :where(ul > li)::marker {
|
|
392
|
+
color: color-mix(in oklab, currentColor 40%, transparent);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
:is(.prose, .prose-rules) :where(ol > li)::marker {
|
|
396
|
+
color: color-mix(in oklab, currentColor 70%, transparent);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.dark :is(.prose, .prose-rules) :where(ul > li)::marker {
|
|
400
|
+
color: color-mix(in oklab, currentColor 30%, transparent);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.dark :is(.prose, .prose-rules) :where(ol > li)::marker {
|
|
404
|
+
color: color-mix(in oklab, currentColor 60%, transparent);
|
|
342
405
|
}
|
|
343
406
|
|
|
344
407
|
/* Animations */
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<svg
|
|
2
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
3
|
-
x="0px"
|
|
4
|
-
y="0px"
|
|
5
|
-
width="18px"
|
|
6
|
-
height="18px"
|
|
7
|
-
viewBox="0 0 18 18"
|
|
8
|
-
>
|
|
9
|
-
<path
|
|
10
|
-
d="M9.305 1.848L14.555 3.528C14.969 3.661 15.25 4.046 15.25 4.48V11C15.25 14.03 10.566 15.748 9.308 16.155C9.105 16.221 8.895 16.221 8.692 16.155C7.434 15.748 2.75 14.03 2.75 11V4.48C2.75 4.045 3.031 3.66 3.445 3.528L8.695 1.848C8.893 1.785 9.106 1.785 9.305 1.848Z"
|
|
11
|
-
fill="#16a34a"
|
|
12
|
-
fill-opacity="0.7"
|
|
13
|
-
data-color="color-2"
|
|
14
|
-
data-stroke="none"
|
|
15
|
-
></path>
|
|
16
|
-
<path
|
|
17
|
-
d="M9.305 1.848L14.555 3.528C14.969 3.661 15.25 4.046 15.25 4.48V11C15.25 14.03 10.566 15.748 9.308 16.155C9.105 16.221 8.895 16.221 8.692 16.155C7.434 15.748 2.75 14.03 2.75 11V4.48C2.75 4.045 3.031 3.66 3.445 3.528L8.695 1.848C8.893 1.785 9.106 1.785 9.305 1.848Z"
|
|
18
|
-
stroke="#16a34a"
|
|
19
|
-
stroke-width="1.5"
|
|
20
|
-
stroke-linecap="round"
|
|
21
|
-
stroke-linejoin="round"
|
|
22
|
-
fill="none"
|
|
23
|
-
></path>
|
|
24
|
-
<path
|
|
25
|
-
d="M6.49701 9.75L8.10601 11.25L11.503 6.75"
|
|
26
|
-
stroke="white"
|
|
27
|
-
opacity="0.9"
|
|
28
|
-
stroke-width="1.5"
|
|
29
|
-
stroke-linecap="round"
|
|
30
|
-
stroke-linejoin="round"
|
|
31
|
-
fill="none"
|
|
32
|
-
></path>
|
|
33
|
-
</svg>
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<svg
|
|
2
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
3
|
-
width="18"
|
|
4
|
-
height="18"
|
|
5
|
-
viewBox="0 0 18 18"
|
|
6
|
-
>
|
|
7
|
-
<path
|
|
8
|
-
opacity="0.8"
|
|
9
|
-
d="M5.63604 1.5H12.364L16.5 5.63604V12.364L12.364 16.5H5.63604L1.5 12.364V5.63604L5.63604 1.5Z"
|
|
10
|
-
fill="#dc2626"
|
|
11
|
-
></path>
|
|
12
|
-
<path
|
|
13
|
-
d="M5.63604 1.5H12.364L16.5 5.63604V12.364L12.364 16.5H5.63604L1.5 12.364V5.63604L5.63604 1.5Z"
|
|
14
|
-
stroke="#dc2626"
|
|
15
|
-
stroke-width="1.5"
|
|
16
|
-
stroke-linecap="round"
|
|
17
|
-
stroke-linejoin="round"
|
|
18
|
-
fill="none"
|
|
19
|
-
></path>
|
|
20
|
-
<g transform="translate(0 -0.5)">
|
|
21
|
-
<path
|
|
22
|
-
d="M9 6.75V9.75"
|
|
23
|
-
stroke="white"
|
|
24
|
-
opacity="0.9"
|
|
25
|
-
stroke-width="1.8"
|
|
26
|
-
stroke-linecap="round"
|
|
27
|
-
stroke-linejoin="round"
|
|
28
|
-
fill="none"
|
|
29
|
-
></path>
|
|
30
|
-
<path
|
|
31
|
-
d="M9 13.5C8.448 13.5 8 13.05 8 12.5C8 11.95 8.448 11.5 9 11.5C9.552 11.5 10 11.9501 10 12.5C10 13.0499 9.552 13.5 9 13.5Z"
|
|
32
|
-
fill="white"
|
|
33
|
-
opacity="0.9"
|
|
34
|
-
data-stroke="none"
|
|
35
|
-
></path>
|
|
36
|
-
</g>
|
|
37
|
-
</svg>
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
<svg
|
|
2
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
3
|
-
width="18"
|
|
4
|
-
height="18"
|
|
5
|
-
viewBox="0 0 18 18"
|
|
6
|
-
>
|
|
7
|
-
<circle opacity="0.6" cx="9" cy="9" r="7.5" fill="#0284c7"></circle>
|
|
8
|
-
<circle
|
|
9
|
-
cx="9"
|
|
10
|
-
cy="9"
|
|
11
|
-
r="7.5"
|
|
12
|
-
stroke="#0284c7"
|
|
13
|
-
stroke-width="1.5"
|
|
14
|
-
stroke-linecap="round"
|
|
15
|
-
stroke-linejoin="round"
|
|
16
|
-
fill="none"
|
|
17
|
-
></circle>
|
|
18
|
-
<path
|
|
19
|
-
d="M9 12V9"
|
|
20
|
-
stroke="white"
|
|
21
|
-
opacity="0.9"
|
|
22
|
-
stroke-width="1.9"
|
|
23
|
-
stroke-linecap="round"
|
|
24
|
-
stroke-linejoin="round"
|
|
25
|
-
fill="none"
|
|
26
|
-
></path>
|
|
27
|
-
<path
|
|
28
|
-
d="M9 6H9.0075"
|
|
29
|
-
stroke="white"
|
|
30
|
-
opacity="0.9"
|
|
31
|
-
stroke-width="1.9"
|
|
32
|
-
stroke-linecap="round"
|
|
33
|
-
stroke-linejoin="round"
|
|
34
|
-
fill="none"
|
|
35
|
-
></path>
|
|
36
|
-
</svg>
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
<svg
|
|
2
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
3
|
-
x="0px"
|
|
4
|
-
y="0px"
|
|
5
|
-
width="18px"
|
|
6
|
-
height="18px"
|
|
7
|
-
viewBox="0 0 18 18"
|
|
8
|
-
>
|
|
9
|
-
<path
|
|
10
|
-
fill-rule="evenodd"
|
|
11
|
-
clip-rule="evenodd"
|
|
12
|
-
d="M7.97299 4.358C11.045 3.714 13.75 6.041 13.75 9C13.75 10.867 12.6695 12.475 11.1028 13.25H6.89719C5.11109 12.367 3.95699 10.399 4.31499 8.202C4.62299 6.315 6.10099 4.75 7.97299 4.358Z"
|
|
13
|
-
fill="#eab308"
|
|
14
|
-
opacity="0.7"
|
|
15
|
-
data-color="color-2"
|
|
16
|
-
data-stroke="none"
|
|
17
|
-
></path>
|
|
18
|
-
<path
|
|
19
|
-
d="M9 0.75V1.75"
|
|
20
|
-
stroke="#eab308"
|
|
21
|
-
stroke-width="1.5"
|
|
22
|
-
stroke-linecap="round"
|
|
23
|
-
stroke-linejoin="round"
|
|
24
|
-
fill="none"
|
|
25
|
-
></path>
|
|
26
|
-
<path
|
|
27
|
-
d="M14.834 3.16599L14.127 3.87299"
|
|
28
|
-
stroke="#eab308"
|
|
29
|
-
stroke-width="1.5"
|
|
30
|
-
stroke-linecap="round"
|
|
31
|
-
stroke-linejoin="round"
|
|
32
|
-
fill="none"
|
|
33
|
-
></path>
|
|
34
|
-
<path
|
|
35
|
-
d="M17.25 9H16.25"
|
|
36
|
-
stroke="#eab308"
|
|
37
|
-
stroke-width="1.5"
|
|
38
|
-
stroke-linecap="round"
|
|
39
|
-
stroke-linejoin="round"
|
|
40
|
-
fill="none"
|
|
41
|
-
></path>
|
|
42
|
-
<path
|
|
43
|
-
d="M3.16602 3.16599L3.87302 3.87299"
|
|
44
|
-
stroke="#eab308"
|
|
45
|
-
stroke-width="1.5"
|
|
46
|
-
stroke-linecap="round"
|
|
47
|
-
stroke-linejoin="round"
|
|
48
|
-
fill="none"
|
|
49
|
-
></path>
|
|
50
|
-
<path
|
|
51
|
-
d="M0.75 9H1.75"
|
|
52
|
-
stroke="#eab308"
|
|
53
|
-
stroke-width="1.5"
|
|
54
|
-
stroke-linecap="round"
|
|
55
|
-
stroke-linejoin="round"
|
|
56
|
-
fill="none"
|
|
57
|
-
></path>
|
|
58
|
-
<path
|
|
59
|
-
d="M13.75 8.99999C13.75 6.04069 11.0445 3.71348 7.97199 4.35818C6.09979 4.75108 4.62099 6.31669 4.31449 8.20489C3.93509 10.5427 5.26679 12.6193 7.24999 13.407V15.25C7.24999 16.0784 7.92159 16.75 8.74999 16.75H9.24999C10.0784 16.75 10.75 16.0784 10.75 15.25V13.407C12.505 12.71 13.75 11.004 13.75 8.99999Z"
|
|
60
|
-
stroke="#eab308"
|
|
61
|
-
stroke-width="1.5"
|
|
62
|
-
stroke-linecap="round"
|
|
63
|
-
stroke-linejoin="round"
|
|
64
|
-
fill="none"
|
|
65
|
-
></path>
|
|
66
|
-
<path
|
|
67
|
-
d="M6.89697 13.25H11.103"
|
|
68
|
-
stroke="#eab308"
|
|
69
|
-
stroke-width="1.5"
|
|
70
|
-
stroke-linecap="round"
|
|
71
|
-
stroke-linejoin="round"
|
|
72
|
-
fill="none"
|
|
73
|
-
></path>
|
|
74
|
-
</svg>
|