@tenphi/renderer 0.21.0 → 0.21.2
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/dist/component-styles-DstqPFf3.js +21 -0
- package/dist/component-styles-DstqPFf3.js.map +1 -0
- package/dist/components/Banner.styles.js +19 -0
- package/dist/components/Button.styles.d.ts +9 -0
- package/dist/components/Button.styles.js +14 -0
- package/dist/components/Callout.astro +1 -1
- package/dist/components/Callout.styles.js +54 -0
- package/dist/components/Card.astro +4 -4
- package/dist/components/Card.styles.js +64 -0
- package/dist/components/CodeGroup.astro +9 -4
- package/dist/components/CodeGroup.styles.js +27 -0
- package/dist/components/Document.styles.js +230 -0
- package/dist/components/EditLink.astro +1 -1
- package/dist/components/Footer.styles.js +45 -0
- package/dist/components/Header.styles.js +96 -0
- package/dist/components/HeaderFrame.styles.js +20 -0
- package/dist/components/HeaderLinks.astro +2 -2
- package/dist/components/HeaderLinks.styles.js +149 -0
- package/dist/components/Hero.styles.js +129 -0
- package/dist/components/LanguageSelect.styles.js +169 -0
- package/dist/components/LastUpdated.astro +1 -1
- package/dist/components/Logo.astro +4 -8
- package/dist/components/Logo.styles.js +27 -0
- package/dist/components/MainContent.styles.js +38 -0
- package/dist/components/MainPane.styles.js +19 -0
- package/dist/components/MarkdownAlert.styles.js +61 -0
- package/dist/components/MarkdownCodeBlock.styles.js +131 -0
- package/dist/components/MarkdownContent.styles.js +231 -0
- package/dist/components/MarkdownHeading.styles.js +117 -0
- package/dist/components/MarkdownInlineCode.styles.js +19 -0
- package/dist/components/MarkdownTable.styles.js +58 -0
- package/dist/components/Mermaid.styles.js +50 -0
- package/dist/components/MermaidSource.styles.js +21 -0
- package/dist/components/MobileMenuFooter.styles.js +27 -0
- package/dist/components/MobileMenuToggle.styles.js +49 -0
- package/dist/components/MobileNavigationTabs.astro +1 -2
- package/dist/components/MobileNavigationTabs.styles.js +88 -0
- package/dist/components/MobileTableOfContents.styles.js +59 -0
- package/dist/components/PackageVersion.astro +1 -2
- package/dist/components/PackageVersion.styles.js +23 -0
- package/dist/components/PageActions.astro +2 -2
- package/dist/components/PageActions.styles.js +51 -0
- package/dist/components/PageFrame.styles.js +34 -0
- package/dist/components/Pagination.astro +3 -2
- package/dist/components/Pagination.styles.js +126 -0
- package/dist/components/Preview.astro +2 -6
- package/dist/components/Preview.styles.js +78 -0
- package/dist/components/Search.styles.js +132 -0
- package/dist/components/SearchButton.styles.js +68 -0
- package/dist/components/SearchResults.styles.js +200 -0
- package/dist/components/SelectPopover.astro +1 -0
- package/dist/components/Sidebar.styles.js +309 -0
- package/dist/components/SiteLogo.astro +1 -2
- package/dist/components/SiteLogo.styles.js +32 -0
- package/dist/components/SiteTitle.astro +1 -1
- package/dist/components/SkipLink.styles.js +24 -0
- package/dist/components/SocialIcons.styles.js +36 -0
- package/dist/components/Steps.astro +2 -2
- package/dist/components/Steps.styles.js +25 -0
- package/dist/components/SyntaxHighlight.styles.js +87 -0
- package/dist/components/Tab.astro +1 -1
- package/dist/components/Tab.styles.js +30 -0
- package/dist/components/TableOfContents.styles.js +62 -0
- package/dist/components/TableOfContentsLayout.styles.js +38 -0
- package/dist/components/Tabs.astro +1 -1
- package/dist/components/Tabs.styles.js +60 -0
- package/dist/components/ThemeSelect.styles.js +177 -0
- package/dist/components/TopNavigation.styles.js +52 -0
- package/dist/components/VersionSwitcher.astro +2 -2
- package/dist/components/VersionSwitcher.styles.js +45 -0
- package/dist/components/component-styles.test.ts +0 -10
- package/dist/components/component-styles.ts +0 -7
- package/dist/components/inherit-component-parts.d.ts +1 -0
- package/dist/components/inherit-component-parts.js +7 -0
- package/dist/components/select-popover-styles.js +34 -16
- package/dist/components/tasty-states.js +13 -1
- package/dist/define-component-BP4YwMak.js +28 -0
- package/dist/define-component-BP4YwMak.js.map +1 -0
- package/dist/define-component.d.ts +17 -0
- package/dist/define-component.d.ts.map +1 -0
- package/dist/define-component.js +2 -0
- package/dist/eslint-plugin.d.ts +5 -0
- package/dist/eslint-plugin.d.ts.map +1 -1
- package/dist/eslint-plugin.js +26 -3
- package/dist/eslint-plugin.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/overrides/Footer.astro +6 -5
- package/dist/overrides/Header.astro +13 -17
- package/dist/overrides/Hero.astro +3 -2
- package/dist/overrides/LanguageSelect.astro +3 -3
- package/dist/overrides/MarkdownContent.astro +7 -1
- package/dist/overrides/MobileMenuFooter.astro +2 -5
- package/dist/overrides/MobileMenuToggle.astro +4 -3
- package/dist/overrides/MobileTableOfContents.astro +2 -2
- package/dist/overrides/PageFrame.astro +9 -11
- package/dist/overrides/Search.astro +13 -9
- package/dist/overrides/Sidebar.astro +4 -1
- package/dist/overrides/SocialIcons.astro +2 -2
- package/dist/overrides/ThemeSelect.astro +9 -3
- package/dist/routes/Page.astro +22 -11
- package/dist/styling.d.ts +5 -10
- package/dist/styling.d.ts.map +1 -1
- package/dist/styling.js +18 -11
- package/dist/styling.js.map +1 -1
- package/dist/tasty-states-_JhxFdK1.js +47 -0
- package/dist/tasty-states-_JhxFdK1.js.map +1 -0
- package/dist/theme/defaults.d.ts.map +1 -1
- package/dist/theme/defaults.js +22 -1
- package/dist/theme/defaults.js.map +1 -1
- package/dist/theme/tasty-config.d.ts +23 -1
- package/dist/theme/tasty-config.d.ts.map +1 -1
- package/dist/theme/tasty-config.js +23 -1
- package/dist/theme/tasty-config.js.map +1 -1
- package/package.json +4 -4
- package/dist/components/GlobalStyles.js +0 -1792
- package/dist/components/LayoutComponents.js +0 -872
- package/dist/components/TastyComponents.js +0 -269
- package/dist/components/customize-component.js +0 -8
- package/dist/tasty-states-rTLFy26t.js +0 -57
- package/dist/tasty-states-rTLFy26t.js.map +0 -1
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { useGlobalStyles } from "@tenphi/tasty";
|
|
2
|
+
import checkIcon from "../icons/check.svg?raw";
|
|
3
|
+
import copyIcon from "../icons/copy.svg?raw";
|
|
4
|
+
import { resolveComponentStyles } from "./component-styles.js";
|
|
5
|
+
import { svgIconUrl } from "./svg-icon.js";
|
|
6
|
+
import { configureCookbookStates } from "./tasty-states.js";
|
|
7
|
+
|
|
8
|
+
configureCookbookStates();
|
|
9
|
+
|
|
10
|
+
export function MarkdownCodeBlockStyles() {
|
|
11
|
+
useGlobalStyles(
|
|
12
|
+
':is(.cookbook-markdown-content .td-code-block, .td-code-block[data-element="MarkdownCodeBlock"])',
|
|
13
|
+
resolveComponentStyles("MarkdownCodeBlock", {
|
|
14
|
+
"$copy-button-size": "2rem",
|
|
15
|
+
display: "block",
|
|
16
|
+
position: "relative",
|
|
17
|
+
inlineSize: "min 0",
|
|
18
|
+
Pre: {
|
|
19
|
+
$: "> pre",
|
|
20
|
+
"$margin-block-start": "0",
|
|
21
|
+
"$margin-block-end": "0",
|
|
22
|
+
blockMargin: "$margin-block-start $margin-block-end",
|
|
23
|
+
inlineMargin: "0",
|
|
24
|
+
padding: "0 3.75rem 0 1rem",
|
|
25
|
+
// Balance a single code line around the copy control, including the border.
|
|
26
|
+
blockPadding:
|
|
27
|
+
"max(0px, ($copy-button-size - 1lh) / 2 + $gap - $border-width)",
|
|
28
|
+
overflowX: "auto",
|
|
29
|
+
color: "#syntax-text",
|
|
30
|
+
border: true,
|
|
31
|
+
fill: "#syntax-bg",
|
|
32
|
+
radius: "$card-radius",
|
|
33
|
+
tabSize: "2",
|
|
34
|
+
},
|
|
35
|
+
CopyButton: {
|
|
36
|
+
$: "> CopyButton",
|
|
37
|
+
position: "absolute",
|
|
38
|
+
zIndex: "1",
|
|
39
|
+
blockInset: "$gap start",
|
|
40
|
+
inlineInset: "$gap end",
|
|
41
|
+
"$margin-block-start": "0",
|
|
42
|
+
"$margin-block-end": "0",
|
|
43
|
+
blockMargin: "$margin-block-start $margin-block-end",
|
|
44
|
+
inlineMargin: "0",
|
|
45
|
+
display: "grid",
|
|
46
|
+
placeItems: "center",
|
|
47
|
+
inlineSize: "$copy-button-size $copy-button-size initial",
|
|
48
|
+
blockSize: "$copy-button-size $copy-button-size initial",
|
|
49
|
+
padding: "0",
|
|
50
|
+
color: "#text-soft",
|
|
51
|
+
border: true,
|
|
52
|
+
fill: "#surface-2",
|
|
53
|
+
radius: "$radius",
|
|
54
|
+
preset: "small / strong",
|
|
55
|
+
cursor: "pointer",
|
|
56
|
+
transition: "color $transition, fill $transition",
|
|
57
|
+
},
|
|
58
|
+
HoverCopyButton: {
|
|
59
|
+
$: '> [data-element="CopyButton"]',
|
|
60
|
+
color: { "": null, "@own(:hover)": "#text" },
|
|
61
|
+
fill: {
|
|
62
|
+
"": null,
|
|
63
|
+
"@own(:hover)": "#surface-2-hover",
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
CopiedButton: {
|
|
67
|
+
$: '> [data-element="CopyButton"]',
|
|
68
|
+
color: {
|
|
69
|
+
"": null,
|
|
70
|
+
'@own([data-copy-state="copied"])': "#green-text",
|
|
71
|
+
},
|
|
72
|
+
// Recolor only; CopyButton owns the border width and style, including theme overrides.
|
|
73
|
+
// eslint-disable-next-line tasty/prefer-shorthand-property
|
|
74
|
+
borderColor: {
|
|
75
|
+
"": null,
|
|
76
|
+
'@own([data-copy-state="copied"])': "#green",
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
CopyIcon: {
|
|
80
|
+
$: "> CopyButton > CopyIcon",
|
|
81
|
+
display: "block",
|
|
82
|
+
inlineSize: "1rem",
|
|
83
|
+
blockSize: "1rem",
|
|
84
|
+
fill: "#current",
|
|
85
|
+
// The imported SVG is encoded at build time and never evaluated in the browser.
|
|
86
|
+
// eslint-disable-next-line tasty/no-runtime-styles-mutation
|
|
87
|
+
mask: `url("${svgIconUrl(copyIcon)}") center / contain no-repeat`,
|
|
88
|
+
},
|
|
89
|
+
CopiedIcon: {
|
|
90
|
+
$: '> CopyButton > [data-element="CopyIcon"]',
|
|
91
|
+
mask: {
|
|
92
|
+
"": null,
|
|
93
|
+
// SVG encoding runs only during the server build.
|
|
94
|
+
// eslint-disable-next-line tasty/no-runtime-styles-mutation
|
|
95
|
+
'@own(:is([data-element="CopyButton"][data-copy-state="copied"] > [data-element="CopyIcon"]))': `url("${svgIconUrl(checkIcon)}") center / contain no-repeat`,
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
Code: { $: "pre code", padding: "0", color: "inherit", fill: "#clear" },
|
|
99
|
+
Diff: { $: "pre.td-diff", inlinePadding: "0" },
|
|
100
|
+
DiffCode: {
|
|
101
|
+
$: "pre.td-diff code",
|
|
102
|
+
display: "block",
|
|
103
|
+
inlineSize: "100% max-content initial",
|
|
104
|
+
// Zero line height removes gaps between block diff lines; the tight modifier would not.
|
|
105
|
+
// eslint-disable-next-line tasty/prefer-shorthand-property
|
|
106
|
+
lineHeight: "0",
|
|
107
|
+
},
|
|
108
|
+
DiffLine: {
|
|
109
|
+
$: "pre.td-diff > code > :is(.line)",
|
|
110
|
+
display: "block",
|
|
111
|
+
inlinePadding: "1rem",
|
|
112
|
+
preset: "code",
|
|
113
|
+
},
|
|
114
|
+
EmptyDiffLine: {
|
|
115
|
+
// Tasty 3.9.3 appends @own states after pseudo-elements, producing invalid CSS.
|
|
116
|
+
// eslint-disable-next-line tasty/no-state-in-selector
|
|
117
|
+
$: "pre.td-diff > code > .line:empty::before",
|
|
118
|
+
content: '"\\200b"',
|
|
119
|
+
},
|
|
120
|
+
InsertedLine: {
|
|
121
|
+
$: "pre.td-diff > code > .td-diff-line--inserted",
|
|
122
|
+
fill: "#green-surface",
|
|
123
|
+
},
|
|
124
|
+
DeletedLine: {
|
|
125
|
+
$: "pre.td-diff > code > .td-diff-line--deleted",
|
|
126
|
+
fill: "#red-surface",
|
|
127
|
+
},
|
|
128
|
+
}),
|
|
129
|
+
);
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { useGlobalStyles } from "@tenphi/tasty";
|
|
2
|
+
import { resolveComponentStyles } from "./component-styles.js";
|
|
3
|
+
import { MarkdownInlineCodeStyles } from "./MarkdownInlineCode.styles.js";
|
|
4
|
+
import { SyntaxHighlightStyles } from "./SyntaxHighlight.styles.js";
|
|
5
|
+
import { MarkdownCodeBlockStyles } from "./MarkdownCodeBlock.styles.js";
|
|
6
|
+
import { MermaidSourceStyles } from "./MermaidSource.styles.js";
|
|
7
|
+
import { MermaidStyles } from "./Mermaid.styles.js";
|
|
8
|
+
import { MarkdownHeadingStyles } from "./MarkdownHeading.styles.js";
|
|
9
|
+
import { MarkdownAlertStyles } from "./MarkdownAlert.styles.js";
|
|
10
|
+
import { MarkdownTableStyles } from "./MarkdownTable.styles.js";
|
|
11
|
+
import chevronRightIcon from "../icons/chevron-right.svg?raw";
|
|
12
|
+
import { svgIconUrl } from "./svg-icon.js";
|
|
13
|
+
import { configureCookbookStates } from "./tasty-states.js";
|
|
14
|
+
|
|
15
|
+
configureCookbookStates();
|
|
16
|
+
|
|
17
|
+
export default function MarkdownStyles() {
|
|
18
|
+
// Match component-root specificity so prose owns spacing inside Markdown.
|
|
19
|
+
useGlobalStyles(
|
|
20
|
+
".cookbook-markdown-content.cookbook-markdown-content",
|
|
21
|
+
resolveComponentStyles("Markdown", {
|
|
22
|
+
preset: "prose",
|
|
23
|
+
Block: {
|
|
24
|
+
$: ":where(p), :where(ul), :where(ol), :where(dl), :where(blockquote), :where(pre), :where(table), :where(hr), :where(details)",
|
|
25
|
+
"$margin-block-start": { "": null, "@own(!:is(.not-content *))": "0" },
|
|
26
|
+
"$margin-block-end": { "": null, "@own(!:is(.not-content *))": "0" },
|
|
27
|
+
blockMargin: {
|
|
28
|
+
"": null,
|
|
29
|
+
"@own(!:is(.not-content *))": "$margin-block-start $margin-block-end",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
// Linked Cards are block content even though their root is an anchor.
|
|
33
|
+
BlockSpacing: {
|
|
34
|
+
// Prose spacing must win over each block component's root margin.
|
|
35
|
+
$: "&.cookbook-markdown-content * + *",
|
|
36
|
+
blockMargin: {
|
|
37
|
+
"": null,
|
|
38
|
+
"(@own(:is(:not(a,strong,em,del,span,input,code,br) + *)) | @own(:is(a.td-card + *))) & (@own(!:is(a,strong,em,del,span,input,code,br,li,dt,dd,.not-content *)) | @own(:is(a.td-card)))":
|
|
39
|
+
"$margin-block-start $margin-block-end",
|
|
40
|
+
},
|
|
41
|
+
"$margin-block-start": {
|
|
42
|
+
"": null,
|
|
43
|
+
"(@own(:is(:not(a,strong,em,del,span,input,code,br) + *)) | @own(:is(a.td-card + *))) & (@own(!:is(a,strong,em,del,span,input,code,br,li,dt,dd,.not-content *)) | @own(:is(a.td-card)))":
|
|
44
|
+
"($gap * 3)",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
HeadingSpacing: {
|
|
48
|
+
$: "* + h1, * + h2, * + h3, * + h4, * + h5, * + h6, * + .cookbook-heading-wrapper",
|
|
49
|
+
"$margin-block-start": {
|
|
50
|
+
"": null,
|
|
51
|
+
"@own(:is(:not(h1,h2,h3,h4,h5,h6,.cookbook-heading-wrapper) + *)) & @own(!:is(.not-content *))":
|
|
52
|
+
"1.5em",
|
|
53
|
+
},
|
|
54
|
+
"$margin-block-end": {
|
|
55
|
+
"": null,
|
|
56
|
+
"@own(:is(:not(h1,h2,h3,h4,h5,h6,.cookbook-heading-wrapper) + *)) & @own(!:is(.not-content *))":
|
|
57
|
+
"0",
|
|
58
|
+
},
|
|
59
|
+
blockMargin: {
|
|
60
|
+
"": null,
|
|
61
|
+
"@own(:is(:not(h1,h2,h3,h4,h5,h6,.cookbook-heading-wrapper) + *)) & @own(!:is(.not-content *))":
|
|
62
|
+
"$margin-block-start $margin-block-end",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
List: {
|
|
66
|
+
$: ":where(ul), :where(ol)",
|
|
67
|
+
inlinePadding: {
|
|
68
|
+
"": null,
|
|
69
|
+
"@own(!:is(.not-content *))": "1.5rem start",
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
CompactItem: {
|
|
73
|
+
$: ":where(li + li), :where(dt + dt), :where(dt + dd), :where(dd + dd)",
|
|
74
|
+
"$margin-block-start": {
|
|
75
|
+
"": null,
|
|
76
|
+
"@own(!:is(.not-content *))": "($gap * 0.5)",
|
|
77
|
+
},
|
|
78
|
+
"$margin-block-end": { "": null, "@own(!:is(.not-content *))": "0" },
|
|
79
|
+
blockMargin: {
|
|
80
|
+
"": null,
|
|
81
|
+
"@own(!:is(.not-content *))": "$margin-block-start $margin-block-end",
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
ListItem: {
|
|
85
|
+
$: "li",
|
|
86
|
+
overflowWrap: { "": null, "@own(!:is(.not-content *))": "anywhere" },
|
|
87
|
+
},
|
|
88
|
+
DefinitionTerm: {
|
|
89
|
+
$: "dt",
|
|
90
|
+
preset: { "": null, "@own(!:is(.not-content *))": "strong" },
|
|
91
|
+
},
|
|
92
|
+
DefinitionDescription: {
|
|
93
|
+
$: "dd",
|
|
94
|
+
inlinePadding: {
|
|
95
|
+
"": null,
|
|
96
|
+
"@own(!:is(.not-content *))": "($gap * 2) start",
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
Link: {
|
|
100
|
+
$: "a",
|
|
101
|
+
color: { "": null, "@own(!:is(.not-content *))": "#accent-text" },
|
|
102
|
+
textUnderlineOffset: {
|
|
103
|
+
"": null,
|
|
104
|
+
"@own(!:is(.not-content *))": "0.15em",
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
HoverLink: {
|
|
108
|
+
$: "a",
|
|
109
|
+
color: {
|
|
110
|
+
"": null,
|
|
111
|
+
"@own(:hover) & @own(!:is(.not-content *))": "#text",
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
Quote: {
|
|
115
|
+
$: "blockquote",
|
|
116
|
+
inlinePadding: { "": null, "@own(!:is(.not-content *))": "2x start" },
|
|
117
|
+
color: { "": null, "@own(!:is(.not-content *))": "#text-soft" },
|
|
118
|
+
inlineBorder: {
|
|
119
|
+
"": null,
|
|
120
|
+
"@own(!:is(.not-content *))": "1bw solid #border start",
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
Rule: {
|
|
124
|
+
$: "hr",
|
|
125
|
+
border: { "": null, "@own(!:is(.not-content *))": "0" },
|
|
126
|
+
blockBorder: {
|
|
127
|
+
"": null,
|
|
128
|
+
"@own(!:is(.not-content *))": "$border-width solid #border end",
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
Details: {
|
|
132
|
+
$: "details",
|
|
133
|
+
inlinePadding: {
|
|
134
|
+
"": null,
|
|
135
|
+
"@own(!:is(.not-content *))": "($gap * 2) start",
|
|
136
|
+
},
|
|
137
|
+
inlineBorder: {
|
|
138
|
+
"": null,
|
|
139
|
+
"@own(!:is(.not-content *))": "2px solid #border start",
|
|
140
|
+
},
|
|
141
|
+
// Change only color; border widths and styles belong to other rules or theme overrides.
|
|
142
|
+
// eslint-disable-next-line tasty/prefer-shorthand-property
|
|
143
|
+
borderColor: { "": null, "@own(!:is(.not-content *))": "#border" },
|
|
144
|
+
},
|
|
145
|
+
HoverDetails: {
|
|
146
|
+
$: "details",
|
|
147
|
+
// Change only color; border widths and styles belong to other rules or theme overrides.
|
|
148
|
+
// eslint-disable-next-line tasty/prefer-shorthand-property
|
|
149
|
+
borderColor: {
|
|
150
|
+
"": null,
|
|
151
|
+
"(@own(![open] & :hover) | @own(:has(> summary:hover))) & @own(!:is(.not-content *))":
|
|
152
|
+
"#accent-text",
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
Summary: {
|
|
156
|
+
$: "summary",
|
|
157
|
+
display: { "": "", "@own(!:is(.not-content *))": "block" },
|
|
158
|
+
inlineMargin: {
|
|
159
|
+
"": null,
|
|
160
|
+
"@own(!:is(.not-content *))": "-0.5rem start",
|
|
161
|
+
},
|
|
162
|
+
inlinePadding: {
|
|
163
|
+
"": null,
|
|
164
|
+
"@own(!:is(.not-content *))": "0.5rem start",
|
|
165
|
+
},
|
|
166
|
+
color: { "": null, "@own(!:is(.not-content *))": "#text" },
|
|
167
|
+
preset: { "": null, "@own(!:is(.not-content *))": "strong" },
|
|
168
|
+
},
|
|
169
|
+
OpenSummary: {
|
|
170
|
+
$: "details > summary",
|
|
171
|
+
"$margin-block-start": {
|
|
172
|
+
"": null,
|
|
173
|
+
"@own(:is(details[open] > summary)) & @own(!:is(.not-content *))":
|
|
174
|
+
"0",
|
|
175
|
+
},
|
|
176
|
+
"$margin-block-end": {
|
|
177
|
+
"": null,
|
|
178
|
+
"@own(:is(details[open] > summary)) & @own(!:is(.not-content *))":
|
|
179
|
+
"($gap * 2)",
|
|
180
|
+
},
|
|
181
|
+
blockMargin: {
|
|
182
|
+
"": null,
|
|
183
|
+
"@own(:is(details[open] > summary)) & @own(!:is(.not-content *))":
|
|
184
|
+
"$margin-block-start $margin-block-end",
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
SummaryMarker: {
|
|
188
|
+
// Tasty 3.9.3 appends @own states after pseudo-elements, producing invalid CSS.
|
|
189
|
+
// eslint-disable-next-line tasty/no-state-in-selector
|
|
190
|
+
$: "summary:not(.not-content *)::marker, summary:not(.not-content *)::-webkit-details-marker",
|
|
191
|
+
hide: true,
|
|
192
|
+
},
|
|
193
|
+
SummaryIcon: {
|
|
194
|
+
// Tasty 3.9.3 appends @own states after pseudo-elements, producing invalid CSS.
|
|
195
|
+
// eslint-disable-next-line tasty/no-state-in-selector
|
|
196
|
+
$: "summary:not(.not-content *)::before",
|
|
197
|
+
content: '""',
|
|
198
|
+
display: "inline-block",
|
|
199
|
+
inlineSize: "1.25rem",
|
|
200
|
+
blockSize: "1.25rem",
|
|
201
|
+
inlineMargin: "($gap * 0.5) end",
|
|
202
|
+
verticalAlign: "middle",
|
|
203
|
+
fill: "#current",
|
|
204
|
+
// The imported SVG is encoded at build time and never evaluated in the browser.
|
|
205
|
+
// eslint-disable-next-line tasty/no-runtime-styles-mutation
|
|
206
|
+
mask: `url("${svgIconUrl(chevronRightIcon)}") center / contain no-repeat`,
|
|
207
|
+
transition: "rotate $transition",
|
|
208
|
+
},
|
|
209
|
+
OpenSummaryIcon: {
|
|
210
|
+
// Tasty 3.9.3 appends @own states after pseudo-elements, producing invalid CSS.
|
|
211
|
+
// eslint-disable-next-line tasty/no-state-in-selector
|
|
212
|
+
$: "details[open] > summary:not(.not-content *)::before",
|
|
213
|
+
rotate: "90deg",
|
|
214
|
+
},
|
|
215
|
+
Code: {
|
|
216
|
+
$: ":where(code)",
|
|
217
|
+
radius: { "": null, "@own(!:is(.not-content *))": "($radius * 0.65)" },
|
|
218
|
+
},
|
|
219
|
+
}),
|
|
220
|
+
);
|
|
221
|
+
|
|
222
|
+
MarkdownInlineCodeStyles();
|
|
223
|
+
SyntaxHighlightStyles();
|
|
224
|
+
MarkdownCodeBlockStyles();
|
|
225
|
+
MermaidSourceStyles();
|
|
226
|
+
MermaidStyles();
|
|
227
|
+
MarkdownHeadingStyles();
|
|
228
|
+
MarkdownAlertStyles();
|
|
229
|
+
MarkdownTableStyles();
|
|
230
|
+
return null;
|
|
231
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { useGlobalStyles } from "@tenphi/tasty";
|
|
2
|
+
import checkIcon from "../icons/check.svg?raw";
|
|
3
|
+
import { resolveComponentStyles } from "./component-styles.js";
|
|
4
|
+
import { svgIconUrl } from "./svg-icon.js";
|
|
5
|
+
import { configureCookbookStates } from "./tasty-states.js";
|
|
6
|
+
|
|
7
|
+
configureCookbookStates();
|
|
8
|
+
|
|
9
|
+
export function MarkdownHeadingStyles() {
|
|
10
|
+
useGlobalStyles(
|
|
11
|
+
".cookbook-markdown-content .cookbook-heading-wrapper",
|
|
12
|
+
resolveComponentStyles("MarkdownHeading", {
|
|
13
|
+
position: "relative",
|
|
14
|
+
color: "#heading",
|
|
15
|
+
preset: {
|
|
16
|
+
"": "heading",
|
|
17
|
+
".level-h1": "h1",
|
|
18
|
+
".level-h2": "h2",
|
|
19
|
+
".level-h3": "h3",
|
|
20
|
+
".level-h4": "h4",
|
|
21
|
+
".level-h5": "h5",
|
|
22
|
+
".level-h6": "h6",
|
|
23
|
+
},
|
|
24
|
+
Heading: {
|
|
25
|
+
$: "> *",
|
|
26
|
+
color: { "": null, "@own(:first-child)": "inherit" },
|
|
27
|
+
display: { "": "", "@own(:first-child)": "inline" },
|
|
28
|
+
inlinePadding: {
|
|
29
|
+
"": null,
|
|
30
|
+
"@own(:first-child)": "0 end",
|
|
31
|
+
"(@own(:first-child)) & (@mobile)": "1.75rem end",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
Link: {
|
|
35
|
+
$: "> .cookbook-anchor-link",
|
|
36
|
+
position: { "": "absolute", "@mobile": "relative" },
|
|
37
|
+
blockInset: {
|
|
38
|
+
"": "((1lh - 1.75rem) / 2) start",
|
|
39
|
+
"@mobile": "auto start",
|
|
40
|
+
},
|
|
41
|
+
inlineInset: { "": "-2rem start", "@mobile": "auto start" },
|
|
42
|
+
display: "inline-grid",
|
|
43
|
+
placeItems: "center",
|
|
44
|
+
inlineSize: { "": "1.75rem", "@mobile": "1.5rem" },
|
|
45
|
+
blockSize: { "": "1.75rem", "@mobile": "1.5rem" },
|
|
46
|
+
inlineMargin: { "": "0 start", "@mobile": "-1.5rem start" },
|
|
47
|
+
verticalAlign: { "": "baseline", "@mobile": "middle" },
|
|
48
|
+
color: "#text-muted",
|
|
49
|
+
opacity: {
|
|
50
|
+
"": "1",
|
|
51
|
+
"@media(hover: hover)": "0",
|
|
52
|
+
"@mobile": "1",
|
|
53
|
+
},
|
|
54
|
+
radius: "$radius",
|
|
55
|
+
userSelect: "none",
|
|
56
|
+
textDecoration: "none",
|
|
57
|
+
transition: "color $transition, fill $transition, opacity $transition",
|
|
58
|
+
},
|
|
59
|
+
RevealedLink: {
|
|
60
|
+
$: "> .cookbook-anchor-link",
|
|
61
|
+
opacity: {
|
|
62
|
+
"": null,
|
|
63
|
+
":hover | @own(:focus-visible)": "1",
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
HoverLink: {
|
|
67
|
+
$: "> .cookbook-anchor-link",
|
|
68
|
+
color: {
|
|
69
|
+
"": null,
|
|
70
|
+
"@own(:hover | :focus-visible)": "#accent-text",
|
|
71
|
+
},
|
|
72
|
+
fill: {
|
|
73
|
+
"": null,
|
|
74
|
+
"@own(:hover | :focus-visible)": "#surface-2-hover",
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
LinkIcon: {
|
|
78
|
+
$: "> .cookbook-anchor-link > .cookbook-anchor-icon",
|
|
79
|
+
display: "block",
|
|
80
|
+
preset: "inherit / tight",
|
|
81
|
+
// Scale with the current heading without replacing its inherited typography.
|
|
82
|
+
// eslint-disable-next-line tasty/prefer-shorthand-property
|
|
83
|
+
fontSize: "clamp(1rem, 0.65em, 1.5rem)",
|
|
84
|
+
textAlign: "center",
|
|
85
|
+
inlineSize: "1em",
|
|
86
|
+
blockSize: "1em",
|
|
87
|
+
},
|
|
88
|
+
CopiedLink: {
|
|
89
|
+
$: "> .cookbook-anchor-link",
|
|
90
|
+
color: { "": null, '@own([data-copy-state="copied"])': "#green-text" },
|
|
91
|
+
opacity: { "": null, '@own([data-copy-state="copied"])': "1" },
|
|
92
|
+
},
|
|
93
|
+
CopiedLinkIcon: {
|
|
94
|
+
$: "> .cookbook-anchor-link > .cookbook-anchor-icon",
|
|
95
|
+
visibility: {
|
|
96
|
+
"": null,
|
|
97
|
+
'@own(:is(.cookbook-anchor-link[data-copy-state="copied"] > .cookbook-anchor-icon))':
|
|
98
|
+
"hidden",
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
CopiedIcon: {
|
|
102
|
+
// Tasty 3.9.3 appends @own states after pseudo-elements, producing invalid CSS.
|
|
103
|
+
// eslint-disable-next-line tasty/no-state-in-selector
|
|
104
|
+
$: '> .cookbook-anchor-link[data-copy-state="copied"]::after',
|
|
105
|
+
content: '""',
|
|
106
|
+
position: "absolute",
|
|
107
|
+
inlineSize: "clamp(1rem, 0.65em, 1.5rem)",
|
|
108
|
+
blockSize: "clamp(1rem, 0.65em, 1.5rem)",
|
|
109
|
+
fill: "#current",
|
|
110
|
+
// The imported SVG is encoded at build time and never evaluated in the browser.
|
|
111
|
+
// eslint-disable-next-line tasty/no-runtime-styles-mutation
|
|
112
|
+
mask: `url("${svgIconUrl(checkIcon)}") center / contain no-repeat`,
|
|
113
|
+
},
|
|
114
|
+
}),
|
|
115
|
+
);
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useGlobalStyles } from "@tenphi/tasty";
|
|
2
|
+
import { resolveComponentStyles } from "./component-styles.js";
|
|
3
|
+
import { configureCookbookStates } from "./tasty-states.js";
|
|
4
|
+
|
|
5
|
+
configureCookbookStates();
|
|
6
|
+
|
|
7
|
+
export function MarkdownInlineCodeStyles() {
|
|
8
|
+
useGlobalStyles(
|
|
9
|
+
".cookbook-markdown-content code:not(:where(pre *, .not-content *))",
|
|
10
|
+
resolveComponentStyles("MarkdownInlineCode", {
|
|
11
|
+
padding: "0.125rem 0.375rem",
|
|
12
|
+
color: "#text-soft",
|
|
13
|
+
fill: "#surface-3",
|
|
14
|
+
preset: "inline-code",
|
|
15
|
+
radius: "($radius * 0.65)",
|
|
16
|
+
}),
|
|
17
|
+
);
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { useGlobalStyles } from "@tenphi/tasty";
|
|
2
|
+
import { resolveComponentStyles } from "./component-styles.js";
|
|
3
|
+
import { configureCookbookStates } from "./tasty-states.js";
|
|
4
|
+
|
|
5
|
+
configureCookbookStates();
|
|
6
|
+
|
|
7
|
+
export function MarkdownTableStyles() {
|
|
8
|
+
useGlobalStyles(
|
|
9
|
+
".cookbook-markdown-content:where(*)",
|
|
10
|
+
resolveComponentStyles("MarkdownTable", {
|
|
11
|
+
Table: {
|
|
12
|
+
$: "table",
|
|
13
|
+
inlineSize: "100%",
|
|
14
|
+
borderCollapse: "separate",
|
|
15
|
+
borderSpacing: "0",
|
|
16
|
+
color: "#text-soft",
|
|
17
|
+
preset: "small",
|
|
18
|
+
border: "$border-width solid #border",
|
|
19
|
+
radius: "$card-radius",
|
|
20
|
+
},
|
|
21
|
+
Cell: {
|
|
22
|
+
$: "th, td",
|
|
23
|
+
padding: "($gap * 1.5) ($gap * 2)",
|
|
24
|
+
verticalAlign: "top",
|
|
25
|
+
// Change only color; border widths and styles belong to other rules or theme overrides.
|
|
26
|
+
// eslint-disable-next-line tasty/prefer-shorthand-property
|
|
27
|
+
borderColor: "#border",
|
|
28
|
+
},
|
|
29
|
+
LastBodyRowCell: {
|
|
30
|
+
$: "tbody td",
|
|
31
|
+
// Clear only the last row's end border; the theme may configure its start border.
|
|
32
|
+
// eslint-disable-next-line tasty/prefer-shorthand-property
|
|
33
|
+
borderBlockEnd: { "@own(:is(tbody tr:last-child > td))": "0" },
|
|
34
|
+
},
|
|
35
|
+
HeaderCell: {
|
|
36
|
+
$: "th",
|
|
37
|
+
color: "#text",
|
|
38
|
+
fill: "#surface-2",
|
|
39
|
+
textAlign: "start",
|
|
40
|
+
radius: {
|
|
41
|
+
"@own(:is(thead:first-child tr:first-child > th) & :first-child & !:last-child)":
|
|
42
|
+
"($card-radius - $border-width) top-left",
|
|
43
|
+
"@own(:is(thead:first-child tr:first-child > th) & !:first-child & :last-child)":
|
|
44
|
+
"($card-radius - $border-width) top-right",
|
|
45
|
+
"@own(:is(thead:first-child tr:first-child > th) & :first-child & :last-child)":
|
|
46
|
+
"($card-radius - $border-width) top",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
Scroll: {
|
|
50
|
+
$: ".td-table-scroll",
|
|
51
|
+
inlineSize: "initial 100% 100%",
|
|
52
|
+
overflow: "auto",
|
|
53
|
+
scrollbar: "thin",
|
|
54
|
+
},
|
|
55
|
+
}),
|
|
56
|
+
);
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { useGlobalStyles } from "@tenphi/tasty";
|
|
2
|
+
import { resolveComponentStyles } from "./component-styles.js";
|
|
3
|
+
import { configureCookbookStates } from "./tasty-states.js";
|
|
4
|
+
|
|
5
|
+
configureCookbookStates();
|
|
6
|
+
|
|
7
|
+
export function MermaidStyles() {
|
|
8
|
+
useGlobalStyles(
|
|
9
|
+
".cookbook-markdown-content .td-mermaid",
|
|
10
|
+
resolveComponentStyles("Mermaid", {
|
|
11
|
+
display: "grid",
|
|
12
|
+
placeItems: "center",
|
|
13
|
+
inlineSize: "min 0",
|
|
14
|
+
padding: "($gap * 2)",
|
|
15
|
+
overflowX: "auto",
|
|
16
|
+
border: true,
|
|
17
|
+
fill: "#surface-2",
|
|
18
|
+
radius: "$card-radius",
|
|
19
|
+
Diagram: {
|
|
20
|
+
$: "> svg",
|
|
21
|
+
$bg: "#surface-2",
|
|
22
|
+
$fg: "#text",
|
|
23
|
+
$line: "#text-soft",
|
|
24
|
+
$accent: "#accent-text",
|
|
25
|
+
$muted: "#text-soft",
|
|
26
|
+
$surface: "#surface",
|
|
27
|
+
$border: "#border-strong",
|
|
28
|
+
$_text: "#text",
|
|
29
|
+
"$_text-sec": "#text-soft",
|
|
30
|
+
"$_text-muted": "#text-soft",
|
|
31
|
+
"$_text-faint": "#text-muted",
|
|
32
|
+
$_line: "#text-soft",
|
|
33
|
+
$_arrow: "#accent-text",
|
|
34
|
+
"$_node-fill": "#surface",
|
|
35
|
+
"$_node-stroke": "#border-strong",
|
|
36
|
+
"$_group-fill": "#surface-2",
|
|
37
|
+
"$_group-hdr": "#surface",
|
|
38
|
+
"$_inner-stroke": "#border",
|
|
39
|
+
"$_key-badge": "#surface",
|
|
40
|
+
display: "block",
|
|
41
|
+
inlineSize: "max 100%",
|
|
42
|
+
blockSize: "auto",
|
|
43
|
+
margin: "auto",
|
|
44
|
+
},
|
|
45
|
+
Text: { $: "text", font: "$body-font-family" },
|
|
46
|
+
MonoText: { $: ":is(.mono)", font: "$code-font-family" },
|
|
47
|
+
}),
|
|
48
|
+
);
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useGlobalStyles } from "@tenphi/tasty";
|
|
2
|
+
import { resolveComponentStyles } from "./component-styles.js";
|
|
3
|
+
import { configureCookbookStates } from "./tasty-states.js";
|
|
4
|
+
|
|
5
|
+
configureCookbookStates();
|
|
6
|
+
|
|
7
|
+
export function MermaidSourceStyles() {
|
|
8
|
+
useGlobalStyles(
|
|
9
|
+
'.cookbook-markdown-content pre[data-language="mermaid"]:not(.not-content *)',
|
|
10
|
+
resolveComponentStyles("MermaidSource", {
|
|
11
|
+
padding: "0.875rem 1rem",
|
|
12
|
+
overflowX: "auto",
|
|
13
|
+
color: "#syntax-text",
|
|
14
|
+
border: true,
|
|
15
|
+
fill: "#syntax-bg",
|
|
16
|
+
radius: "$card-radius",
|
|
17
|
+
tabSize: "2",
|
|
18
|
+
}),
|
|
19
|
+
);
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { configureCookbookStates } from "./tasty-states.js";
|
|
2
|
+
import { defineComponent } from "../define-component.js";
|
|
3
|
+
|
|
4
|
+
configureCookbookStates();
|
|
5
|
+
|
|
6
|
+
export const MobileMenuFooterRoot = defineComponent("MobileMenuFooter", {
|
|
7
|
+
as: "div",
|
|
8
|
+
"data-element": "MobileMenuFooter",
|
|
9
|
+
styles: {
|
|
10
|
+
display: "flex",
|
|
11
|
+
alignItems: "center",
|
|
12
|
+
justifyContent: "space-between",
|
|
13
|
+
flow: "row wrap",
|
|
14
|
+
gap: "($gap * 2)",
|
|
15
|
+
blockPadding: "$gap",
|
|
16
|
+
blockBorder: "$border-width solid #border start",
|
|
17
|
+
Social: {
|
|
18
|
+
$: ".td-mobile-preferences__social",
|
|
19
|
+
display: "flex",
|
|
20
|
+
hide: { "": false, ":empty": true },
|
|
21
|
+
alignItems: "center",
|
|
22
|
+
gap: "($gap * 2)",
|
|
23
|
+
inlineMargin: "auto end",
|
|
24
|
+
blockPadding: "($gap * 2)",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
});
|