@tenphi/renderer 0.27.0 → 0.30.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.
- package/README.md +6 -4
- package/dist/client/preview-height.d.ts +16 -0
- package/dist/client/preview-height.d.ts.map +1 -0
- package/dist/client/preview-height.js +31 -0
- package/dist/client/preview-height.js.map +1 -0
- package/dist/components/Banner.styles.js +1 -1
- package/dist/components/Button.styles.js +1 -1
- package/dist/components/Card.astro +3 -4
- package/dist/components/Card.styles.js +16 -25
- package/dist/components/Document.styles.js +19 -40
- package/dist/components/Footer.styles.js +5 -5
- package/dist/components/Header.styles.js +2 -2
- package/dist/components/HeaderFrame.styles.js +1 -1
- package/dist/components/HeaderLinks.styles.js +25 -15
- package/dist/components/Hero.styles.js +8 -8
- package/dist/components/LanguageSelect.styles.js +5 -6
- package/dist/components/MainContent.styles.js +6 -8
- package/dist/components/MainPane.styles.js +2 -2
- package/dist/components/MarkdownAlert.styles.js +13 -13
- package/dist/components/MarkdownCodeBlock.styles.js +7 -10
- package/dist/components/MarkdownContent.styles.js +11 -17
- package/dist/components/MarkdownHeading.styles.js +4 -6
- package/dist/components/MarkdownInlineCode.styles.js +1 -1
- package/dist/components/MarkdownTable.styles.js +7 -10
- package/dist/components/Mermaid.styles.js +2 -2
- package/dist/components/MermaidSource.styles.js +1 -1
- package/dist/components/MobileMenuFooter.styles.js +5 -5
- package/dist/components/MobileMenuToggle.styles.js +2 -2
- package/dist/components/MobileNavigationTabs.styles.js +9 -10
- package/dist/components/MobileTableOfContents.styles.js +7 -7
- package/dist/components/PackageVersion.styles.js +1 -1
- package/dist/components/PageActions.styles.js +3 -3
- package/dist/components/PageFrame.styles.js +1 -1
- package/dist/components/Pagination.styles.js +13 -18
- package/dist/components/Preview.astro +7 -0
- package/dist/components/Preview.styles.js +10 -4
- package/dist/components/Search.styles.js +7 -8
- package/dist/components/SearchButton.styles.js +13 -5
- package/dist/components/SearchResults.styles.js +20 -20
- package/dist/components/Sidebar.styles.js +17 -19
- package/dist/components/SkipLink.styles.js +4 -3
- package/dist/components/SocialIcons.styles.js +1 -1
- package/dist/components/Steps.styles.js +3 -3
- package/dist/components/TableOfContents.styles.js +3 -3
- package/dist/components/TableOfContentsLayout.styles.js +2 -2
- package/dist/components/ThemeSelect.styles.js +16 -16
- package/dist/components/TopNavigation.styles.js +1 -3
- package/dist/components/VersionSwitcher.styles.js +4 -4
- package/dist/components/props.d.ts +2 -0
- package/dist/components/props.d.ts.map +1 -1
- package/dist/components/props.ts +2 -0
- package/dist/components/select-popover-styles.js +14 -14
- package/dist/define-component.d.ts.map +1 -1
- package/dist/define-component.js +20 -1
- package/dist/define-component.js.map +1 -0
- package/dist/eslint-plugin.d.ts +0 -5
- package/dist/eslint-plugin.d.ts.map +1 -1
- package/dist/eslint-plugin.js +0 -5
- package/dist/eslint-plugin.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/preview-document.d.ts +16 -3
- package/dist/preview-document.d.ts.map +1 -1
- package/dist/preview-document.js +31 -9
- package/dist/preview-document.js.map +1 -1
- package/dist/styling.js +2 -2
- package/dist/styling.js.map +1 -1
- package/package.json +4 -4
- package/dist/components/inherit-component-parts.d.ts +0 -1
- package/dist/components/inherit-component-parts.js +0 -7
- package/dist/define-component-BP4YwMak.js +0 -28
- package/dist/define-component-BP4YwMak.js.map +0 -1
package/README.md
CHANGED
|
@@ -9,13 +9,15 @@ mobile sidebar. Application-owned Astro content
|
|
|
9
9
|
collections remain independent.
|
|
10
10
|
|
|
11
11
|
`@tenphi/renderer/styling` exports `tasty`, `useGlobalStyles`, `mergeStyles`,
|
|
12
|
-
the `Styles` type,
|
|
13
|
-
|
|
12
|
+
the `Styles` type, the shared `Button` foundation, and the `defineComponent`,
|
|
13
|
+
`extendComponent`, and `resolveComponentStyles` helpers for merging
|
|
14
|
+
`theme.customStyles` into custom components. The facade exposes
|
|
14
15
|
the same API through `@tenphi/cookbook/styling`.
|
|
15
16
|
|
|
16
17
|
`@tenphi/renderer/eslint-plugin` exports the default Tasty ESLint plugin,
|
|
17
|
-
`recommended` and `strict` rule maps, its configuration types,
|
|
18
|
-
`validationConfig` preset covering Cookbook's theme names and styling helpers
|
|
18
|
+
`recommended` and `strict` rule maps, its configuration types, a
|
|
19
|
+
`validationConfig` preset covering Cookbook's theme names and styling helpers,
|
|
20
|
+
and `createValidationConfig(theme)` for deriving names from a theme.
|
|
19
21
|
Use `extends: "@tenphi/renderer"` in `tasty.config.ts` to inherit this preset
|
|
20
22
|
and list only your additional tokens, states, or presets.
|
|
21
23
|
It matches `@tenphi/cookbook/eslint-plugin`; see
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/client/preview-height.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* The message a scripted preview frame and its page exchange. The frame's
|
|
4
|
+
* reporter (preview-document.ts) posts `{ type, height }` with its content
|
|
5
|
+
* height; the page posts `{ type }` to ask for the height again.
|
|
6
|
+
*/
|
|
7
|
+
declare const PREVIEW_HEIGHT_MESSAGE = "cookbook:preview-height";
|
|
8
|
+
/**
|
|
9
|
+
* Size each preview frame to the height its document reports plus the frame's
|
|
10
|
+
* `data-buffer` length, a validated CSS length. The frame's `min-height` and
|
|
11
|
+
* `max-height` clamp the value, so this only sets `height`.
|
|
12
|
+
*/
|
|
13
|
+
declare function initializePreviewHeight(): void;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { PREVIEW_HEIGHT_MESSAGE, initializePreviewHeight };
|
|
16
|
+
//# sourceMappingURL=preview-height.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-height.d.ts","names":[],"sources":["../../src/client/preview-height.ts"],"mappings":";;;;;;cAKa;;;;;;iBAUG"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/client/preview-height.ts
|
|
2
|
+
/**
|
|
3
|
+
* The message a scripted preview frame and its page exchange. The frame's
|
|
4
|
+
* reporter (preview-document.ts) posts `{ type, height }` with its content
|
|
5
|
+
* height; the page posts `{ type }` to ask for the height again.
|
|
6
|
+
*/
|
|
7
|
+
const PREVIEW_HEIGHT_MESSAGE = "cookbook:preview-height";
|
|
8
|
+
const previewFrames = () => document.querySelectorAll("[data-element=Preview] iframe");
|
|
9
|
+
/**
|
|
10
|
+
* Size each preview frame to the height its document reports plus the frame's
|
|
11
|
+
* `data-buffer` length, a validated CSS length. The frame's `min-height` and
|
|
12
|
+
* `max-height` clamp the value, so this only sets `height`.
|
|
13
|
+
*/
|
|
14
|
+
function initializePreviewHeight() {
|
|
15
|
+
addEventListener("message", resizePreviewFrame);
|
|
16
|
+
for (const frame of previewFrames()) frame.contentWindow?.postMessage({ type: PREVIEW_HEIGHT_MESSAGE }, "*");
|
|
17
|
+
}
|
|
18
|
+
function resizePreviewFrame({ data, source }) {
|
|
19
|
+
const height = data?.type === "cookbook:preview-height" && data.height;
|
|
20
|
+
if (typeof height !== "number" || !Number.isFinite(height) || height < 0) return;
|
|
21
|
+
for (const frame of previewFrames()) if (frame.contentWindow === source) {
|
|
22
|
+
const content = `${Math.ceil(height)}px`;
|
|
23
|
+
const { buffer } = frame.dataset;
|
|
24
|
+
frame.style.height = buffer ? `calc(${content} + ${buffer})` : content;
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { PREVIEW_HEIGHT_MESSAGE, initializePreviewHeight };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=preview-height.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-height.js","names":[],"sources":["../../src/client/preview-height.ts"],"sourcesContent":["/**\n * The message a scripted preview frame and its page exchange. The frame's\n * reporter (preview-document.ts) posts `{ type, height }` with its content\n * height; the page posts `{ type }` to ask for the height again.\n */\nexport const PREVIEW_HEIGHT_MESSAGE = \"cookbook:preview-height\";\n\nconst previewFrames = () =>\n document.querySelectorAll<HTMLIFrameElement>(\"[data-element=Preview] iframe\");\n\n/**\n * Size each preview frame to the height its document reports plus the frame's\n * `data-buffer` length, a validated CSS length. The frame's `min-height` and\n * `max-height` clamp the value, so this only sets `height`.\n */\nexport function initializePreviewHeight(): void {\n addEventListener(\"message\", resizePreviewFrame);\n // Frames usually load and report before this deferred module runs.\n for (const frame of previewFrames())\n frame.contentWindow?.postMessage({ type: PREVIEW_HEIGHT_MESSAGE }, \"*\");\n}\n\nfunction resizePreviewFrame({ data, source }: MessageEvent): void {\n const height: unknown = data?.type === PREVIEW_HEIGHT_MESSAGE && data.height;\n if (typeof height !== \"number\" || !Number.isFinite(height) || height < 0)\n return;\n for (const frame of previewFrames())\n if (frame.contentWindow === source) {\n const content = `${Math.ceil(height)}px`;\n const { buffer } = frame.dataset;\n frame.style.height = buffer ? `calc(${content} + ${buffer})` : content;\n return;\n }\n}\n"],"mappings":";;;;;;AAKA,MAAa,yBAAyB;AAEtC,MAAM,sBACJ,SAAS,iBAAoC,+BAA+B;;;;;;AAO9E,SAAgB,0BAAgC;CAC9C,iBAAiB,WAAW,kBAAkB;CAE9C,KAAK,MAAM,SAAS,cAAc,GAChC,MAAM,eAAe,YAAY,EAAE,MAAM,uBAAuB,GAAG,GAAG;AAC1E;AAEA,SAAS,mBAAmB,EAAE,MAAM,UAA8B;CAChE,MAAM,SAAkB,MAAM,SAAA,6BAAmC,KAAK;CACtE,IAAI,OAAO,WAAW,YAAY,CAAC,OAAO,SAAS,MAAM,KAAK,SAAS,GACrE;CACF,KAAK,MAAM,SAAS,cAAc,GAChC,IAAI,MAAM,kBAAkB,QAAQ;EAClC,MAAM,UAAU,GAAG,KAAK,KAAK,MAAM,EAAE;EACrC,MAAM,EAAE,WAAW,MAAM;EACzB,MAAM,MAAM,SAAS,SAAS,QAAQ,QAAQ,KAAK,OAAO,KAAK;EAC/D;CACF;AACJ"}
|
|
@@ -7,7 +7,7 @@ export const BannerRoot = defineComponent("Banner", {
|
|
|
7
7
|
as: "div",
|
|
8
8
|
"data-element": "Banner",
|
|
9
9
|
styles: {
|
|
10
|
-
padding: "
|
|
10
|
+
padding: "1.5x $docs-nav-pad-x",
|
|
11
11
|
color: "#accent-surface-text",
|
|
12
12
|
fill: "#accent-surface",
|
|
13
13
|
preset: "body / strong",
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
import {
|
|
2
|
+
import { CardRoot } from "./Card.styles.js";
|
|
3
3
|
|
|
4
4
|
import type { CardProps as Props } from "./props.js";
|
|
5
5
|
|
|
6
6
|
const { title, href } = Astro.props;
|
|
7
|
-
const Root = href ? CardLink : CardRoot;
|
|
8
7
|
---
|
|
9
8
|
|
|
10
|
-
<
|
|
9
|
+
<CardRoot as={href ? "a" : undefined} className="td-card" href={href}>
|
|
11
10
|
{title && <h3>{title}</h3>}
|
|
12
11
|
<div><slot /></div>
|
|
13
|
-
</
|
|
12
|
+
</CardRoot>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { configureCookbookStates } from "./tasty-states.js";
|
|
2
|
-
import { tasty } from "@tenphi/tasty";
|
|
3
2
|
import { defineComponent } from "../define-component.js";
|
|
4
3
|
|
|
5
4
|
configureCookbookStates();
|
|
@@ -16,11 +15,24 @@ export const CardRoot = defineComponent("Card", {
|
|
|
16
15
|
textDecoration: "none",
|
|
17
16
|
border: true,
|
|
18
17
|
radius: "1cr",
|
|
19
|
-
fill:
|
|
18
|
+
fill: {
|
|
19
|
+
"": "#surface-2",
|
|
20
|
+
":any-link & :hover": "#surface-2-hover",
|
|
21
|
+
":any-link & :active": "#surface-2-pressed",
|
|
22
|
+
},
|
|
20
23
|
"$resting-shadow-offset": "1px",
|
|
21
24
|
"$resting-shadow-blur": "2px",
|
|
22
|
-
shadow:
|
|
23
|
-
|
|
25
|
+
shadow: {
|
|
26
|
+
"": "0 $resting-shadow-offset $resting-shadow-blur #shadow",
|
|
27
|
+
":any-link & :hover": "0 .75x 2x #shadow",
|
|
28
|
+
},
|
|
29
|
+
"$hover-offset": "-1px",
|
|
30
|
+
translate: {
|
|
31
|
+
"": "0",
|
|
32
|
+
":any-link & :hover": "0 $hover-offset",
|
|
33
|
+
":any-link & :active": "0",
|
|
34
|
+
},
|
|
35
|
+
transition: "fill, shadow, translate",
|
|
24
36
|
|
|
25
37
|
Heading2: {
|
|
26
38
|
$: "h2",
|
|
@@ -45,24 +57,3 @@ export const CardRoot = defineComponent("Card", {
|
|
|
45
57
|
},
|
|
46
58
|
},
|
|
47
59
|
});
|
|
48
|
-
|
|
49
|
-
export const CardLink = tasty(CardRoot, {
|
|
50
|
-
as: "a",
|
|
51
|
-
styles: {
|
|
52
|
-
fill: {
|
|
53
|
-
"": "#surface-2",
|
|
54
|
-
":hover": "#surface-2-hover",
|
|
55
|
-
":active": "#surface-2-pressed",
|
|
56
|
-
},
|
|
57
|
-
shadow: {
|
|
58
|
-
"": "0 $resting-shadow-offset $resting-shadow-blur #shadow",
|
|
59
|
-
":hover": "0 .75x 2x #shadow",
|
|
60
|
-
},
|
|
61
|
-
"$hover-offset": "-1px",
|
|
62
|
-
translate: {
|
|
63
|
-
"": "0",
|
|
64
|
-
":hover": "0 $hover-offset",
|
|
65
|
-
":active": "0",
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
});
|
|
@@ -3,7 +3,6 @@ import jetBrainsMonoLatin from "@fontsource-variable/jetbrains-mono/files/jetbra
|
|
|
3
3
|
import onestLatin from "@fontsource-variable/onest/files/onest-latin-wght-normal.woff2?url";
|
|
4
4
|
import { resolveComponentStyles } from "./component-styles.js";
|
|
5
5
|
import { configureCookbookStates } from "./tasty-states.js";
|
|
6
|
-
import { TASTY_SPACING_PROPERTIES } from "../theme/tasty-config.js";
|
|
7
6
|
import { getDefaultFontUsage, getFontFaces } from "../theme/fonts.js";
|
|
8
7
|
|
|
9
8
|
configureCookbookStates();
|
|
@@ -31,11 +30,7 @@ export default function DocumentStyles() {
|
|
|
31
30
|
"": null,
|
|
32
31
|
":has(#cookbook__sidebar:popover-open) & !@md": "hidden",
|
|
33
32
|
},
|
|
34
|
-
colorScheme: {
|
|
35
|
-
"": "dark",
|
|
36
|
-
'[data-theme="light"]': "light",
|
|
37
|
-
"![data-theme] & @system-light": "light",
|
|
38
|
-
},
|
|
33
|
+
colorScheme: { "": "dark", "@light": "light" },
|
|
39
34
|
"$docs-nav-height": {
|
|
40
35
|
"": "4.5rem",
|
|
41
36
|
":has(TopNavigation)": "7.25rem",
|
|
@@ -49,7 +44,8 @@ export default function DocumentStyles() {
|
|
|
49
44
|
"$docs-nav-gap": { "": "0.75rem", "!@md": "0.5rem" },
|
|
50
45
|
"$docs-sidebar-pad-x": "1.5rem",
|
|
51
46
|
"$docs-content-pad-x": {
|
|
52
|
-
|
|
47
|
+
// Desktop heading links extend 2rem into this gutter; leave room for focus rings.
|
|
48
|
+
"": "clamp(2.5rem, ((100% - $content-width) / 2), 4rem)",
|
|
53
49
|
"!@md": "1rem",
|
|
54
50
|
},
|
|
55
51
|
"$docs-menu-button-size": { "": "2.5rem", "!@md": "2.25rem" },
|
|
@@ -64,10 +60,9 @@ export default function DocumentStyles() {
|
|
|
64
60
|
useGlobalStyles(
|
|
65
61
|
":where(html)",
|
|
66
62
|
resolveComponentStyles("Document", {
|
|
67
|
-
"@property": TASTY_SPACING_PROPERTIES,
|
|
68
63
|
boxSizing: "border-box",
|
|
69
|
-
scrollBehavior: { "@reduced-motion": "auto" },
|
|
70
|
-
transitionDuration: { "@reduced-motion": "0.01ms" },
|
|
64
|
+
scrollBehavior: { "": null, "@reduced-motion": "auto" },
|
|
65
|
+
transitionDuration: { "": null, "@reduced-motion": "0.01ms" },
|
|
71
66
|
"$margin-block-start": "0",
|
|
72
67
|
"$margin-block-end": "0",
|
|
73
68
|
blockSize: "min 100%",
|
|
@@ -76,12 +71,8 @@ export default function DocumentStyles() {
|
|
|
76
71
|
All: {
|
|
77
72
|
$: "&::before, &::after, *, *::before, *::after",
|
|
78
73
|
boxSizing: "border-box",
|
|
79
|
-
scrollBehavior: {
|
|
80
|
-
|
|
81
|
-
},
|
|
82
|
-
transitionDuration: {
|
|
83
|
-
"@reduced-motion": "0.01ms",
|
|
84
|
-
},
|
|
74
|
+
scrollBehavior: { "": null, "@reduced-motion": "auto" },
|
|
75
|
+
transitionDuration: { "": null, "@reduced-motion": "0.01ms" },
|
|
85
76
|
},
|
|
86
77
|
BlockSpacing: {
|
|
87
78
|
$: "*",
|
|
@@ -122,7 +113,7 @@ export default function DocumentStyles() {
|
|
|
122
113
|
$: ":where(button), :where(input), :where(select), :where(textarea)",
|
|
123
114
|
preset: "body",
|
|
124
115
|
blockSize: "min $control-height",
|
|
125
|
-
radius: "
|
|
116
|
+
radius: "1r",
|
|
126
117
|
shadow: "none",
|
|
127
118
|
},
|
|
128
119
|
Pointer: {
|
|
@@ -152,23 +143,17 @@ export default function DocumentStyles() {
|
|
|
152
143
|
},
|
|
153
144
|
PrintHidden: {
|
|
154
145
|
$: "*",
|
|
155
|
-
|
|
146
|
+
hide: { "": null, "@own(print-hidden) & @media:print": true },
|
|
156
147
|
},
|
|
157
148
|
DesktopBlock: {
|
|
158
149
|
$: "*",
|
|
159
|
-
display: {
|
|
160
|
-
|
|
161
|
-
"@own(desktop-block)": "block",
|
|
162
|
-
"@own(desktop-block) & !@md": "none",
|
|
163
|
-
},
|
|
150
|
+
display: { "": null, "@own(desktop-block)": "block" },
|
|
151
|
+
hide: { "": null, "@own(desktop-block) & !@md": true },
|
|
164
152
|
},
|
|
165
153
|
DesktopFlex: {
|
|
166
154
|
$: "*",
|
|
167
|
-
display: {
|
|
168
|
-
|
|
169
|
-
"@own(desktop-flex)": "flex",
|
|
170
|
-
"@own(desktop-flex) & !@md": "none",
|
|
171
|
-
},
|
|
155
|
+
display: { "": null, "@own(desktop-flex)": "flex" },
|
|
156
|
+
hide: { "": null, "@own(desktop-flex) & !@md": true },
|
|
172
157
|
},
|
|
173
158
|
ScreenReaderOnly: {
|
|
174
159
|
$: "*",
|
|
@@ -200,19 +185,13 @@ export default function DocumentStyles() {
|
|
|
200
185
|
Link: { $: "a", color: "#accent-text" },
|
|
201
186
|
NarrowBlock: {
|
|
202
187
|
$: "*",
|
|
203
|
-
display: {
|
|
204
|
-
|
|
205
|
-
"@own(narrow)": "none",
|
|
206
|
-
"@own(narrow) & !@lg": "block",
|
|
207
|
-
},
|
|
188
|
+
display: { "": null, "@own(narrow)": "block" },
|
|
189
|
+
hide: { "": null, "@own(narrow) & @lg": true },
|
|
208
190
|
},
|
|
209
191
|
MobileBlock: {
|
|
210
192
|
$: "*",
|
|
211
|
-
display: {
|
|
212
|
-
|
|
213
|
-
"@own(mobile)": "none",
|
|
214
|
-
"@own(mobile) & !@md": "block",
|
|
215
|
-
},
|
|
193
|
+
display: { "": null, "@own(mobile)": "block" },
|
|
194
|
+
hide: { "": null, "@own(mobile) & @md": true },
|
|
216
195
|
},
|
|
217
196
|
Code: {
|
|
218
197
|
$: ":where(code), :where(kbd), :where(samp), :where(pre)",
|
|
@@ -228,7 +207,7 @@ export default function DocumentStyles() {
|
|
|
228
207
|
},
|
|
229
208
|
CurrentLink: {
|
|
230
209
|
$: "a",
|
|
231
|
-
radius: { "": null, '@own([aria-current="page"])': "
|
|
210
|
+
radius: { "": null, '@own([aria-current="page"])': "1r" },
|
|
232
211
|
},
|
|
233
212
|
SearchOpen: {
|
|
234
213
|
$: "body",
|
|
@@ -251,7 +230,7 @@ export default function DocumentStyles() {
|
|
|
251
230
|
":is(h6)": "h6",
|
|
252
231
|
},
|
|
253
232
|
textWrap: "balance",
|
|
254
|
-
"$margin-block-start": { "": null, '[id="_top"]': "
|
|
233
|
+
"$margin-block-start": { "": null, '[id="_top"]': "2x" },
|
|
255
234
|
blockMargin: "$margin-block-start $margin-block-end",
|
|
256
235
|
}),
|
|
257
236
|
);
|
|
@@ -9,20 +9,20 @@ export const FooterRoot = defineComponent("Footer", {
|
|
|
9
9
|
styles: {
|
|
10
10
|
display: "flex",
|
|
11
11
|
flow: "column",
|
|
12
|
-
gap: "
|
|
12
|
+
gap: "3x",
|
|
13
13
|
Meta: {
|
|
14
14
|
display: "flex",
|
|
15
15
|
flow: "row wrap",
|
|
16
16
|
justifyContent: "space-between",
|
|
17
|
-
gap: "
|
|
18
|
-
blockMargin: "
|
|
17
|
+
gap: "1.5x 6x",
|
|
18
|
+
blockMargin: "6x start",
|
|
19
19
|
color: "#text-muted",
|
|
20
20
|
preset: "small",
|
|
21
21
|
},
|
|
22
22
|
MetaLink: {
|
|
23
23
|
display: "flex",
|
|
24
24
|
alignItems: "center",
|
|
25
|
-
gap: "
|
|
25
|
+
gap: "1x",
|
|
26
26
|
inlineMargin: { "": "0", "@own(:only-child)": "auto start" },
|
|
27
27
|
color: { "": "#text-muted", "@own(:hover)": "#text" },
|
|
28
28
|
textDecoration: "none",
|
|
@@ -31,7 +31,7 @@ export const FooterRoot = defineComponent("Footer", {
|
|
|
31
31
|
inlineMargin: { "": "0", "@own(:only-child)": "auto start" },
|
|
32
32
|
},
|
|
33
33
|
Credit: {
|
|
34
|
-
margin: "
|
|
34
|
+
margin: "3x auto",
|
|
35
35
|
color: "#text",
|
|
36
36
|
preset: "small",
|
|
37
37
|
textAlign: "center",
|
|
@@ -24,7 +24,7 @@ export const HeaderRoot = defineComponent("Header", {
|
|
|
24
24
|
display: "flex",
|
|
25
25
|
alignItems: "center",
|
|
26
26
|
flow: "row",
|
|
27
|
-
gap: "
|
|
27
|
+
gap: "1x",
|
|
28
28
|
overflow: "hidden",
|
|
29
29
|
flexShrink: "1",
|
|
30
30
|
inlineSize: "min 0",
|
|
@@ -70,7 +70,7 @@ export const HeaderRoot = defineComponent("Header", {
|
|
|
70
70
|
flow: "row",
|
|
71
71
|
alignItems: "center",
|
|
72
72
|
justifyContent: "flex-end",
|
|
73
|
-
gap: "
|
|
73
|
+
gap: "0.5x",
|
|
74
74
|
},
|
|
75
75
|
Social: {
|
|
76
76
|
display: "flex",
|
|
@@ -13,7 +13,7 @@ export const HeaderFrameRoot = defineComponent("HeaderFrame", {
|
|
|
13
13
|
inlineSize: "100%",
|
|
14
14
|
blockSize: "$docs-nav-height",
|
|
15
15
|
padding: "0 $docs-nav-pad-x",
|
|
16
|
-
blockBorder: "
|
|
16
|
+
blockBorder: "1bw solid #border end",
|
|
17
17
|
fill: "#header",
|
|
18
18
|
"$backdrop-blur": "16px",
|
|
19
19
|
backdropFilter: "blur($backdrop-blur)",
|
|
@@ -8,7 +8,8 @@ export const HeaderLinksRoot = defineComponent("HeaderLinks", {
|
|
|
8
8
|
"data-element": "HeaderLinks",
|
|
9
9
|
styles: {
|
|
10
10
|
display: "flex",
|
|
11
|
-
flexShrink: "0",
|
|
11
|
+
flexShrink: { "": "1", "!@md": "0" },
|
|
12
|
+
inlineSize: "min 0",
|
|
12
13
|
order: { "": "0", "!@md": "2" },
|
|
13
14
|
"$popover-transition": "120ms",
|
|
14
15
|
Desktop: {
|
|
@@ -16,7 +17,8 @@ export const HeaderLinksRoot = defineComponent("HeaderLinks", {
|
|
|
16
17
|
display: "flex",
|
|
17
18
|
hide: { "": false, "!@md": true },
|
|
18
19
|
alignItems: "center",
|
|
19
|
-
gap: "
|
|
20
|
+
gap: "0.5x",
|
|
21
|
+
inlineSize: "min 0",
|
|
20
22
|
},
|
|
21
23
|
Link: {
|
|
22
24
|
$: "a",
|
|
@@ -24,8 +26,8 @@ export const HeaderLinksRoot = defineComponent("HeaderLinks", {
|
|
|
24
26
|
alignItems: "center",
|
|
25
27
|
justifyContent: "center",
|
|
26
28
|
blockSize: "min $control-height",
|
|
27
|
-
padding: "
|
|
28
|
-
radius: "
|
|
29
|
+
padding: "1x 1.25x",
|
|
30
|
+
radius: "1r",
|
|
29
31
|
color: "#text-soft",
|
|
30
32
|
fill: "#clear",
|
|
31
33
|
preset: "small / strong",
|
|
@@ -34,8 +36,15 @@ export const HeaderLinksRoot = defineComponent("HeaderLinks", {
|
|
|
34
36
|
},
|
|
35
37
|
DesktopLink: {
|
|
36
38
|
$: "Desktop a",
|
|
39
|
+
// A flex container can't truncate its text, so center a block instead.
|
|
40
|
+
display: "block",
|
|
41
|
+
alignContent: "center",
|
|
42
|
+
inlineSize: "min 0",
|
|
43
|
+
overflow: "hidden",
|
|
44
|
+
textAlign: "center",
|
|
45
|
+
textOverflow: "ellipsis",
|
|
37
46
|
radius: "$header-control-radius",
|
|
38
|
-
inlinePadding: "
|
|
47
|
+
inlinePadding: "2x",
|
|
39
48
|
},
|
|
40
49
|
HoverLink: {
|
|
41
50
|
$: "a",
|
|
@@ -78,16 +87,17 @@ export const HeaderLinksRoot = defineComponent("HeaderLinks", {
|
|
|
78
87
|
Panel: {
|
|
79
88
|
$: "Panel",
|
|
80
89
|
position: "fixed",
|
|
81
|
-
|
|
82
|
-
|
|
90
|
+
blockInset: "0.5rem start",
|
|
91
|
+
inlineInset: "$docs-nav-pad-x end",
|
|
92
|
+
inlineSize: "min(20rem, (100vw - 2 * $docs-nav-pad-x))",
|
|
83
93
|
blockSize: "max (100dvh - 1rem)",
|
|
84
94
|
overflowY: "auto",
|
|
85
95
|
margin: "0",
|
|
86
|
-
padding: "
|
|
96
|
+
padding: "1x",
|
|
87
97
|
color: "#text",
|
|
88
98
|
fill: "#surface",
|
|
89
99
|
border: true,
|
|
90
|
-
radius: "
|
|
100
|
+
radius: "1cr",
|
|
91
101
|
shadow: "0 0.75rem 2rem #shadow",
|
|
92
102
|
opacity: "0",
|
|
93
103
|
scale: "1 0.96",
|
|
@@ -100,8 +110,8 @@ export const HeaderLinksRoot = defineComponent("HeaderLinks", {
|
|
|
100
110
|
},
|
|
101
111
|
OpenPanel: {
|
|
102
112
|
$: "[data-element=Panel]",
|
|
103
|
-
opacity: { "": null, "@own(:
|
|
104
|
-
scale: { "": null, "@own(:
|
|
113
|
+
opacity: { "": null, "@own(:popover-open & [data-open])": "1" },
|
|
114
|
+
scale: { "": null, "@own(:popover-open & [data-open])": "1" },
|
|
105
115
|
},
|
|
106
116
|
PanelNavigation: {
|
|
107
117
|
$: "Panel nav",
|
|
@@ -112,7 +122,7 @@ export const HeaderLinksRoot = defineComponent("HeaderLinks", {
|
|
|
112
122
|
$: "Panel a",
|
|
113
123
|
justifyContent: "flex-start",
|
|
114
124
|
blockSize: "min $docs-menu-button-size",
|
|
115
|
-
inlinePadding: "
|
|
125
|
+
inlinePadding: "1.5x",
|
|
116
126
|
preset: "navigation",
|
|
117
127
|
textAlign: "start",
|
|
118
128
|
whiteSpace: "normal",
|
|
@@ -122,14 +132,14 @@ export const HeaderLinksRoot = defineComponent("HeaderLinks", {
|
|
|
122
132
|
$: "Panel a",
|
|
123
133
|
inlinePadding: {
|
|
124
134
|
"": null,
|
|
125
|
-
"@own(:first-child)":
|
|
126
|
-
"($gap * 1.5) start, ($docs-menu-button-size + $gap) end",
|
|
135
|
+
"@own(:first-child)": "1.5x start, ($docs-menu-button-size + 1x) end",
|
|
127
136
|
},
|
|
128
137
|
},
|
|
129
138
|
Close: {
|
|
130
139
|
$: "Close",
|
|
131
140
|
position: "absolute",
|
|
132
|
-
|
|
141
|
+
blockInset: "1x start",
|
|
142
|
+
inlineInset: "1x end",
|
|
133
143
|
display: "grid",
|
|
134
144
|
placeItems: "center",
|
|
135
145
|
inlineSize: "$docs-menu-button-size",
|
|
@@ -16,7 +16,7 @@ export const HeroRoot = defineComponent("Hero", {
|
|
|
16
16
|
gap: "clamp(2rem, 5vw, 5rem)",
|
|
17
17
|
blockPadding: {
|
|
18
18
|
"": "clamp(3rem, 8vw, 7rem) start, clamp(2rem, 6vw, 5rem) end",
|
|
19
|
-
"!@md": "
|
|
19
|
+
"!@md": "4x start, clamp(2rem, 6vw, 5rem) end",
|
|
20
20
|
},
|
|
21
21
|
Visual: {
|
|
22
22
|
$: "> img, > Visual",
|
|
@@ -34,7 +34,7 @@ export const HeroRoot = defineComponent("Hero", {
|
|
|
34
34
|
hide: {
|
|
35
35
|
"": null,
|
|
36
36
|
'@own([data-hero-image="dark"])': false,
|
|
37
|
-
'
|
|
37
|
+
'@own([data-hero-image="dark"]) & @light': true,
|
|
38
38
|
},
|
|
39
39
|
},
|
|
40
40
|
LightVisual: {
|
|
@@ -42,7 +42,7 @@ export const HeroRoot = defineComponent("Hero", {
|
|
|
42
42
|
hide: {
|
|
43
43
|
"": null,
|
|
44
44
|
'@own([data-hero-image="light"])': true,
|
|
45
|
-
'
|
|
45
|
+
'@own([data-hero-image="light"]) & @light': false,
|
|
46
46
|
},
|
|
47
47
|
},
|
|
48
48
|
Stack: {
|
|
@@ -58,7 +58,7 @@ export const HeroRoot = defineComponent("Hero", {
|
|
|
58
58
|
display: "flex",
|
|
59
59
|
flow: "column",
|
|
60
60
|
alignItems: "inherit",
|
|
61
|
-
gap: "
|
|
61
|
+
gap: "2x",
|
|
62
62
|
},
|
|
63
63
|
Title: {
|
|
64
64
|
$: "h1",
|
|
@@ -80,22 +80,22 @@ export const HeroRoot = defineComponent("Hero", {
|
|
|
80
80
|
display: "flex",
|
|
81
81
|
flow: "row wrap",
|
|
82
82
|
justifyContent: { "": "flex-start", "!@md": "center" },
|
|
83
|
-
gap: "
|
|
83
|
+
gap: "1.5x",
|
|
84
84
|
},
|
|
85
85
|
Action: {
|
|
86
86
|
$: "Action",
|
|
87
87
|
display: "inline-flex",
|
|
88
88
|
alignItems: "center",
|
|
89
89
|
blockSize: "min $control-height",
|
|
90
|
-
padding: "
|
|
91
|
-
gap: "
|
|
90
|
+
padding: "1.25x 2.5x",
|
|
91
|
+
gap: "1x",
|
|
92
92
|
color: "#text",
|
|
93
93
|
border: { "": true, "@own(minimal)": "#clear" },
|
|
94
94
|
radius: "round",
|
|
95
95
|
fill: "#surface-2",
|
|
96
96
|
preset: "navigation / strong",
|
|
97
97
|
textDecoration: "none",
|
|
98
|
-
transition: "fill
|
|
98
|
+
transition: "fill",
|
|
99
99
|
},
|
|
100
100
|
HoverAction: {
|
|
101
101
|
$: "[data-element=Action]",
|
|
@@ -13,7 +13,6 @@ export const LanguageSelectRoot = defineComponent("LanguageSelect", {
|
|
|
13
13
|
display: "flex",
|
|
14
14
|
flexShrink: "0",
|
|
15
15
|
// Shared selector defaults are resolved once during server-side module evaluation.
|
|
16
|
-
// eslint-disable-next-line tasty/no-runtime-styles-mutation
|
|
17
16
|
"$popover-transition": languageSelectStyles["$popover-transition"],
|
|
18
17
|
Trigger: {
|
|
19
18
|
// Reuse the shared, server-only popover anatomy.
|
|
@@ -21,10 +20,10 @@ export const LanguageSelectRoot = defineComponent("LanguageSelect", {
|
|
|
21
20
|
...languageSelectStyles.Trigger,
|
|
22
21
|
inlineSize: "8rem",
|
|
23
22
|
blockSize: "$control-height",
|
|
24
|
-
padding: "0
|
|
23
|
+
padding: "0 1x",
|
|
25
24
|
fill: "#clear",
|
|
26
25
|
border: "0",
|
|
27
|
-
transition: "color
|
|
26
|
+
transition: "color, fill",
|
|
28
27
|
},
|
|
29
28
|
HoverTrigger: {
|
|
30
29
|
// Reuse the shared, server-only popover anatomy.
|
|
@@ -106,14 +105,14 @@ export const LanguageSelectRoot = defineComponent("LanguageSelect", {
|
|
|
106
105
|
"": null,
|
|
107
106
|
"[data-sidebar]": "auto start, anchor(top) end",
|
|
108
107
|
},
|
|
109
|
-
blockMargin: { "": null, "[data-sidebar]": "
|
|
108
|
+
blockMargin: { "": null, "[data-sidebar]": "1x end" },
|
|
110
109
|
inlineInset: {
|
|
111
110
|
"": null,
|
|
112
|
-
"[data-sidebar]": "
|
|
111
|
+
"[data-sidebar]": "1x start, auto end",
|
|
113
112
|
},
|
|
114
113
|
inlineSize: {
|
|
115
114
|
"": null,
|
|
116
|
-
"[data-sidebar]": "min(20rem,
|
|
115
|
+
"[data-sidebar]": "min(20rem, (100vw - 4rem))",
|
|
117
116
|
},
|
|
118
117
|
blockSize: {
|
|
119
118
|
"": null,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { TASTY_SPACING_PROPERTIES } from "../theme/tasty-config.js";
|
|
2
1
|
import { configureCookbookStates } from "./tasty-states.js";
|
|
3
2
|
import { defineComponent } from "../define-component.js";
|
|
4
3
|
|
|
@@ -8,8 +7,7 @@ export const MainContentRoot = defineComponent("MainContent", {
|
|
|
8
7
|
as: "main",
|
|
9
8
|
"data-element": "MainContent",
|
|
10
9
|
styles: {
|
|
11
|
-
"
|
|
12
|
-
padding: "0 0 5rem",
|
|
10
|
+
padding: "5rem bottom",
|
|
13
11
|
// A focus target for the skip link and page swaps, not a control. Clicking
|
|
14
12
|
// its text focuses it, so keyboard scrolling would otherwise show a ring.
|
|
15
13
|
outline: "none",
|
|
@@ -17,7 +15,7 @@ export const MainContentRoot = defineComponent("MainContent", {
|
|
|
17
15
|
ContentSpacing: {
|
|
18
16
|
$: ":where(Panel > Container) > * + *",
|
|
19
17
|
blockMargin: "$margin-block-start $margin-block-end",
|
|
20
|
-
"$margin-block-start": "
|
|
18
|
+
"$margin-block-start": "3x",
|
|
21
19
|
},
|
|
22
20
|
Container: {
|
|
23
21
|
$: "Panel > Container",
|
|
@@ -27,12 +25,12 @@ export const MainContentRoot = defineComponent("MainContent", {
|
|
|
27
25
|
Panel: {
|
|
28
26
|
$: "Panel",
|
|
29
27
|
"$padding-block-start": {
|
|
30
|
-
"": "
|
|
31
|
-
"@own(:nth-of-type(2))": "
|
|
28
|
+
"": "3x",
|
|
29
|
+
"@own(:nth-of-type(2))": "2x",
|
|
32
30
|
},
|
|
33
31
|
"$padding-block-end": {
|
|
34
|
-
"": "
|
|
35
|
-
"@own(:first-of-type)": "
|
|
32
|
+
"": "3x",
|
|
33
|
+
"@own(:first-of-type)": "2x",
|
|
36
34
|
},
|
|
37
35
|
blockPadding: "$padding-block-start $padding-block-end",
|
|
38
36
|
inlinePadding: "$docs-content-pad-x",
|
|
@@ -12,8 +12,8 @@ export const MainPaneRoot = defineComponent("MainPane", {
|
|
|
12
12
|
inlineSize: {
|
|
13
13
|
"": "0 100% initial",
|
|
14
14
|
"[data-has-sidebar] & [data-has-toc]":
|
|
15
|
-
"min(
|
|
16
|
-
"
|
|
15
|
+
"min((100% - $sidebar-width), ($content-width + (100% - $content-width - $sidebar-width) / 2))",
|
|
16
|
+
"[data-has-sidebar] & [data-has-toc] & !@lg": "100%",
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
19
|
});
|