@clarusjs/theme-docs 0.5.2 → 0.7.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/package.json +13 -6
- package/src/callout.tscl +8 -4
- package/src/code-tabs.tscl +69 -0
- package/src/layout.tscl +31 -26
- package/src/learn-path.tscl +26 -23
- package/src/learn-progress.tscl +8 -4
- package/src/learn-status.tscl +13 -8
- package/src/lesson-bar.tscl +36 -22
- package/src/lesson.css +5 -2
- package/src/lesson.tscl +36 -28
- package/src/mermaid.tscl +60 -0
- package/src/nav.ts +20 -2
- package/src/page-head.tscl +15 -10
- package/src/parts/contents.tscl +11 -7
- package/src/parts/footer.tscl +7 -3
- package/src/parts/header.tscl +19 -15
- package/src/parts/icon.tscl +9 -5
- package/src/parts/page-footer.tscl +14 -10
- package/src/parts/sidebar.tscl +15 -11
- package/src/progress-board.tscl +11 -8
- package/src/quiz-choices.tscl +18 -14
- package/src/quiz.tscl +12 -8
- package/src/search.tscl +2 -1
- package/src/styles/theme.css +16 -0
- package/src/theme.css +41 -0
- package/src/vite.js +2 -1
package/src/theme.css
CHANGED
|
@@ -1275,6 +1275,17 @@ details.custom-block[open] > summary {
|
|
|
1275
1275
|
outline: 2px solid var(--accent);
|
|
1276
1276
|
outline-offset: 2px;
|
|
1277
1277
|
}
|
|
1278
|
+
.mermaid-diagram {
|
|
1279
|
+
margin: 0 0 20px;
|
|
1280
|
+
}
|
|
1281
|
+
.mermaid-svg {
|
|
1282
|
+
display: flex;
|
|
1283
|
+
overflow-x: auto;
|
|
1284
|
+
}
|
|
1285
|
+
.mermaid-svg svg {
|
|
1286
|
+
margin: 0 auto;
|
|
1287
|
+
height: auto;
|
|
1288
|
+
}
|
|
1278
1289
|
.code-group > .code-block {
|
|
1279
1290
|
order: 1;
|
|
1280
1291
|
width: 100%;
|
|
@@ -1287,6 +1298,36 @@ details.custom-block[open] > summary {
|
|
|
1287
1298
|
.code-group > .code-block pre {
|
|
1288
1299
|
border-top-left-radius: 0;
|
|
1289
1300
|
}
|
|
1301
|
+
:is(.code-group.scroll, [data-code-groups="scroll"] .code-group:not(.wrap)) {
|
|
1302
|
+
display: grid;
|
|
1303
|
+
grid-template-columns: repeat(var(--tabs, 1), 0 max-content);
|
|
1304
|
+
position: relative;
|
|
1305
|
+
overflow-x: auto;
|
|
1306
|
+
scrollbar-width: thin;
|
|
1307
|
+
container-type: inline-size;
|
|
1308
|
+
}
|
|
1309
|
+
:is(.code-group.scroll, [data-code-groups="scroll"] .code-group:not(.wrap)) > input {
|
|
1310
|
+
position: static;
|
|
1311
|
+
grid-row: 1;
|
|
1312
|
+
width: 0;
|
|
1313
|
+
height: 0;
|
|
1314
|
+
margin: 0;
|
|
1315
|
+
scroll-margin-inline-end: 16rem;
|
|
1316
|
+
}
|
|
1317
|
+
:is(.code-group.scroll, [data-code-groups="scroll"] .code-group:not(.wrap)) > label {
|
|
1318
|
+
grid-row: 1;
|
|
1319
|
+
white-space: nowrap;
|
|
1320
|
+
max-width: 16rem;
|
|
1321
|
+
overflow: hidden;
|
|
1322
|
+
text-overflow: ellipsis;
|
|
1323
|
+
}
|
|
1324
|
+
:is(.code-group.scroll, [data-code-groups="scroll"] .code-group:not(.wrap)) > .code-block {
|
|
1325
|
+
grid-row: 2;
|
|
1326
|
+
grid-column: 1 / -1;
|
|
1327
|
+
width: 100cqi;
|
|
1328
|
+
position: sticky;
|
|
1329
|
+
left: 0;
|
|
1330
|
+
}
|
|
1290
1331
|
@media (prefers-reduced-motion: reduce) {
|
|
1291
1332
|
*, *::before, *::after {
|
|
1292
1333
|
animation-duration: 0.01ms !important;
|
package/src/vite.js
CHANGED
|
@@ -293,7 +293,8 @@ export function buildIndex(sections) {
|
|
|
293
293
|
for (const [word, n] of uses) weights.set(word, Math.min(n, 3))
|
|
294
294
|
for (const word of tokens(section.h)) weights.set(word, (weights.get(word) ?? 0) + 10)
|
|
295
295
|
for (const [word, weight] of weights) {
|
|
296
|
-
|
|
296
|
+
// No prototype: words like constructor and __proto__ are terms like any other.
|
|
297
|
+
const shard = shards.get(termFile(word)) ?? shards.set(termFile(word), Object.create(null)).get(termFile(word))
|
|
297
298
|
;(/** @type {Record<string, number[]>} */ (shard)[word] ??= []).push(id, weight)
|
|
298
299
|
}
|
|
299
300
|
}
|