@xingwangzhe/stalux 1.35.16 → 1.36.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 +5 -1
- package/package.json +1 -1
- package/src/config.ts +1 -1
- package/src/expressive-code.ts +7 -1
- package/src/index.ts +4 -2
- package/src/plugins/image-captions.ts +117 -0
- package/src/styles/content.css +8 -0
- package/src/styles/generated-prose.css +1 -1
package/README.md
CHANGED
|
@@ -14,6 +14,10 @@ All HTML routes include a circular back-to-top button in the footer. It appears
|
|
|
14
14
|
|
|
15
15
|
The homepage typewriter is built into Stalux and continues to use the `items` string list in `stalux/config/typetexts.yml`, with no new configuration. Defaults are 100ms per typed grapheme, 33ms per deleted grapheme, a 1500ms hold, and a 500ms pause after deletion. It pauses outside the viewport or in background tabs and cleans up on soft navigation. Reduced motion displays whole messages without a blinking cursor. Without JavaScript, the first message remains visible; screen readers and print receive the complete list.
|
|
16
16
|
|
|
17
|
+
Standalone images written as `` receive a `figure` and `figcaption` through a build-time satteri HAST plugin. Captions appear as small, centered gray text below the image, preserving image alt text and the PhotoSwipe lightbox. No configuration or browser script is required. Empty descriptions, inline images, multiple images in one paragraph, and existing figures are left unchanged. Captions are plain text with automatic escaping.
|
|
18
|
+
|
|
19
|
+
Code blocks default to the single `dark-plus` theme, with system color-scheme switching and theme selectors disabled. To opt into another theme or switching behavior, explicitly override `themes`, `useDarkModeMediaQuery`, and `themeCssSelector` through `expressiveCode`. This only changes generated code styles and adds no telemetry.
|
|
20
|
+
|
|
17
21
|
---
|
|
18
22
|
|
|
19
23
|
## 🚀 Quick Start
|
|
@@ -57,7 +61,7 @@ integrations: [
|
|
|
57
61
|
stalux({
|
|
58
62
|
contentDir: "stalux",
|
|
59
63
|
sitemap: { filter: (page) => page.startsWith("https://example.com/posts/") },
|
|
60
|
-
expressiveCode: { themes: ["dark-plus",
|
|
64
|
+
expressiveCode: { themes: ["dark-plus"], useDarkModeMediaQuery: false },
|
|
61
65
|
}),
|
|
62
66
|
];
|
|
63
67
|
```
|
package/package.json
CHANGED
package/src/config.ts
CHANGED
|
@@ -66,7 +66,7 @@ export interface StaluxOptions {
|
|
|
66
66
|
sitemap?: boolean | SitemapOptions;
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
|
-
* 是否自动打包 Expressive Code(默认 true
|
|
69
|
+
* 是否自动打包 Expressive Code(默认 true,带代码块行号插件,固定 dark-plus 暗色主题)。
|
|
70
70
|
* 传 false 关闭;传对象自定义主题/样式等选项。
|
|
71
71
|
*/
|
|
72
72
|
expressiveCode?: boolean | ExpressiveCodeOptions;
|
package/src/expressive-code.ts
CHANGED
|
@@ -26,7 +26,13 @@ export type ExpressiveCodeOptions = NonNullable<Parameters<typeof expressiveCode
|
|
|
26
26
|
*/
|
|
27
27
|
export function expressiveCode(options: ExpressiveCodeOptions = {}) {
|
|
28
28
|
const plugins = [pluginLineNumbers(), ...(options.plugins ?? []), codeContainmentPlugin()];
|
|
29
|
-
return expressiveCodeBase({
|
|
29
|
+
return expressiveCodeBase({
|
|
30
|
+
themes: ["dark-plus"],
|
|
31
|
+
useDarkModeMediaQuery: false,
|
|
32
|
+
themeCssSelector: false,
|
|
33
|
+
...options,
|
|
34
|
+
plugins,
|
|
35
|
+
});
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
/** @alias Public default-import form of the named integration export. */
|
package/src/index.ts
CHANGED
|
@@ -57,6 +57,7 @@ import { searchStylePlugin } from "./internal/search-style";
|
|
|
57
57
|
import { createViteAliases } from "./internal/vite-aliases";
|
|
58
58
|
import { webMcpMutationsPlugin } from "./internal/webmcp-mutations";
|
|
59
59
|
import { featureFlagsHast, featureFlagsMdast } from "./plugins/feature-flags";
|
|
60
|
+
import { imageCaptions } from "./plugins/image-captions";
|
|
60
61
|
import { temml } from "./plugins/satteri-temml";
|
|
61
62
|
import { describeError } from "./utils/diagnostics";
|
|
62
63
|
|
|
@@ -225,7 +226,7 @@ export function stalux(options: StaluxOptions = {}): AstroIntegration[] {
|
|
|
225
226
|
// 消费方即使完全不配置 processor,这里也会对默认 processor 的 options 做幂等合并:
|
|
226
227
|
// - features:默认开启 math / frontmatter / gfm / smartPunctuation(用户显式 false 则尊重)
|
|
227
228
|
// - mdastPlugins:mermaidMdast + temml(数学公式)+ featureFlagsMdast(字数统计)
|
|
228
|
-
// - hastPlugins:photoswipe(图片灯箱)+ mermaidHast + featureFlagsHast
|
|
229
|
+
// - hastPlugins:photoswipe(图片灯箱)+ imageCaptions(图注)+ mermaidHast + featureFlagsHast
|
|
229
230
|
// 去重是必须的:重复注册 Mermaid 或 featureFlagsMdast 会导致渲染异常或字数统计翻倍。
|
|
230
231
|
try {
|
|
231
232
|
const processorOptions = prepareSatteriProcessor(config.markdown?.processor);
|
|
@@ -249,9 +250,10 @@ export function stalux(options: StaluxOptions = {}): AstroIntegration[] {
|
|
|
249
250
|
seen,
|
|
250
251
|
);
|
|
251
252
|
appendUniquePlugin(processorOptions.hastPlugins, photoswipe(), seen);
|
|
253
|
+
appendUniquePlugin(processorOptions.hastPlugins, imageCaptions, seen);
|
|
252
254
|
appendUniquePlugin(processorOptions.hastPlugins, featureFlagsHast, seen);
|
|
253
255
|
markdownLogger.debug(
|
|
254
|
-
"injected satteri plugins (mermaid/temml/photoswipe/feature-flags)",
|
|
256
|
+
"injected satteri plugins (mermaid/temml/photoswipe/image-captions/feature-flags)",
|
|
255
257
|
);
|
|
256
258
|
} else {
|
|
257
259
|
markdownLogger.warn(
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { parseFragment } from "parse5";
|
|
2
|
+
import { defineHastPlugin, type HastNode } from "satteri";
|
|
3
|
+
|
|
4
|
+
declare module "satteri" {
|
|
5
|
+
interface DataMap {
|
|
6
|
+
staluxCaptionExclusions?: Set<number>;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
type Element = Extract<HastNode, { type: "element" }>;
|
|
11
|
+
|
|
12
|
+
function onlyElement(node: Element): Element | undefined {
|
|
13
|
+
const children = node.children.filter(
|
|
14
|
+
(child) => child.type !== "text" || child.value.trim().length > 0,
|
|
15
|
+
);
|
|
16
|
+
return children.length === 1 && children[0]?.type === "element" ? children[0] : undefined;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Raw HTML wrappers remain sibling raw nodes in Markdown HAST. Parse a small
|
|
20
|
+
// structural shell to recognize paragraphs inside those wrappers as well.
|
|
21
|
+
function rawExclusions(root: Readonly<HastNode>): Set<number> {
|
|
22
|
+
const excluded = new Set<number>();
|
|
23
|
+
function scan(node: Readonly<HastNode>) {
|
|
24
|
+
if (!("children" in node)) return;
|
|
25
|
+
const children = node.children;
|
|
26
|
+
if (children.some((child) => child.type === "raw")) {
|
|
27
|
+
const shell = children
|
|
28
|
+
.map((child, index) =>
|
|
29
|
+
child.type === "raw"
|
|
30
|
+
? child.value
|
|
31
|
+
: `<span data-caption-index="${index}"></span>`,
|
|
32
|
+
)
|
|
33
|
+
.join("\n");
|
|
34
|
+
const fragment = parseFragment(shell);
|
|
35
|
+
function visit(
|
|
36
|
+
current: typeof fragment | (typeof fragment.childNodes)[number],
|
|
37
|
+
protectedParent = false,
|
|
38
|
+
) {
|
|
39
|
+
const protectedNode =
|
|
40
|
+
protectedParent ||
|
|
41
|
+
("tagName" in current &&
|
|
42
|
+
["figure", "figcaption", "pre", "code", "template"].includes(
|
|
43
|
+
current.tagName,
|
|
44
|
+
));
|
|
45
|
+
if (protectedNode && "attrs" in current) {
|
|
46
|
+
const index = current.attrs.find((attr) => attr.name === "data-caption-index");
|
|
47
|
+
const child = index ? children[Number(index.value)] : undefined;
|
|
48
|
+
const offset = child?.position?.start.offset;
|
|
49
|
+
if (offset !== undefined) excluded.add(offset);
|
|
50
|
+
}
|
|
51
|
+
if ("childNodes" in current)
|
|
52
|
+
for (const child of current.childNodes) visit(child, protectedNode);
|
|
53
|
+
if ("content" in current) visit(current.content, protectedNode);
|
|
54
|
+
}
|
|
55
|
+
visit(fragment);
|
|
56
|
+
}
|
|
57
|
+
for (const child of children) scan(child);
|
|
58
|
+
}
|
|
59
|
+
scan(root);
|
|
60
|
+
return excluded;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Runs after PhotoSwipe so its link and all image properties remain intact. */
|
|
64
|
+
export const imageCaptions = defineHastPlugin({
|
|
65
|
+
name: "stalux-image-captions",
|
|
66
|
+
options: { position: true },
|
|
67
|
+
before(root, ctx) {
|
|
68
|
+
ctx.data.staluxCaptionExclusions = rawExclusions(root);
|
|
69
|
+
},
|
|
70
|
+
after(_root, ctx) {
|
|
71
|
+
delete ctx.data.staluxCaptionExclusions;
|
|
72
|
+
},
|
|
73
|
+
element: {
|
|
74
|
+
filter: ["p"],
|
|
75
|
+
visit(node, ctx) {
|
|
76
|
+
const offset = node.position?.start.offset;
|
|
77
|
+
if (offset !== undefined && ctx.data.staluxCaptionExclusions?.has(offset)) return;
|
|
78
|
+
for (
|
|
79
|
+
let parent: Readonly<HastNode> | undefined = ctx.parent(node);
|
|
80
|
+
parent;
|
|
81
|
+
parent = ctx.parent(parent)
|
|
82
|
+
) {
|
|
83
|
+
if (
|
|
84
|
+
parent.type === "element" &&
|
|
85
|
+
["figure", "figcaption", "pre", "code", "template"].includes(parent.tagName)
|
|
86
|
+
) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const content = onlyElement(node);
|
|
92
|
+
if (!content) return;
|
|
93
|
+
const image = content.tagName === "a" ? onlyElement(content) : content;
|
|
94
|
+
if (image?.tagName !== "img") return;
|
|
95
|
+
const caption = String(image.properties.alt ?? "").trim();
|
|
96
|
+
if (!caption) return;
|
|
97
|
+
|
|
98
|
+
ctx.replaceNode(node, {
|
|
99
|
+
type: "element",
|
|
100
|
+
tagName: "figure",
|
|
101
|
+
properties: {
|
|
102
|
+
...node.properties,
|
|
103
|
+
"data-stalux-image": "",
|
|
104
|
+
},
|
|
105
|
+
children: [
|
|
106
|
+
content,
|
|
107
|
+
{
|
|
108
|
+
type: "element",
|
|
109
|
+
tagName: "figcaption",
|
|
110
|
+
properties: {},
|
|
111
|
+
children: [{ type: "text", value: caption }],
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
});
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
});
|
package/src/styles/content.css
CHANGED
|
@@ -371,6 +371,14 @@
|
|
|
371
371
|
margin-top: 0.5rem;
|
|
372
372
|
}
|
|
373
373
|
|
|
374
|
+
.stalux-prose figure[data-stalux-image] > figcaption {
|
|
375
|
+
font-style: normal;
|
|
376
|
+
font-size: 0.85rem;
|
|
377
|
+
line-height: 1.6;
|
|
378
|
+
color: var(--muted-text);
|
|
379
|
+
overflow-wrap: anywhere;
|
|
380
|
+
}
|
|
381
|
+
|
|
374
382
|
.stalux-prose .footnotes {
|
|
375
383
|
font-size: 0.88em;
|
|
376
384
|
color: var(--white-75p);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@layer theme,base;@layer components{.stalux-prose{font-family:var(--font-body), "Noto Sans SC", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;font-size:var(--font-size-base);color:var(--white-85p);text-rendering:optimizelegibility;line-height:1.75}.stalux-prose h1,.stalux-prose h2,.stalux-prose h3,.stalux-prose h4,.stalux-prose h5,.stalux-prose h6{color:var(--white-full);margin-top:var(--space-xl);margin-bottom:var(--space-md);font-weight:600;line-height:1.3}.stalux-prose h1{margin-top:2.5rem;margin-bottom:var(--space-lg);border-bottom:3px solid var(--accent-50p);padding-bottom:.6rem;font-size:2.6rem;font-weight:700;line-height:1.25}.stalux-prose h2{border-bottom:2px solid var(--accent-30p);margin-top:2.5rem;padding-bottom:.4rem;font-size:2rem;font-weight:650}.stalux-prose h3{color:var(--white-95p);margin-top:2rem;font-size:1.5rem;line-height:1.4}.stalux-prose h4{color:var(--white-90p);margin-top:1.5rem;margin-bottom:.6rem;font-size:1.25rem;line-height:1.45}.stalux-prose h5{color:var(--white-90p);margin-top:1.5rem;margin-bottom:.5rem;font-size:1.1rem;line-height:1.5}.stalux-prose h6{color:var(--white-80p);margin-top:1.5rem;margin-bottom:.5rem;font-size:1rem;line-height:1.5}.stalux-prose p{margin:0 0 var(--space-lg);line-height:1.75}.stalux-prose strong{color:#ffd966;font-weight:600}.stalux-prose em{color:var(--white-85p);font-style:italic}.stalux-prose strong em,.stalux-prose em strong{color:#ffd966}.stalux-prose del{color:var(--white-60p)}.stalux-prose mark{color:inherit;background-color:#ffd96640;border-radius:2px;padding:.1em .2em}.stalux-prose kbd{font-family:var(--font-code), "JetBrains Mono", "Fira Code", "Consolas", "Courier New", monospace;background-color:var(--white-10p);border:1px solid var(--white-20p);color:var(--white-85p);border-radius:4px;padding:.15em .4em;font-size:.85em}.stalux-prose sup,.stalux-prose sub{font-size:.8em}.stalux-prose a{color:var(--accent-80p);transition:color var(--transition-fast), border-bottom-color var(--transition-fast);overflow-wrap:anywhere;border-bottom:2px solid #0000;text-decoration:none}.stalux-prose a:focus-visible{color:var(--accent-90p);border-bottom-color:var(--accent-60p)}@media (hover:hover) and (pointer:fine){.stalux-prose a:hover{color:var(--accent-90p);border-bottom-color:var(--accent-60p)}}.stalux-prose code{font-family:var(--font-code), "JetBrains Mono", "Fira Code", "Consolas", "Courier New", monospace;color:#ff92d0;background-color:#ff79c626;border:1px solid #ff79c640;border-radius:4px;padding:.2em .4em;font-size:.88em}.stalux-prose pre{background:var(--black-30p);color:var(--white-85p);border-left:4px solid var(--accent-60p);margin:var(--space-xl) 0;font-size:.92em;line-height:1.65;font-family:var(--font-code), "JetBrains Mono", "Fira Code", "Consolas", "Courier New", monospace;box-shadow:var(--shadow-md);border-radius:8px;padding:1.2rem 1.5rem;overflow-x:auto}.stalux-prose pre code{color:inherit;font-size:inherit;background:0 0;border:none;padding:0;font-family:inherit}.expressive-code pre,.expressive-code code{all:revert}.stalux-prose ul,.stalux-prose ol{margin:0 0 var(--space-lg);padding-left:1.75rem}.stalux-prose li{color:var(--white-85p);margin:.4rem 0;line-height:1.75}.stalux-prose ul li{list-style:outside}.stalux-prose ul li ul li{list-style:circle}.stalux-prose ul li ul li ul li{list-style:square}.stalux-prose ol li{list-style:decimal}.stalux-prose ol li ol li{list-style:lower-alpha}.stalux-prose li>ul,.stalux-prose li>ol{margin-top:.3rem;margin-bottom:.3rem}.stalux-prose blockquote{margin:var(--space-xl) 0;border-left:4px solid var(--accent-60p);background:var(--surface-glass);border-top:1px solid var(--white-10p);border-right:1px solid var(--white-10p);border-bottom:1px solid var(--white-10p);color:var(--white-85p);border-radius:12px;padding:1rem 1.5rem;box-shadow:0 4px 16px #0002}.stalux-prose blockquote p{margin:0;line-height:1.7}.stalux-prose blockquote p+p{margin-top:.8rem}.stalux-prose blockquote strong{color:#ffd966}.stalux-prose blockquote code{font-size:.85em}.stalux-prose table{border-collapse:collapse;width:100%;margin:var(--space-xl) 0;box-shadow:var(--shadow-md);border-radius:8px;display:block;overflow:auto hidden}.stalux-prose th,.stalux-prose td{text-align:left;border-bottom:1px solid var(--white-10p);padding:.75rem 1rem;line-height:1.6}.stalux-prose th{white-space:nowrap;background:var(--accent-30p);color:var(--white-full);font-size:.95em;font-weight:600}.stalux-prose td{color:var(--white-85p)}.stalux-prose tr:nth-child(2n) td{background-color:var(--white-05p)}@media (hover:hover) and (pointer:fine){.stalux-prose tr:hover td{background-color:var(--black-10p)}}.stalux-prose table code{font-size:.85em}.stalux-prose img{max-width:100%;height:auto;margin:var(--space-xl) auto;box-shadow:var(--shadow-lg);transition:transform var(--transition-normal), box-shadow var(--transition-normal);border-radius:8px;display:block}@media (hover:hover) and (pointer:fine){.stalux-prose img:hover{box-shadow:var(--shadow-xl);transform:none}}.stalux-prose embed,.stalux-prose video{max-width:100%;height:auto;margin:var(--space-xl) auto;border-radius:8px;display:block}.stalux-prose hr{margin:var(--space-2xl) 0;background:linear-gradient(90deg, transparent, var(--white-15p) 20%, var(--accent-40p) 50%, var(--white-15p) 80%, transparent);border:none;height:1.5px}.stalux-prose details{margin:var(--space-lg) 0;background-color:var(--white-05p);border:1px solid var(--white-10p);transition:border-color var(--transition-fast);border-radius:6px;padding:.8rem 1rem}@media (hover:hover) and (pointer:fine){.stalux-prose details:hover{border-color:var(--white-20p)}}.stalux-prose summary{cursor:pointer;color:var(--white-90p);font-weight:600}.stalux-prose details[open] summary{border-bottom:1px solid var(--white-10p);margin-bottom:.8rem;padding-bottom:.6rem}.stalux-prose figure{text-align:center;margin:var(--space-xl) 0}.stalux-prose figcaption{color:var(--white-70p);margin-top:.5rem;font-size:.9em;font-style:italic}.stalux-prose .footnotes{color:var(--white-75p);border-top:1px solid var(--white-15p);margin-top:var(--space-2xl);padding-top:var(--space-lg);font-size:.88em}.stalux-prose .footnotes ol{margin-left:1rem;padding-left:.5rem}.stalux-prose .footnotes li{margin:.5rem 0;line-height:1.6}.stalux-prose .footnotes a{font-size:.9em}@media (width<=1024px){.stalux-prose{font-size:1.05rem}.stalux-prose h1{font-size:2.2rem}.stalux-prose h2{font-size:1.8rem}.stalux-prose h3{font-size:1.35rem}.stalux-prose h4{font-size:1.15rem}.stalux-prose pre{padding:1rem 1.2rem;font-size:.88em}}@media (width<=768px){.stalux-prose{font-size:1rem;line-height:1.7}.stalux-prose h1{margin-top:1.5rem;font-size:1.8rem}.stalux-prose h2{margin-top:1.5rem;font-size:1.4rem}.stalux-prose h3{margin-top:1.25rem;font-size:1.2rem}.stalux-prose h4{margin-top:1rem;font-size:1.1rem}.stalux-prose h5{font-size:1rem}.stalux-prose h6{font-size:.95rem}.stalux-prose p{margin-bottom:var(--space-md)}.stalux-prose pre{margin:var(--space-lg) 0;border-left-width:3px;padding:.8rem 1rem;font-size:.82em}.stalux-prose table{font-size:.85rem}.stalux-prose th,.stalux-prose td{padding:.5rem .7rem}.stalux-prose blockquote{padding:.8rem 1rem;font-size:.9em}.stalux-prose ul,.stalux-prose ol{padding-left:1.5rem}}.stalux-prose,.stalux-prose>*,.stalux-prose div,.stalux-prose .expressive-code,.stalux-prose .expressive-code .frame{box-sizing:border-box;min-width:0;max-width:100%}.stalux-prose{overflow-wrap:anywhere}.stalux-prose a:after{content:none}.stalux-prose a{text-decoration:underline;text-decoration-color:var(--accent-50p);text-underline-offset:.2em;border-bottom:0;text-decoration-thickness:1px}.stalux-prose a:has(img){text-decoration:none}.stalux-prose pre,.stalux-prose table,.stalux-prose .mermaid,.stalux-prose math{overscroll-behavior-x:contain;max-width:100%;overflow-x:auto}.stalux-prose pre,.stalux-prose pre code{overflow-wrap:normal;word-break:normal}.stalux-prose :is(img,video,iframe,embed,svg,canvas){max-width:100%}.stalux-prose :is(img,video,svg,canvas){height:auto}.stalux-prose iframe{margin:var(--space-xl) auto;border-radius:8px;display:block}.stalux-prose .mermaid svg{max-width:none}.stalux-prose canvas{box-sizing:border-box}.stalux-prose summary{overflow-wrap:anywhere}}@layer utilities;@font-face{font-family:Stalux Math Aux;src:url(/fonts/StaluxMathAux.woff2)format("woff2");font-weight:400;font-style:normal}@font-face{font-family:Latin Modern Math;src:url(/fonts/latinmodern-math.woff2)format("woff2");font-display:swap}math{font-size-adjust:none;text-indent:0;text-transform:none;letter-spacing:normal;word-wrap:normal;font-feature-settings:"dtls" off;font-style:normal;font-weight:400;line-height:normal;font-family:"Latin Modern Math", var(--font-body), math;direction:ltr}math *{border-color:currentColor}math.tml-display{width:100%;display:block}.mathscr{font-family:Stalux Math Aux,serif}mfrac>:nth-child(2),msqrt,mover>:first-child{math-shift:compact}.menclose{padding:.5ex 0;display:inline-block;position:relative}.tml-cancelto{background-color:currentColor;padding:.5ex 0;display:inline-block;position:absolute;top:0;left:0;-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><defs><marker id='a' markerHeight='5' markerUnits='strokeWidth' markerWidth='7' orient='auto' refX='7' refY='2.5'><path fill='black' d='m0 0 7 2.5L0 5z'/></marker></defs><line x2='100%25' y1='100%25' stroke='black' stroke-width='.06em' marker-end='url(%23a)' vector-effect='non-scaling-stroke'/></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><defs><marker id='a' markerHeight='5' markerUnits='strokeWidth' markerWidth='7' orient='auto' refX='7' refY='2.5'><path fill='black' d='m0 0 7 2.5L0 5z'/></marker></defs><line x2='100%25' y1='100%25' stroke='black' stroke-width='.06em' marker-end='url(%23a)' vector-effect='non-scaling-stroke'/></svg>");-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-size:100% 100%;mask-size:100% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}@-moz-document url-prefix(){math{display:inline}math>mrow{padding:0}mtd,mtable.tml-small mtd{padding-top:0;padding-bottom:0}mtable.tml-jot mtd{padding-top:.2ex;padding-bottom:0}.tml-vec{transform:scale(.75)}.ff-narrow{width:0}.ff-nudge-left{margin-left:-.2em}.ff-squash mtd{height:0;display:block}}@supports not ((-moz-appearance:none)){mo.tml-prime{font-family:Stalux Math Aux,serif}.tml-sml-pad{padding-left:.05em}.tml-med-pad{padding-left:.1em}.tml-lrg-pad{padding-left:.15em}}@supports ((-webkit-backdrop-filter:blur(1px))){.wbk-acc{transform:translateY(.431em)}.wbk-sml{transform:translate(.07em)}.wbk-sml-acc{transform:translate(.07em,.431em)}.wbk-sml-vec{transform:scale(.75)translate(.07em)}.wbk-med{transform:translate(.14em)}.wbk-med-acc{transform:translate(.14em,.431em)}.wbk-med-vec{transform:scale(.75)translate(.14em)}.wbk-lrg{transform:translate(.21em)}.wbk-lrg-acc{transform:translate(.21em,.431em)}.wbk-lrg-vec{transform:scale(.75)translate(.21em)}}@supports (not ((-webkit-backdrop-filter:blur(1px)))) and (not ((-moz-appearance:none))){.chr-sml{transform:translate(.07em)}.chr-sml-vec{transform:scale(.75)translate(.07em)}.chr-med{transform:translate(.14em)}.chr-med-vec{transform:scale(.75)translate(.14em)}.chr-lrg{transform:translate(.21em)}.chr-lrg-vec{transform:scale(.75)translate(.21em)}.tml-shift-left{margin-left:-100%}menclose{padding:.5ex 0;position:relative}.tml-overline{border-top:.065em solid;padding:.1em 0 0}.tml-underline{border-bottom:.065em solid;padding:0 0 .1em}.tml-cancel{background-color:currentColor;width:100%;height:100%;display:inline-block;position:absolute;bottom:0;left:.5px}.upstrike{clip-path:polygon(.05em 100%,0 calc(100% - .05em),calc(100% - .05em) 0,100% .05em)}.downstrike{clip-path:polygon(0 .05em,.05em 0,100% calc(100% - .05em),calc(100% - .05em) 100%)}.sout{clip-path:polygon(0 calc(55% + .0333em),0 calc(55% - .0333em),100% calc(55% - .0333em),100% calc(55% + .0333em))}.tml-xcancel{clip-path:polygon(.05em 0,0 .05em,calc(50% - .05em) 50%,0 calc(100% - .05em),.05em 100%,50% calc(50% + .05em),calc(100% - .05em) 100%,100% calc(100% - .05em),calc(50% + .05em) 50%,100% .05em,calc(100% - .05em) 0%,50% calc(50% - .05em))}.longdiv-top{border-top:.067em solid;padding:.1em .2em .2em .433em}.longdiv-arc{clip-path:inset(0 0 0 .4em);box-sizing:border-box;border:.067em solid;border-radius:70%;width:.7em;position:absolute;top:0;bottom:.1em;left:-.4em;transform:translateY(-.067em)}.menclose{text-align:left;display:inline-block;position:relative}.phasor-bottom{border-bottom:.067em solid;padding:.2em .2em .1em .6em}.phasor-angle{aspect-ratio:.5;clip-path:polygon(.05em 100%,0 calc(100% - .05em),calc(100% - .05em) 0,100% .05em);background-color:currentColor;height:100%;display:inline-block;position:absolute;bottom:-.04em;left:.5px}.tml-fbox{border:1px solid;padding:3pt}.circle-pad{padding:.267em}.textcircle{border:.067em solid;border-radius:50%;position:absolute;inset:0}.actuarial{border-style:solid;border-width:.08em .08em 0 0;margin-right:.03889em;padding:.03889em .03889em 0}.tml-crooked-2{transform:scale(2,1.1)}.tml-crooked-3{transform:scale(3,1.3)}.tml-crooked-4{transform:scale(4,1.4)}.tml-right{text-align:-webkit-right}.tml-left{text-align:-webkit-left}}menclose{-webkit-print-color-adjust:exact;print-color-adjust:exact}.tml-right{text-align:right}.tml-left{text-align:left}.special-fraction{font-family:Times New Roman,Times,STIX TWO,Tinos,serif}math{flex-wrap:wrap;align-items:baseline;display:inline-flex}math>mrow{padding:.5ex 0}mtable.tml-jot mtd{padding-top:.7ex;padding-bottom:.7ex}mtable.tml-small mtd{padding-top:.35ex;padding-bottom:.35ex}.tml-shift-left{margin-left:-200%}.tml-eqn:before{counter-increment:tmlEqnNo;content:"(" counter(tmlEqnNo) ")"}body{counter-reset:tmlEqnNo}
|
|
1
|
+
@layer theme,base;@layer components{.stalux-prose{font-family:var(--font-body), "Noto Sans SC", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;font-size:var(--font-size-base);color:var(--white-85p);text-rendering:optimizelegibility;line-height:1.75}.stalux-prose h1,.stalux-prose h2,.stalux-prose h3,.stalux-prose h4,.stalux-prose h5,.stalux-prose h6{color:var(--white-full);margin-top:var(--space-xl);margin-bottom:var(--space-md);font-weight:600;line-height:1.3}.stalux-prose h1{margin-top:2.5rem;margin-bottom:var(--space-lg);border-bottom:3px solid var(--accent-50p);padding-bottom:.6rem;font-size:2.6rem;font-weight:700;line-height:1.25}.stalux-prose h2{border-bottom:2px solid var(--accent-30p);margin-top:2.5rem;padding-bottom:.4rem;font-size:2rem;font-weight:650}.stalux-prose h3{color:var(--white-95p);margin-top:2rem;font-size:1.5rem;line-height:1.4}.stalux-prose h4{color:var(--white-90p);margin-top:1.5rem;margin-bottom:.6rem;font-size:1.25rem;line-height:1.45}.stalux-prose h5{color:var(--white-90p);margin-top:1.5rem;margin-bottom:.5rem;font-size:1.1rem;line-height:1.5}.stalux-prose h6{color:var(--white-80p);margin-top:1.5rem;margin-bottom:.5rem;font-size:1rem;line-height:1.5}.stalux-prose p{margin:0 0 var(--space-lg);line-height:1.75}.stalux-prose strong{color:#ffd966;font-weight:600}.stalux-prose em{color:var(--white-85p);font-style:italic}.stalux-prose strong em,.stalux-prose em strong{color:#ffd966}.stalux-prose del{color:var(--white-60p)}.stalux-prose mark{color:inherit;background-color:#ffd96640;border-radius:2px;padding:.1em .2em}.stalux-prose kbd{font-family:var(--font-code), "JetBrains Mono", "Fira Code", "Consolas", "Courier New", monospace;background-color:var(--white-10p);border:1px solid var(--white-20p);color:var(--white-85p);border-radius:4px;padding:.15em .4em;font-size:.85em}.stalux-prose sup,.stalux-prose sub{font-size:.8em}.stalux-prose a{color:var(--accent-80p);transition:color var(--transition-fast), border-bottom-color var(--transition-fast);overflow-wrap:anywhere;border-bottom:2px solid #0000;text-decoration:none}.stalux-prose a:focus-visible{color:var(--accent-90p);border-bottom-color:var(--accent-60p)}@media (hover:hover) and (pointer:fine){.stalux-prose a:hover{color:var(--accent-90p);border-bottom-color:var(--accent-60p)}}.stalux-prose code{font-family:var(--font-code), "JetBrains Mono", "Fira Code", "Consolas", "Courier New", monospace;color:#ff92d0;background-color:#ff79c626;border:1px solid #ff79c640;border-radius:4px;padding:.2em .4em;font-size:.88em}.stalux-prose pre{background:var(--black-30p);color:var(--white-85p);border-left:4px solid var(--accent-60p);margin:var(--space-xl) 0;font-size:.92em;line-height:1.65;font-family:var(--font-code), "JetBrains Mono", "Fira Code", "Consolas", "Courier New", monospace;box-shadow:var(--shadow-md);border-radius:8px;padding:1.2rem 1.5rem;overflow-x:auto}.stalux-prose pre code{color:inherit;font-size:inherit;background:0 0;border:none;padding:0;font-family:inherit}.expressive-code pre,.expressive-code code{all:revert}.stalux-prose ul,.stalux-prose ol{margin:0 0 var(--space-lg);padding-left:1.75rem}.stalux-prose li{color:var(--white-85p);margin:.4rem 0;line-height:1.75}.stalux-prose ul li{list-style:outside}.stalux-prose ul li ul li{list-style:circle}.stalux-prose ul li ul li ul li{list-style:square}.stalux-prose ol li{list-style:decimal}.stalux-prose ol li ol li{list-style:lower-alpha}.stalux-prose li>ul,.stalux-prose li>ol{margin-top:.3rem;margin-bottom:.3rem}.stalux-prose blockquote{margin:var(--space-xl) 0;border-left:4px solid var(--accent-60p);background:var(--surface-glass);border-top:1px solid var(--white-10p);border-right:1px solid var(--white-10p);border-bottom:1px solid var(--white-10p);color:var(--white-85p);border-radius:12px;padding:1rem 1.5rem;box-shadow:0 4px 16px #0002}.stalux-prose blockquote p{margin:0;line-height:1.7}.stalux-prose blockquote p+p{margin-top:.8rem}.stalux-prose blockquote strong{color:#ffd966}.stalux-prose blockquote code{font-size:.85em}.stalux-prose table{border-collapse:collapse;width:100%;margin:var(--space-xl) 0;box-shadow:var(--shadow-md);border-radius:8px;display:block;overflow:auto hidden}.stalux-prose th,.stalux-prose td{text-align:left;border-bottom:1px solid var(--white-10p);padding:.75rem 1rem;line-height:1.6}.stalux-prose th{white-space:nowrap;background:var(--accent-30p);color:var(--white-full);font-size:.95em;font-weight:600}.stalux-prose td{color:var(--white-85p)}.stalux-prose tr:nth-child(2n) td{background-color:var(--white-05p)}@media (hover:hover) and (pointer:fine){.stalux-prose tr:hover td{background-color:var(--black-10p)}}.stalux-prose table code{font-size:.85em}.stalux-prose img{max-width:100%;height:auto;margin:var(--space-xl) auto;box-shadow:var(--shadow-lg);transition:transform var(--transition-normal), box-shadow var(--transition-normal);border-radius:8px;display:block}@media (hover:hover) and (pointer:fine){.stalux-prose img:hover{box-shadow:var(--shadow-xl);transform:none}}.stalux-prose embed,.stalux-prose video{max-width:100%;height:auto;margin:var(--space-xl) auto;border-radius:8px;display:block}.stalux-prose hr{margin:var(--space-2xl) 0;background:linear-gradient(90deg, transparent, var(--white-15p) 20%, var(--accent-40p) 50%, var(--white-15p) 80%, transparent);border:none;height:1.5px}.stalux-prose details{margin:var(--space-lg) 0;background-color:var(--white-05p);border:1px solid var(--white-10p);transition:border-color var(--transition-fast);border-radius:6px;padding:.8rem 1rem}@media (hover:hover) and (pointer:fine){.stalux-prose details:hover{border-color:var(--white-20p)}}.stalux-prose summary{cursor:pointer;color:var(--white-90p);font-weight:600}.stalux-prose details[open] summary{border-bottom:1px solid var(--white-10p);margin-bottom:.8rem;padding-bottom:.6rem}.stalux-prose figure{text-align:center;margin:var(--space-xl) 0}.stalux-prose figcaption{color:var(--white-70p);margin-top:.5rem;font-size:.9em;font-style:italic}.stalux-prose figure[data-stalux-image]>figcaption{color:var(--muted-text);overflow-wrap:anywhere;font-size:.85rem;font-style:normal;line-height:1.6}.stalux-prose .footnotes{color:var(--white-75p);border-top:1px solid var(--white-15p);margin-top:var(--space-2xl);padding-top:var(--space-lg);font-size:.88em}.stalux-prose .footnotes ol{margin-left:1rem;padding-left:.5rem}.stalux-prose .footnotes li{margin:.5rem 0;line-height:1.6}.stalux-prose .footnotes a{font-size:.9em}@media (width<=1024px){.stalux-prose{font-size:1.05rem}.stalux-prose h1{font-size:2.2rem}.stalux-prose h2{font-size:1.8rem}.stalux-prose h3{font-size:1.35rem}.stalux-prose h4{font-size:1.15rem}.stalux-prose pre{padding:1rem 1.2rem;font-size:.88em}}@media (width<=768px){.stalux-prose{font-size:1rem;line-height:1.7}.stalux-prose h1{margin-top:1.5rem;font-size:1.8rem}.stalux-prose h2{margin-top:1.5rem;font-size:1.4rem}.stalux-prose h3{margin-top:1.25rem;font-size:1.2rem}.stalux-prose h4{margin-top:1rem;font-size:1.1rem}.stalux-prose h5{font-size:1rem}.stalux-prose h6{font-size:.95rem}.stalux-prose p{margin-bottom:var(--space-md)}.stalux-prose pre{margin:var(--space-lg) 0;border-left-width:3px;padding:.8rem 1rem;font-size:.82em}.stalux-prose table{font-size:.85rem}.stalux-prose th,.stalux-prose td{padding:.5rem .7rem}.stalux-prose blockquote{padding:.8rem 1rem;font-size:.9em}.stalux-prose ul,.stalux-prose ol{padding-left:1.5rem}}.stalux-prose,.stalux-prose>*,.stalux-prose div,.stalux-prose .expressive-code,.stalux-prose .expressive-code .frame{box-sizing:border-box;min-width:0;max-width:100%}.stalux-prose{overflow-wrap:anywhere}.stalux-prose a:after{content:none}.stalux-prose a{text-decoration:underline;text-decoration-color:var(--accent-50p);text-underline-offset:.2em;border-bottom:0;text-decoration-thickness:1px}.stalux-prose a:has(img){text-decoration:none}.stalux-prose pre,.stalux-prose table,.stalux-prose .mermaid,.stalux-prose math{overscroll-behavior-x:contain;max-width:100%;overflow-x:auto}.stalux-prose pre,.stalux-prose pre code{overflow-wrap:normal;word-break:normal}.stalux-prose :is(img,video,iframe,embed,svg,canvas){max-width:100%}.stalux-prose :is(img,video,svg,canvas){height:auto}.stalux-prose iframe{margin:var(--space-xl) auto;border-radius:8px;display:block}.stalux-prose .mermaid svg{max-width:none}.stalux-prose canvas{box-sizing:border-box}.stalux-prose summary{overflow-wrap:anywhere}}@layer utilities;@font-face{font-family:Stalux Math Aux;src:url(/fonts/StaluxMathAux.woff2)format("woff2");font-weight:400;font-style:normal}@font-face{font-family:Latin Modern Math;src:url(/fonts/latinmodern-math.woff2)format("woff2");font-display:swap}math{font-size-adjust:none;text-indent:0;text-transform:none;letter-spacing:normal;word-wrap:normal;font-feature-settings:"dtls" off;font-style:normal;font-weight:400;line-height:normal;font-family:"Latin Modern Math", var(--font-body), math;direction:ltr}math *{border-color:currentColor}math.tml-display{width:100%;display:block}.mathscr{font-family:Stalux Math Aux,serif}mfrac>:nth-child(2),msqrt,mover>:first-child{math-shift:compact}.menclose{padding:.5ex 0;display:inline-block;position:relative}.tml-cancelto{background-color:currentColor;padding:.5ex 0;display:inline-block;position:absolute;top:0;left:0;-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><defs><marker id='a' markerHeight='5' markerUnits='strokeWidth' markerWidth='7' orient='auto' refX='7' refY='2.5'><path fill='black' d='m0 0 7 2.5L0 5z'/></marker></defs><line x2='100%25' y1='100%25' stroke='black' stroke-width='.06em' marker-end='url(%23a)' vector-effect='non-scaling-stroke'/></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><defs><marker id='a' markerHeight='5' markerUnits='strokeWidth' markerWidth='7' orient='auto' refX='7' refY='2.5'><path fill='black' d='m0 0 7 2.5L0 5z'/></marker></defs><line x2='100%25' y1='100%25' stroke='black' stroke-width='.06em' marker-end='url(%23a)' vector-effect='non-scaling-stroke'/></svg>");-webkit-mask-position:0 0;mask-position:0 0;-webkit-mask-size:100% 100%;mask-size:100% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat}@-moz-document url-prefix(){math{display:inline}math>mrow{padding:0}mtd,mtable.tml-small mtd{padding-top:0;padding-bottom:0}mtable.tml-jot mtd{padding-top:.2ex;padding-bottom:0}.tml-vec{transform:scale(.75)}.ff-narrow{width:0}.ff-nudge-left{margin-left:-.2em}.ff-squash mtd{height:0;display:block}}@supports not ((-moz-appearance:none)){mo.tml-prime{font-family:Stalux Math Aux,serif}.tml-sml-pad{padding-left:.05em}.tml-med-pad{padding-left:.1em}.tml-lrg-pad{padding-left:.15em}}@supports ((-webkit-backdrop-filter:blur(1px))){.wbk-acc{transform:translateY(.431em)}.wbk-sml{transform:translate(.07em)}.wbk-sml-acc{transform:translate(.07em,.431em)}.wbk-sml-vec{transform:scale(.75)translate(.07em)}.wbk-med{transform:translate(.14em)}.wbk-med-acc{transform:translate(.14em,.431em)}.wbk-med-vec{transform:scale(.75)translate(.14em)}.wbk-lrg{transform:translate(.21em)}.wbk-lrg-acc{transform:translate(.21em,.431em)}.wbk-lrg-vec{transform:scale(.75)translate(.21em)}}@supports (not ((-webkit-backdrop-filter:blur(1px)))) and (not ((-moz-appearance:none))){.chr-sml{transform:translate(.07em)}.chr-sml-vec{transform:scale(.75)translate(.07em)}.chr-med{transform:translate(.14em)}.chr-med-vec{transform:scale(.75)translate(.14em)}.chr-lrg{transform:translate(.21em)}.chr-lrg-vec{transform:scale(.75)translate(.21em)}.tml-shift-left{margin-left:-100%}menclose{padding:.5ex 0;position:relative}.tml-overline{border-top:.065em solid;padding:.1em 0 0}.tml-underline{border-bottom:.065em solid;padding:0 0 .1em}.tml-cancel{background-color:currentColor;width:100%;height:100%;display:inline-block;position:absolute;bottom:0;left:.5px}.upstrike{clip-path:polygon(.05em 100%,0 calc(100% - .05em),calc(100% - .05em) 0,100% .05em)}.downstrike{clip-path:polygon(0 .05em,.05em 0,100% calc(100% - .05em),calc(100% - .05em) 100%)}.sout{clip-path:polygon(0 calc(55% + .0333em),0 calc(55% - .0333em),100% calc(55% - .0333em),100% calc(55% + .0333em))}.tml-xcancel{clip-path:polygon(.05em 0,0 .05em,calc(50% - .05em) 50%,0 calc(100% - .05em),.05em 100%,50% calc(50% + .05em),calc(100% - .05em) 100%,100% calc(100% - .05em),calc(50% + .05em) 50%,100% .05em,calc(100% - .05em) 0%,50% calc(50% - .05em))}.longdiv-top{border-top:.067em solid;padding:.1em .2em .2em .433em}.longdiv-arc{clip-path:inset(0 0 0 .4em);box-sizing:border-box;border:.067em solid;border-radius:70%;width:.7em;position:absolute;top:0;bottom:.1em;left:-.4em;transform:translateY(-.067em)}.menclose{text-align:left;display:inline-block;position:relative}.phasor-bottom{border-bottom:.067em solid;padding:.2em .2em .1em .6em}.phasor-angle{aspect-ratio:.5;clip-path:polygon(.05em 100%,0 calc(100% - .05em),calc(100% - .05em) 0,100% .05em);background-color:currentColor;height:100%;display:inline-block;position:absolute;bottom:-.04em;left:.5px}.tml-fbox{border:1px solid;padding:3pt}.circle-pad{padding:.267em}.textcircle{border:.067em solid;border-radius:50%;position:absolute;inset:0}.actuarial{border-style:solid;border-width:.08em .08em 0 0;margin-right:.03889em;padding:.03889em .03889em 0}.tml-crooked-2{transform:scale(2,1.1)}.tml-crooked-3{transform:scale(3,1.3)}.tml-crooked-4{transform:scale(4,1.4)}.tml-right{text-align:-webkit-right}.tml-left{text-align:-webkit-left}}menclose{-webkit-print-color-adjust:exact;print-color-adjust:exact}.tml-right{text-align:right}.tml-left{text-align:left}.special-fraction{font-family:Times New Roman,Times,STIX TWO,Tinos,serif}math{flex-wrap:wrap;align-items:baseline;display:inline-flex}math>mrow{padding:.5ex 0}mtable.tml-jot mtd{padding-top:.7ex;padding-bottom:.7ex}mtable.tml-small mtd{padding-top:.35ex;padding-bottom:.35ex}.tml-shift-left{margin-left:-200%}.tml-eqn:before{counter-increment:tmlEqnNo;content:"(" counter(tmlEqnNo) ")"}body{counter-reset:tmlEqnNo}
|
|
2
2
|
/*$vite$:1*/
|