@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/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
- const shard = shards.get(termFile(word)) ?? shards.set(termFile(word), {}).get(termFile(word))
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
  }