@chengzhao-dev/dsh-quarto-book 0.3.4 → 0.3.5
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/LICENSE +20 -20
- package/README.en.md +3 -3
- package/README.md +3 -3
- package/docs/plugin-flow.md +2 -2
- package/docs/versioning.md +8 -8
- package/package.json +1 -1
- package/skills/designing-theme/assets/theme/css/base.css +368 -368
- package/skills/designing-theme/assets/theme/includes/footer.html +63 -63
- package/skills/designing-theme/assets/theme/palettes/github/meta.md +38 -38
- package/skills/designing-theme/knowledge/reading-surface.md +68 -68
- package/skills/designing-theme/scripts/measuring-pages.mjs +309 -309
- package/skills/writing-quarto/SKILL.md +43 -43
- package/skills/writing-quarto/scripts/checking-callouts.py +102 -102
- package/skills/writing-quarto/scripts/checking-dom.py +577 -577
- package/skills/writing-quarto/scripts/diagrams/rendering-coords.py +250 -250
- package/skills/writing-quarto/scripts/testing-check-ascii-names.py +71 -71
- package/skills/writing-quarto/scripts/testing-content.py +149 -149
- package/skills/writing-quarto/scripts/verifying-content.py +378 -378
- package/templates/quarto-book-project/writing/chapter-map.md +22 -22
|
@@ -1,368 +1,368 @@
|
|
|
1
|
-
/* dsh-quarto-book Quarto 主题 · 基础排版(标题块 / 标题 / 垂直节奏 / 链接;自 common.css 拆分) */
|
|
2
|
-
|
|
3
|
-
/* ---------- 标题块(章节标题 + 首页引导段) ---------- */
|
|
4
|
-
/* 标题块内面包屑(起步:环境与工具链 > 章节):与标题之间留白;
|
|
5
|
-
桌面端(≥992px)按设计隐藏,此间距仅窄屏可见时生效 */
|
|
6
|
-
.quarto-title-breadcrumbs {
|
|
7
|
-
margin-bottom: 0.5rem;
|
|
8
|
-
}
|
|
9
|
-
/* 标题块(章节/首页通用):覆盖 Quarto 默认居中 + 其更高优先级的 margin-bottom:0,
|
|
10
|
-
用同等特异性选择器(组件 css 后加载)确保生效
|
|
11
|
-
—— 间距控制点:
|
|
12
|
-
· 章节页 标题→首段引言:由本规则的 line-height / margin-bottom 控制(见下方 #quarto-document-content > p:first-of-type)
|
|
13
|
-
· 首页 标题→描述:由下方 #title-block-header .description 的 margin-top 控制 */
|
|
14
|
-
#title-block-header.quarto-title-block.default .quarto-title .title {
|
|
15
|
-
font-size: 2rem; /* 32px,GitHub Markdown h1 */
|
|
16
|
-
font-weight: 600;
|
|
17
|
-
letter-spacing: 0;
|
|
18
|
-
line-height: 1.2;
|
|
19
|
-
text-wrap: balance;
|
|
20
|
-
text-align: left; /* 覆盖默认 theme 居中,与左对齐正文/引言成组 */
|
|
21
|
-
margin-bottom: 0; /* 章节页标题→首段进一步收紧;首页间距交由 .description 控制 */
|
|
22
|
-
}
|
|
23
|
-
/* hero eyebrow(首页眉标,gitcn「GITHUB SKILLS」同款:英文大写标签 + 绿点在文字后)。
|
|
24
|
-
.hero-eyebrow 与标题块同为 #quarto-document-content 直接子级,
|
|
25
|
-
用 flex + order 将其提到标题(h1+description)之前。 */
|
|
26
|
-
#quarto-document-content:has(.hero-eyebrow) {
|
|
27
|
-
display: flex;
|
|
28
|
-
flex-direction: column;
|
|
29
|
-
}
|
|
30
|
-
#quarto-document-content:has(.hero-eyebrow) .hero-eyebrow {
|
|
31
|
-
order: -1;
|
|
32
|
-
margin-top: 0; /* 抵消下方 *+* 的 1.25rem */
|
|
33
|
-
margin-bottom: 0.9rem; /* 眉标→标题间距 */
|
|
34
|
-
}
|
|
35
|
-
#quarto-document-content:has(.hero-eyebrow) #title-block-header {
|
|
36
|
-
order: 0;
|
|
37
|
-
}
|
|
38
|
-
/* 首页标题 36px(gitcn getting-started hero text-4xl),覆盖内容页默认 30px */
|
|
39
|
-
#quarto-document-content:has(.hero-eyebrow) #title-block-header .quarto-title .title {
|
|
40
|
-
font-size: 2.25rem;
|
|
41
|
-
}
|
|
42
|
-
.hero-eyebrow {
|
|
43
|
-
display: inline-flex;
|
|
44
|
-
align-items: center;
|
|
45
|
-
gap: 0.5rem;
|
|
46
|
-
margin: 0;
|
|
47
|
-
font-size: 0.875rem;
|
|
48
|
-
font-weight: 400;
|
|
49
|
-
letter-spacing: normal;
|
|
50
|
-
text-transform: none;
|
|
51
|
-
color: var(--text-secondary);
|
|
52
|
-
}
|
|
53
|
-
.hero-eyebrow p {
|
|
54
|
-
margin: 0;
|
|
55
|
-
}
|
|
56
|
-
.hero-eyebrow::after {
|
|
57
|
-
content: "";
|
|
58
|
-
width: 0.5rem;
|
|
59
|
-
height: 0.625rem;
|
|
60
|
-
background-color: var(--dot-accent);
|
|
61
|
-
}
|
|
62
|
-
#title-block-header .description {
|
|
63
|
-
color: var(--text-secondary);
|
|
64
|
-
font-size: 1.125rem;
|
|
65
|
-
font-weight: 400;
|
|
66
|
-
line-height: 1.7;
|
|
67
|
-
max-width: 100%;
|
|
68
|
-
margin: 0 0 1.8rem;
|
|
69
|
-
}
|
|
70
|
-
#title-block-header .description p {
|
|
71
|
-
margin-bottom: 0;
|
|
72
|
-
}
|
|
73
|
-
#title-block-header .quarto-title-meta {
|
|
74
|
-
margin: 1.5rem 0 0;
|
|
75
|
-
color: var(--text-secondary);
|
|
76
|
-
font-size: 0.85rem;
|
|
77
|
-
}
|
|
78
|
-
/* 无元数据(作者/日期)时隐藏空 meta,避免章节页留白空隙 */
|
|
79
|
-
#title-block-header .quarto-title-meta:not(:has(.quarto-title-meta-contents > *)) {
|
|
80
|
-
display: none;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
/* ---------- 标题:用尺寸区分阅读层级(单字面字体下层级只靠字号) ----------
|
|
86
|
-
h2 通栏底线显式关闭:Bootstrap 主题(cosmo)自带 h2 border-bottom,
|
|
87
|
-
不写会被回落默认值重新画上。章节之间靠 margin-top: 3rem 的节奏分隔。 */
|
|
88
|
-
h1,
|
|
89
|
-
h2 {
|
|
90
|
-
font-size: 1.5rem;
|
|
91
|
-
font-weight: 600;
|
|
92
|
-
line-height: 1.25;
|
|
93
|
-
letter-spacing: 0;
|
|
94
|
-
text-wrap: balance;
|
|
95
|
-
border-bottom: none;
|
|
96
|
-
padding-bottom: 0;
|
|
97
|
-
}
|
|
98
|
-
h1 { font-size: 2rem; }
|
|
99
|
-
h3 {
|
|
100
|
-
font-size: 1.25rem; /* 20px:标题台阶 32/24/20/18,h3 与 h2 拉开一档 */
|
|
101
|
-
font-weight: 600;
|
|
102
|
-
line-height: 1.5;
|
|
103
|
-
letter-spacing: 0;
|
|
104
|
-
text-wrap: balance;
|
|
105
|
-
}
|
|
106
|
-
h4 {
|
|
107
|
-
font-size: 1.125rem;
|
|
108
|
-
font-weight: 600;
|
|
109
|
-
line-height: 1.2;
|
|
110
|
-
letter-spacing: 0;
|
|
111
|
-
}
|
|
112
|
-
h5 {
|
|
113
|
-
font-size: 0.9rem;
|
|
114
|
-
font-weight: 400;
|
|
115
|
-
line-height: 1.2;
|
|
116
|
-
letter-spacing: 0;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/* h2 通栏底线已移除(2026-10):章节之间靠 margin-top: 3rem 的节奏分隔,
|
|
120
|
-
不再用横线;原首页/索引页关闭底线的覆盖规则随之删除。 */
|
|
121
|
-
|
|
122
|
-
/* ---------- 垂直节奏(上边距节奏,参考 mdBook / React / Vue 的 prose 模式) ----------
|
|
123
|
-
Quarto 把每个 h2 章节内容包在 <section class="level2"> 里,因此对主容器与各 section
|
|
124
|
-
的直属块级子元素统一重置 margin,用上边距节奏控制间距
|
|
125
|
-
—— 正文间距收成四档,档位按「两块内容是不是同一件事」取:
|
|
126
|
-
粘连 0.5rem(标题→首段/列表、标题→callout、caption→其代码块)
|
|
127
|
-
相关 1rem(代码块↔caption、代码块↔callout、列表内代码块→验证句)
|
|
128
|
-
换段 1.5rem(段落/列表/代码块之间的默认距离,下方 * + * 是唯一来源,对 content 与首页一视同仁)
|
|
129
|
-
换节 3rem(h2 之前;h3/h4/h5 之前 2rem) */
|
|
130
|
-
#quarto-document-content > *,
|
|
131
|
-
#quarto-document-content section > * {
|
|
132
|
-
margin-top: 0;
|
|
133
|
-
margin-bottom: 0;
|
|
134
|
-
}
|
|
135
|
-
/* 换段档:段落、列表和代码块之间的默认距离。 */
|
|
136
|
-
#quarto-document-content > * + *,
|
|
137
|
-
#quarto-document-content section > * + * {
|
|
138
|
-
margin-top: 1.5rem;
|
|
139
|
-
}
|
|
140
|
-
#quarto-document-content p,
|
|
141
|
-
#quarto-document-content li {
|
|
142
|
-
line-height: 1.75;
|
|
143
|
-
}
|
|
144
|
-
/* 代码块上方/下方的说明(caption):次要灰 + 略小,贴近其描述的代码块;
|
|
145
|
-
代码块本身保持高对比正文色(切勿把灰色涂到 pre 上) */
|
|
146
|
-
.code-caption {
|
|
147
|
-
color: var(--text-secondary);
|
|
148
|
-
font-size: 0.92rem;
|
|
149
|
-
margin-bottom: 0;
|
|
150
|
-
}
|
|
151
|
-
/* 代码块 → 下方段落:换段档 */
|
|
152
|
-
#quarto-document-content > :is(.code-copy-outer-scaffold, pre) + p,
|
|
153
|
-
#quarto-document-content section > :is(.code-copy-outer-scaffold, pre) + p {
|
|
154
|
-
margin-top: 1.5rem;
|
|
155
|
-
}
|
|
156
|
-
/* 代码块 → 下方 caption:相关档,caption 是代码块的附属说明 */
|
|
157
|
-
#quarto-document-content > :is(.code-copy-outer-scaffold, pre) + .code-caption,
|
|
158
|
-
#quarto-document-content section > :is(.code-copy-outer-scaffold, pre) + .code-caption {
|
|
159
|
-
margin-top: 1rem;
|
|
160
|
-
}
|
|
161
|
-
/* 正文 → 代码块:换段档 */
|
|
162
|
-
#quarto-document-content > :is(p, .code-caption) + :is(.code-copy-outer-scaffold, pre),
|
|
163
|
-
#quarto-document-content section > :is(p, .code-caption) + :is(.code-copy-outer-scaffold, pre) {
|
|
164
|
-
margin-top: 1.5rem;
|
|
165
|
-
}
|
|
166
|
-
/* 列表项由 li 自身承担块间距,上面的 section 直属子元素规则覆盖不到代码块后的验证句。 */
|
|
167
|
-
#quarto-document-content li > :is(.code-copy-outer-scaffold, .code-with-filename, pre, div.sourceCode) + p {
|
|
168
|
-
margin-top: var(--code-followup-gap);
|
|
169
|
-
}
|
|
170
|
-
/* 说明段紧贴其描述代码块(覆盖上方间距) */
|
|
171
|
-
#quarto-document-content > .code-caption + :is(.code-copy-outer-scaffold, pre),
|
|
172
|
-
#quarto-document-content section > .code-caption + :is(.code-copy-outer-scaffold, pre) {
|
|
173
|
-
margin-top: 0.5rem;
|
|
174
|
-
}
|
|
175
|
-
#quarto-document-content :is(h2, h3, h4) + .callout {
|
|
176
|
-
margin-top: 0.5rem;
|
|
177
|
-
}
|
|
178
|
-
#quarto-document-content :is(.code-copy-outer-scaffold, pre) + .callout,
|
|
179
|
-
#quarto-document-content .callout + :is(.code-copy-outer-scaffold, pre) {
|
|
180
|
-
margin-top: 1rem;
|
|
181
|
-
}
|
|
182
|
-
/* h2 间距:换节档 3rem;margin-bottom 与相邻 margin-top 折叠取大者,
|
|
183
|
-
设 0.5rem 让标题与首段保持粘连档,不被折叠抬高一倍 */
|
|
184
|
-
#quarto-document-content > h2,
|
|
185
|
-
#quarto-document-content section > h2 {
|
|
186
|
-
margin-top: 3rem;
|
|
187
|
-
margin-bottom: 0.5rem;
|
|
188
|
-
}
|
|
189
|
-
/* 章节页首段引言:进一步拉近与标题的间距(标题块 margin-bottom 已为 0,这里再上拉一点)
|
|
190
|
-
—— 间距控制点:标题块 line-height/margin-bottom(上方 #title-block-header… .title)+ 此处首段 margin-top */
|
|
191
|
-
#quarto-document-content > p:first-of-type {
|
|
192
|
-
margin-top: 0.5rem; /* 标题→首段:干净正间距(取代负 margin hack) */
|
|
193
|
-
}
|
|
194
|
-
#quarto-document-content > h3,
|
|
195
|
-
#quarto-document-content section > h3 {
|
|
196
|
-
margin-top: 2rem;
|
|
197
|
-
}
|
|
198
|
-
#quarto-document-content > h4,
|
|
199
|
-
#quarto-document-content > h5,
|
|
200
|
-
#quarto-document-content section > h4,
|
|
201
|
-
#quarto-document-content section > h5 {
|
|
202
|
-
margin-top: 2rem;
|
|
203
|
-
}
|
|
204
|
-
/* 标题紧接的首段/列表收紧到粘连档,让「标题—首段」成组(段→标题仍保留上方疏朗留白) */
|
|
205
|
-
#quarto-document-content :is(h2, h3, h4) + :is(p, ul, ol) {
|
|
206
|
-
margin-top: 0.5rem;
|
|
207
|
-
}
|
|
208
|
-
/* 中文段落健壮性:长英文/代码/URL 不撑破列宽;避免末行孤字;CJK 换行规范 */
|
|
209
|
-
#quarto-document-content p,
|
|
210
|
-
#quarto-document-content li,
|
|
211
|
-
#quarto-document-content blockquote,
|
|
212
|
-
#quarto-document-content dd {
|
|
213
|
-
overflow-wrap: break-word;
|
|
214
|
-
text-wrap: pretty; /* 修复 text-wrap 非继承导致段落未生效的问题 */
|
|
215
|
-
line-break: strict; /* CJK 标点处不当断行 */
|
|
216
|
-
}
|
|
217
|
-
/* 标题悬浮锚点 #(anchorJS 注入):次要灰(docs 标题锚点不着色,可见性由 anchorJS 控制) */
|
|
218
|
-
.anchorjs-link {
|
|
219
|
-
color: var(--text-secondary);
|
|
220
|
-
transition: color var(--transition);
|
|
221
|
-
}
|
|
222
|
-
.anchorjs-link:hover {
|
|
223
|
-
color: var(--body-color);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
/* 章节号弱化置灰 */
|
|
227
|
-
.quarto-section-identifier {
|
|
228
|
-
color: var(--text-secondary);
|
|
229
|
-
font-weight: normal;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
/* ---------- 链接 ---------- */
|
|
233
|
-
a {
|
|
234
|
-
color: var(--link-color);
|
|
235
|
-
}
|
|
236
|
-
a:hover {
|
|
237
|
-
text-decoration: underline;
|
|
238
|
-
}
|
|
239
|
-
/* r4ds:代码里的链接用细下划线 */
|
|
240
|
-
code a:any-link {
|
|
241
|
-
text-decoration: underline;
|
|
242
|
-
text-decoration-color: var(--link-underline);
|
|
243
|
-
text-decoration-thickness: 1px;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
/* ---------- 杂项(原 misc.css:过渡 / 小屏 / 页脚 / 返回顶部 / 打印) ---------- */
|
|
247
|
-
#quarto-sidebar .sidebar-item-text.sidebar-link,
|
|
248
|
-
.sidebar.margin-sidebar nav[role="doc-toc"] a,
|
|
249
|
-
.landing-card,
|
|
250
|
-
.nav-page .pagination-link {
|
|
251
|
-
transition: var(--transition);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
@media (max-width: 767.98px) {
|
|
255
|
-
body {
|
|
256
|
-
font-size: 16px;
|
|
257
|
-
-webkit-text-size-adjust: 100%;
|
|
258
|
-
}
|
|
259
|
-
pre {
|
|
260
|
-
overflow-x: auto;
|
|
261
|
-
-webkit-overflow-scrolling: touch;
|
|
262
|
-
}
|
|
263
|
-
.sidebar nav a,
|
|
264
|
-
.toc nav a {
|
|
265
|
-
padding: 0.35rem 0;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
.footer {
|
|
270
|
-
grid-column: 1 / -1;
|
|
271
|
-
color: var(--text-secondary);
|
|
272
|
-
background-color: var(--code-bg);
|
|
273
|
-
font-family: var(--ui-font);
|
|
274
|
-
font-weight: 400;
|
|
275
|
-
font-size: 0.75rem;
|
|
276
|
-
border-radius: 0;
|
|
277
|
-
padding: 1.25rem 1rem 1rem;
|
|
278
|
-
margin-top: 3rem;
|
|
279
|
-
text-align: center;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
body.quarto-light .navbar,
|
|
283
|
-
body.quarto-dark .navbar {
|
|
284
|
-
--bs-navbar-color: var(--navbar-fg);
|
|
285
|
-
--bs-navbar-hover-color: var(--navbar-fg);
|
|
286
|
-
--bs-navbar-active-color: var(--navbar-fg);
|
|
287
|
-
--bs-navbar-brand-color: var(--navbar-fg);
|
|
288
|
-
box-shadow: none;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
.footer a {
|
|
292
|
-
color: var(--text-link);
|
|
293
|
-
}
|
|
294
|
-
.footer a:hover {
|
|
295
|
-
text-decoration: underline;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
#back-to-top {
|
|
299
|
-
position: fixed;
|
|
300
|
-
right: 1.25rem;
|
|
301
|
-
bottom: 1.25rem;
|
|
302
|
-
width: 2.5rem;
|
|
303
|
-
height: 2.5rem;
|
|
304
|
-
display: flex;
|
|
305
|
-
align-items: center;
|
|
306
|
-
justify-content: center;
|
|
307
|
-
border-radius: 50%;
|
|
308
|
-
border: 1px solid var(--card-border);
|
|
309
|
-
background-color: var(--card-bg);
|
|
310
|
-
color: var(--accent);
|
|
311
|
-
font-size: 1.1rem;
|
|
312
|
-
line-height: 1;
|
|
313
|
-
cursor: pointer;
|
|
314
|
-
opacity: 0;
|
|
315
|
-
visibility: hidden;
|
|
316
|
-
transform: translateY(0.5rem);
|
|
317
|
-
transition: opacity var(--transition), transform var(--transition),
|
|
318
|
-
background-color var(--transition);
|
|
319
|
-
box-shadow: var(--card-shadow);
|
|
320
|
-
z-index: 1000;
|
|
321
|
-
}
|
|
322
|
-
#back-to-top.show {
|
|
323
|
-
opacity: 1;
|
|
324
|
-
visibility: visible;
|
|
325
|
-
transform: translateY(0);
|
|
326
|
-
}
|
|
327
|
-
#back-to-top:hover {
|
|
328
|
-
background-color: var(--sidebar-hover-bg);
|
|
329
|
-
}
|
|
330
|
-
@media (prefers-reduced-motion: reduce) {
|
|
331
|
-
#back-to-top {
|
|
332
|
-
transition: none;
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
pre,
|
|
337
|
-
div.sourceCode,
|
|
338
|
-
.callout,
|
|
339
|
-
.table,
|
|
340
|
-
blockquote {
|
|
341
|
-
print-color-adjust: exact;
|
|
342
|
-
-webkit-print-color-adjust: exact;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
@media print {
|
|
346
|
-
/* 只隐藏复制按钮:Quarto 1.10 起 .code-copy-outer-scaffold 包裹着代码本身,
|
|
347
|
-
把它一起 display:none 会导致打印/导出 PDF 时所有代码块消失。 */
|
|
348
|
-
#quarto-sidebar,
|
|
349
|
-
#quarto-margin-sidebar,
|
|
350
|
-
.nav-page,
|
|
351
|
-
.code-copy-button,
|
|
352
|
-
#back-to-top {
|
|
353
|
-
display: none;
|
|
354
|
-
}
|
|
355
|
-
h2,
|
|
356
|
-
h3,
|
|
357
|
-
h4 {
|
|
358
|
-
break-after: avoid;
|
|
359
|
-
}
|
|
360
|
-
pre {
|
|
361
|
-
break-inside: avoid;
|
|
362
|
-
}
|
|
363
|
-
#quarto-document-content a[href^="http"]::after {
|
|
364
|
-
content: " (" attr(href) ")";
|
|
365
|
-
font-size: 0.85em;
|
|
366
|
-
word-break: break-all;
|
|
367
|
-
}
|
|
368
|
-
}
|
|
1
|
+
/* dsh-quarto-book Quarto 主题 · 基础排版(标题块 / 标题 / 垂直节奏 / 链接;自 common.css 拆分) */
|
|
2
|
+
|
|
3
|
+
/* ---------- 标题块(章节标题 + 首页引导段) ---------- */
|
|
4
|
+
/* 标题块内面包屑(起步:环境与工具链 > 章节):与标题之间留白;
|
|
5
|
+
桌面端(≥992px)按设计隐藏,此间距仅窄屏可见时生效 */
|
|
6
|
+
.quarto-title-breadcrumbs {
|
|
7
|
+
margin-bottom: 0.5rem;
|
|
8
|
+
}
|
|
9
|
+
/* 标题块(章节/首页通用):覆盖 Quarto 默认居中 + 其更高优先级的 margin-bottom:0,
|
|
10
|
+
用同等特异性选择器(组件 css 后加载)确保生效
|
|
11
|
+
—— 间距控制点:
|
|
12
|
+
· 章节页 标题→首段引言:由本规则的 line-height / margin-bottom 控制(见下方 #quarto-document-content > p:first-of-type)
|
|
13
|
+
· 首页 标题→描述:由下方 #title-block-header .description 的 margin-top 控制 */
|
|
14
|
+
#title-block-header.quarto-title-block.default .quarto-title .title {
|
|
15
|
+
font-size: 2rem; /* 32px,GitHub Markdown h1 */
|
|
16
|
+
font-weight: 600;
|
|
17
|
+
letter-spacing: 0;
|
|
18
|
+
line-height: 1.2;
|
|
19
|
+
text-wrap: balance;
|
|
20
|
+
text-align: left; /* 覆盖默认 theme 居中,与左对齐正文/引言成组 */
|
|
21
|
+
margin-bottom: 0; /* 章节页标题→首段进一步收紧;首页间距交由 .description 控制 */
|
|
22
|
+
}
|
|
23
|
+
/* hero eyebrow(首页眉标,gitcn「GITHUB SKILLS」同款:英文大写标签 + 绿点在文字后)。
|
|
24
|
+
.hero-eyebrow 与标题块同为 #quarto-document-content 直接子级,
|
|
25
|
+
用 flex + order 将其提到标题(h1+description)之前。 */
|
|
26
|
+
#quarto-document-content:has(.hero-eyebrow) {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
}
|
|
30
|
+
#quarto-document-content:has(.hero-eyebrow) .hero-eyebrow {
|
|
31
|
+
order: -1;
|
|
32
|
+
margin-top: 0; /* 抵消下方 *+* 的 1.25rem */
|
|
33
|
+
margin-bottom: 0.9rem; /* 眉标→标题间距 */
|
|
34
|
+
}
|
|
35
|
+
#quarto-document-content:has(.hero-eyebrow) #title-block-header {
|
|
36
|
+
order: 0;
|
|
37
|
+
}
|
|
38
|
+
/* 首页标题 36px(gitcn getting-started hero text-4xl),覆盖内容页默认 30px */
|
|
39
|
+
#quarto-document-content:has(.hero-eyebrow) #title-block-header .quarto-title .title {
|
|
40
|
+
font-size: 2.25rem;
|
|
41
|
+
}
|
|
42
|
+
.hero-eyebrow {
|
|
43
|
+
display: inline-flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
gap: 0.5rem;
|
|
46
|
+
margin: 0;
|
|
47
|
+
font-size: 0.875rem;
|
|
48
|
+
font-weight: 400;
|
|
49
|
+
letter-spacing: normal;
|
|
50
|
+
text-transform: none;
|
|
51
|
+
color: var(--text-secondary);
|
|
52
|
+
}
|
|
53
|
+
.hero-eyebrow p {
|
|
54
|
+
margin: 0;
|
|
55
|
+
}
|
|
56
|
+
.hero-eyebrow::after {
|
|
57
|
+
content: "";
|
|
58
|
+
width: 0.5rem;
|
|
59
|
+
height: 0.625rem;
|
|
60
|
+
background-color: var(--dot-accent);
|
|
61
|
+
}
|
|
62
|
+
#title-block-header .description {
|
|
63
|
+
color: var(--text-secondary);
|
|
64
|
+
font-size: 1.125rem;
|
|
65
|
+
font-weight: 400;
|
|
66
|
+
line-height: 1.7;
|
|
67
|
+
max-width: 100%;
|
|
68
|
+
margin: 0 0 1.8rem;
|
|
69
|
+
}
|
|
70
|
+
#title-block-header .description p {
|
|
71
|
+
margin-bottom: 0;
|
|
72
|
+
}
|
|
73
|
+
#title-block-header .quarto-title-meta {
|
|
74
|
+
margin: 1.5rem 0 0;
|
|
75
|
+
color: var(--text-secondary);
|
|
76
|
+
font-size: 0.85rem;
|
|
77
|
+
}
|
|
78
|
+
/* 无元数据(作者/日期)时隐藏空 meta,避免章节页留白空隙 */
|
|
79
|
+
#title-block-header .quarto-title-meta:not(:has(.quarto-title-meta-contents > *)) {
|
|
80
|
+
display: none;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
/* ---------- 标题:用尺寸区分阅读层级(单字面字体下层级只靠字号) ----------
|
|
86
|
+
h2 通栏底线显式关闭:Bootstrap 主题(cosmo)自带 h2 border-bottom,
|
|
87
|
+
不写会被回落默认值重新画上。章节之间靠 margin-top: 3rem 的节奏分隔。 */
|
|
88
|
+
h1,
|
|
89
|
+
h2 {
|
|
90
|
+
font-size: 1.5rem;
|
|
91
|
+
font-weight: 600;
|
|
92
|
+
line-height: 1.25;
|
|
93
|
+
letter-spacing: 0;
|
|
94
|
+
text-wrap: balance;
|
|
95
|
+
border-bottom: none;
|
|
96
|
+
padding-bottom: 0;
|
|
97
|
+
}
|
|
98
|
+
h1 { font-size: 2rem; }
|
|
99
|
+
h3 {
|
|
100
|
+
font-size: 1.25rem; /* 20px:标题台阶 32/24/20/18,h3 与 h2 拉开一档 */
|
|
101
|
+
font-weight: 600;
|
|
102
|
+
line-height: 1.5;
|
|
103
|
+
letter-spacing: 0;
|
|
104
|
+
text-wrap: balance;
|
|
105
|
+
}
|
|
106
|
+
h4 {
|
|
107
|
+
font-size: 1.125rem;
|
|
108
|
+
font-weight: 600;
|
|
109
|
+
line-height: 1.2;
|
|
110
|
+
letter-spacing: 0;
|
|
111
|
+
}
|
|
112
|
+
h5 {
|
|
113
|
+
font-size: 0.9rem;
|
|
114
|
+
font-weight: 400;
|
|
115
|
+
line-height: 1.2;
|
|
116
|
+
letter-spacing: 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* h2 通栏底线已移除(2026-10):章节之间靠 margin-top: 3rem 的节奏分隔,
|
|
120
|
+
不再用横线;原首页/索引页关闭底线的覆盖规则随之删除。 */
|
|
121
|
+
|
|
122
|
+
/* ---------- 垂直节奏(上边距节奏,参考 mdBook / React / Vue 的 prose 模式) ----------
|
|
123
|
+
Quarto 把每个 h2 章节内容包在 <section class="level2"> 里,因此对主容器与各 section
|
|
124
|
+
的直属块级子元素统一重置 margin,用上边距节奏控制间距
|
|
125
|
+
—— 正文间距收成四档,档位按「两块内容是不是同一件事」取:
|
|
126
|
+
粘连 0.5rem(标题→首段/列表、标题→callout、caption→其代码块)
|
|
127
|
+
相关 1rem(代码块↔caption、代码块↔callout、列表内代码块→验证句)
|
|
128
|
+
换段 1.5rem(段落/列表/代码块之间的默认距离,下方 * + * 是唯一来源,对 content 与首页一视同仁)
|
|
129
|
+
换节 3rem(h2 之前;h3/h4/h5 之前 2rem) */
|
|
130
|
+
#quarto-document-content > *,
|
|
131
|
+
#quarto-document-content section > * {
|
|
132
|
+
margin-top: 0;
|
|
133
|
+
margin-bottom: 0;
|
|
134
|
+
}
|
|
135
|
+
/* 换段档:段落、列表和代码块之间的默认距离。 */
|
|
136
|
+
#quarto-document-content > * + *,
|
|
137
|
+
#quarto-document-content section > * + * {
|
|
138
|
+
margin-top: 1.5rem;
|
|
139
|
+
}
|
|
140
|
+
#quarto-document-content p,
|
|
141
|
+
#quarto-document-content li {
|
|
142
|
+
line-height: 1.75;
|
|
143
|
+
}
|
|
144
|
+
/* 代码块上方/下方的说明(caption):次要灰 + 略小,贴近其描述的代码块;
|
|
145
|
+
代码块本身保持高对比正文色(切勿把灰色涂到 pre 上) */
|
|
146
|
+
.code-caption {
|
|
147
|
+
color: var(--text-secondary);
|
|
148
|
+
font-size: 0.92rem;
|
|
149
|
+
margin-bottom: 0;
|
|
150
|
+
}
|
|
151
|
+
/* 代码块 → 下方段落:换段档 */
|
|
152
|
+
#quarto-document-content > :is(.code-copy-outer-scaffold, pre) + p,
|
|
153
|
+
#quarto-document-content section > :is(.code-copy-outer-scaffold, pre) + p {
|
|
154
|
+
margin-top: 1.5rem;
|
|
155
|
+
}
|
|
156
|
+
/* 代码块 → 下方 caption:相关档,caption 是代码块的附属说明 */
|
|
157
|
+
#quarto-document-content > :is(.code-copy-outer-scaffold, pre) + .code-caption,
|
|
158
|
+
#quarto-document-content section > :is(.code-copy-outer-scaffold, pre) + .code-caption {
|
|
159
|
+
margin-top: 1rem;
|
|
160
|
+
}
|
|
161
|
+
/* 正文 → 代码块:换段档 */
|
|
162
|
+
#quarto-document-content > :is(p, .code-caption) + :is(.code-copy-outer-scaffold, pre),
|
|
163
|
+
#quarto-document-content section > :is(p, .code-caption) + :is(.code-copy-outer-scaffold, pre) {
|
|
164
|
+
margin-top: 1.5rem;
|
|
165
|
+
}
|
|
166
|
+
/* 列表项由 li 自身承担块间距,上面的 section 直属子元素规则覆盖不到代码块后的验证句。 */
|
|
167
|
+
#quarto-document-content li > :is(.code-copy-outer-scaffold, .code-with-filename, pre, div.sourceCode) + p {
|
|
168
|
+
margin-top: var(--code-followup-gap);
|
|
169
|
+
}
|
|
170
|
+
/* 说明段紧贴其描述代码块(覆盖上方间距) */
|
|
171
|
+
#quarto-document-content > .code-caption + :is(.code-copy-outer-scaffold, pre),
|
|
172
|
+
#quarto-document-content section > .code-caption + :is(.code-copy-outer-scaffold, pre) {
|
|
173
|
+
margin-top: 0.5rem;
|
|
174
|
+
}
|
|
175
|
+
#quarto-document-content :is(h2, h3, h4) + .callout {
|
|
176
|
+
margin-top: 0.5rem;
|
|
177
|
+
}
|
|
178
|
+
#quarto-document-content :is(.code-copy-outer-scaffold, pre) + .callout,
|
|
179
|
+
#quarto-document-content .callout + :is(.code-copy-outer-scaffold, pre) {
|
|
180
|
+
margin-top: 1rem;
|
|
181
|
+
}
|
|
182
|
+
/* h2 间距:换节档 3rem;margin-bottom 与相邻 margin-top 折叠取大者,
|
|
183
|
+
设 0.5rem 让标题与首段保持粘连档,不被折叠抬高一倍 */
|
|
184
|
+
#quarto-document-content > h2,
|
|
185
|
+
#quarto-document-content section > h2 {
|
|
186
|
+
margin-top: 3rem;
|
|
187
|
+
margin-bottom: 0.5rem;
|
|
188
|
+
}
|
|
189
|
+
/* 章节页首段引言:进一步拉近与标题的间距(标题块 margin-bottom 已为 0,这里再上拉一点)
|
|
190
|
+
—— 间距控制点:标题块 line-height/margin-bottom(上方 #title-block-header… .title)+ 此处首段 margin-top */
|
|
191
|
+
#quarto-document-content > p:first-of-type {
|
|
192
|
+
margin-top: 0.5rem; /* 标题→首段:干净正间距(取代负 margin hack) */
|
|
193
|
+
}
|
|
194
|
+
#quarto-document-content > h3,
|
|
195
|
+
#quarto-document-content section > h3 {
|
|
196
|
+
margin-top: 2rem;
|
|
197
|
+
}
|
|
198
|
+
#quarto-document-content > h4,
|
|
199
|
+
#quarto-document-content > h5,
|
|
200
|
+
#quarto-document-content section > h4,
|
|
201
|
+
#quarto-document-content section > h5 {
|
|
202
|
+
margin-top: 2rem;
|
|
203
|
+
}
|
|
204
|
+
/* 标题紧接的首段/列表收紧到粘连档,让「标题—首段」成组(段→标题仍保留上方疏朗留白) */
|
|
205
|
+
#quarto-document-content :is(h2, h3, h4) + :is(p, ul, ol) {
|
|
206
|
+
margin-top: 0.5rem;
|
|
207
|
+
}
|
|
208
|
+
/* 中文段落健壮性:长英文/代码/URL 不撑破列宽;避免末行孤字;CJK 换行规范 */
|
|
209
|
+
#quarto-document-content p,
|
|
210
|
+
#quarto-document-content li,
|
|
211
|
+
#quarto-document-content blockquote,
|
|
212
|
+
#quarto-document-content dd {
|
|
213
|
+
overflow-wrap: break-word;
|
|
214
|
+
text-wrap: pretty; /* 修复 text-wrap 非继承导致段落未生效的问题 */
|
|
215
|
+
line-break: strict; /* CJK 标点处不当断行 */
|
|
216
|
+
}
|
|
217
|
+
/* 标题悬浮锚点 #(anchorJS 注入):次要灰(docs 标题锚点不着色,可见性由 anchorJS 控制) */
|
|
218
|
+
.anchorjs-link {
|
|
219
|
+
color: var(--text-secondary);
|
|
220
|
+
transition: color var(--transition);
|
|
221
|
+
}
|
|
222
|
+
.anchorjs-link:hover {
|
|
223
|
+
color: var(--body-color);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/* 章节号弱化置灰 */
|
|
227
|
+
.quarto-section-identifier {
|
|
228
|
+
color: var(--text-secondary);
|
|
229
|
+
font-weight: normal;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/* ---------- 链接 ---------- */
|
|
233
|
+
a {
|
|
234
|
+
color: var(--link-color);
|
|
235
|
+
}
|
|
236
|
+
a:hover {
|
|
237
|
+
text-decoration: underline;
|
|
238
|
+
}
|
|
239
|
+
/* r4ds:代码里的链接用细下划线 */
|
|
240
|
+
code a:any-link {
|
|
241
|
+
text-decoration: underline;
|
|
242
|
+
text-decoration-color: var(--link-underline);
|
|
243
|
+
text-decoration-thickness: 1px;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/* ---------- 杂项(原 misc.css:过渡 / 小屏 / 页脚 / 返回顶部 / 打印) ---------- */
|
|
247
|
+
#quarto-sidebar .sidebar-item-text.sidebar-link,
|
|
248
|
+
.sidebar.margin-sidebar nav[role="doc-toc"] a,
|
|
249
|
+
.landing-card,
|
|
250
|
+
.nav-page .pagination-link {
|
|
251
|
+
transition: var(--transition);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
@media (max-width: 767.98px) {
|
|
255
|
+
body {
|
|
256
|
+
font-size: 16px;
|
|
257
|
+
-webkit-text-size-adjust: 100%;
|
|
258
|
+
}
|
|
259
|
+
pre {
|
|
260
|
+
overflow-x: auto;
|
|
261
|
+
-webkit-overflow-scrolling: touch;
|
|
262
|
+
}
|
|
263
|
+
.sidebar nav a,
|
|
264
|
+
.toc nav a {
|
|
265
|
+
padding: 0.35rem 0;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.footer {
|
|
270
|
+
grid-column: 1 / -1;
|
|
271
|
+
color: var(--text-secondary);
|
|
272
|
+
background-color: var(--code-bg);
|
|
273
|
+
font-family: var(--ui-font);
|
|
274
|
+
font-weight: 400;
|
|
275
|
+
font-size: 0.75rem;
|
|
276
|
+
border-radius: 0;
|
|
277
|
+
padding: 1.25rem 1rem 1rem;
|
|
278
|
+
margin-top: 3rem;
|
|
279
|
+
text-align: center;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
body.quarto-light .navbar,
|
|
283
|
+
body.quarto-dark .navbar {
|
|
284
|
+
--bs-navbar-color: var(--navbar-fg);
|
|
285
|
+
--bs-navbar-hover-color: var(--navbar-fg);
|
|
286
|
+
--bs-navbar-active-color: var(--navbar-fg);
|
|
287
|
+
--bs-navbar-brand-color: var(--navbar-fg);
|
|
288
|
+
box-shadow: none;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.footer a {
|
|
292
|
+
color: var(--text-link);
|
|
293
|
+
}
|
|
294
|
+
.footer a:hover {
|
|
295
|
+
text-decoration: underline;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
#back-to-top {
|
|
299
|
+
position: fixed;
|
|
300
|
+
right: 1.25rem;
|
|
301
|
+
bottom: 1.25rem;
|
|
302
|
+
width: 2.5rem;
|
|
303
|
+
height: 2.5rem;
|
|
304
|
+
display: flex;
|
|
305
|
+
align-items: center;
|
|
306
|
+
justify-content: center;
|
|
307
|
+
border-radius: 50%;
|
|
308
|
+
border: 1px solid var(--card-border);
|
|
309
|
+
background-color: var(--card-bg);
|
|
310
|
+
color: var(--accent);
|
|
311
|
+
font-size: 1.1rem;
|
|
312
|
+
line-height: 1;
|
|
313
|
+
cursor: pointer;
|
|
314
|
+
opacity: 0;
|
|
315
|
+
visibility: hidden;
|
|
316
|
+
transform: translateY(0.5rem);
|
|
317
|
+
transition: opacity var(--transition), transform var(--transition),
|
|
318
|
+
background-color var(--transition);
|
|
319
|
+
box-shadow: var(--card-shadow);
|
|
320
|
+
z-index: 1000;
|
|
321
|
+
}
|
|
322
|
+
#back-to-top.show {
|
|
323
|
+
opacity: 1;
|
|
324
|
+
visibility: visible;
|
|
325
|
+
transform: translateY(0);
|
|
326
|
+
}
|
|
327
|
+
#back-to-top:hover {
|
|
328
|
+
background-color: var(--sidebar-hover-bg);
|
|
329
|
+
}
|
|
330
|
+
@media (prefers-reduced-motion: reduce) {
|
|
331
|
+
#back-to-top {
|
|
332
|
+
transition: none;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
pre,
|
|
337
|
+
div.sourceCode,
|
|
338
|
+
.callout,
|
|
339
|
+
.table,
|
|
340
|
+
blockquote {
|
|
341
|
+
print-color-adjust: exact;
|
|
342
|
+
-webkit-print-color-adjust: exact;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
@media print {
|
|
346
|
+
/* 只隐藏复制按钮:Quarto 1.10 起 .code-copy-outer-scaffold 包裹着代码本身,
|
|
347
|
+
把它一起 display:none 会导致打印/导出 PDF 时所有代码块消失。 */
|
|
348
|
+
#quarto-sidebar,
|
|
349
|
+
#quarto-margin-sidebar,
|
|
350
|
+
.nav-page,
|
|
351
|
+
.code-copy-button,
|
|
352
|
+
#back-to-top {
|
|
353
|
+
display: none;
|
|
354
|
+
}
|
|
355
|
+
h2,
|
|
356
|
+
h3,
|
|
357
|
+
h4 {
|
|
358
|
+
break-after: avoid;
|
|
359
|
+
}
|
|
360
|
+
pre {
|
|
361
|
+
break-inside: avoid;
|
|
362
|
+
}
|
|
363
|
+
#quarto-document-content a[href^="http"]::after {
|
|
364
|
+
content: " (" attr(href) ")";
|
|
365
|
+
font-size: 0.85em;
|
|
366
|
+
word-break: break-all;
|
|
367
|
+
}
|
|
368
|
+
}
|