@dr-ishaan/remake-blocks 1.4.0 → 1.4.2
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 +241 -98
- package/dist/styles.css +84 -26
- package/dist/theme/docusaurus.css +26 -8
- package/dist/theme/github.css +84 -26
- package/dist/theme/obsidian.css +32 -12
- package/dist/theme/vitepress.css +30 -11
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,35 +1,71 @@
|
|
|
1
|
-
# remake-blocks
|
|
1
|
+
# @dr-ishaan/remake-blocks
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Astro 6 + remark plugin for rendering GitHub-style callouts (admonitions), enhanced blockquotes, and disclosure widgets in Markdown content — **27 first-class types + 4 themes + inline callouts + directive syntax + safe-by-default HTML escaping + Lucide/emoji icon sets**.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Each directive maps 1:1 to its own unique visual identity, SVG icon, color palette, and CSS class. No alias resolution.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
### Callout types & syntax
|
|
12
|
+
- **27 built-in callout types** — GFM standard (5) + Obsidian core (10) + promoted aliases (12)
|
|
12
13
|
- **GitHub admonition syntax** — `> [!NOTE]`, `> [!TIP]`, `> [!WARNING]`, etc.
|
|
13
|
-
- **
|
|
14
|
+
- **Directive syntax** — `:::note[Title]` ... `:::` (Starlight/Docusaurus compat, opt-in)
|
|
15
|
+
- **MkDocs admonition syntax** — `!!! note`, `??? note`, `???+ note` (MkDocs Material compat, opt-in)
|
|
16
|
+
- **Custom titles** — `> [!WARNING] Deprecated API`
|
|
14
17
|
- **Collapsible callouts** — `> [!FAQ]-` (collapsed) and `> [!TIP]+` (expanded)
|
|
15
|
-
- **Disclosure widgets** — `> [!] Title` creates a plain collapsible block
|
|
18
|
+
- **Disclosure widgets** — `> [!] Title` creates a plain collapsible block
|
|
16
19
|
- **Accordion grouping** — consecutive `[!]` blocks auto-group into an accordion
|
|
17
20
|
- **Tree view** — nested `[!]` blocks get depth indicators
|
|
18
21
|
- **Custom callout types** — define your own with icon, color, and CSS class
|
|
19
|
-
- **
|
|
20
|
-
|
|
22
|
+
- **Configurable aliases** — `aliases: { note: ["n"] }` for short names
|
|
23
|
+
|
|
24
|
+
### Themes & styling
|
|
25
|
+
- **4 swappable CSS themes** — github, obsidian, vitepress, docusaurus
|
|
26
|
+
- **Inline callouts** — `{inline}` floats left, `{inline-end}` floats right (responsive)
|
|
27
|
+
- **Appearance variants** — `{appearance=minimal}`, `{appearance=hidden}`, etc.
|
|
28
|
+
- **Icon sets** — octicon (default), lucide, emoji, none
|
|
29
|
+
- **Per-callout named icon** — `{icon="rocket"}` uses a specific Lucide icon
|
|
30
|
+
- **Enhanced blockquotes** — rounded left accent line, darker text, auto-styled
|
|
31
|
+
- **i18n label customization** — `labels: { note: "注意" }` for localized titles
|
|
32
|
+
- **Dark mode** — automatic via `prefers-color-scheme` + manual via `data-theme` attribute
|
|
21
33
|
- **Auto CSS injection** — styles injected into every page by default
|
|
22
|
-
- **
|
|
23
|
-
|
|
34
|
+
- **CSS custom properties** — full `var()` system for easy customization
|
|
35
|
+
|
|
36
|
+
### Accessibility (WCAG-compliant)
|
|
37
|
+
- **`role="note"`** for ALL callout types (no `role="alert"` on static content — WCAG fix)
|
|
38
|
+
- **`aria-labelledby`** linking container → title id
|
|
39
|
+
- **`aria-hidden="true"`** on all decorative icons
|
|
40
|
+
- **`dir="auto"`** on container + title (RTL/Unicode support)
|
|
41
|
+
- **`data-collapsible`** attribute on all callout containers
|
|
42
|
+
- **Semantic HTML** — `<aside>` for non-collapsible, `<details>`/`<summary>` for collapsible
|
|
43
|
+
- **Zero JavaScript** for callouts — native HTML5 (collapsibles use `<details>`/`<summary>`)
|
|
44
|
+
- **axe-core verified** — 0 critical/serious violations across all 27 types
|
|
45
|
+
|
|
46
|
+
### Security (safe-by-default)
|
|
47
|
+
- **HTML escaping** — raw HTML in markdown body is escaped by default
|
|
48
|
+
- **`allowDangerousHtml` opt-in** — set `true` only if you trust your markdown source
|
|
49
|
+
- **`className`/`color` escaping** — prevents attribute breakout from config values
|
|
50
|
+
- **Custom callout config validation** — missing fields use defaults, no crashes
|
|
51
|
+
- **rehype-sanitize schema** — shipped as `sanitize-schema.json` for strict pipelines
|
|
52
|
+
- **Directive attribute security** — event handlers (`on*`) and `style` blocked
|
|
53
|
+
|
|
54
|
+
### Power-user features
|
|
55
|
+
- **`tags` option** — override container/title/body element names
|
|
56
|
+
- **`props` option** — per-type static or dynamic HTML attributes (function form)
|
|
57
|
+
- **`build()` escape hatch** — full custom render function for total output control
|
|
58
|
+
- **Directive attributes** — `:::note[Title]{#id .class key="value"}` (remark-directive compat)
|
|
59
|
+
- **Exported helpers** — `escapeHtml`, `escapeAttribute`, `sanitizeColor` for `build()` authors
|
|
24
60
|
- **Print-optimized** — clean print styles
|
|
25
|
-
- **
|
|
61
|
+
- **Single dependency** — only `unist-util-visit`
|
|
26
62
|
|
|
27
63
|
---
|
|
28
64
|
|
|
29
65
|
## Install
|
|
30
66
|
|
|
31
67
|
```bash
|
|
32
|
-
npm install remake-blocks
|
|
68
|
+
npm install @dr-ishaan/remake-blocks
|
|
33
69
|
```
|
|
34
70
|
|
|
35
71
|
## Quick Start (Astro)
|
|
@@ -37,7 +73,7 @@ npm install remake-blocks
|
|
|
37
73
|
```js
|
|
38
74
|
// astro.config.mjs
|
|
39
75
|
import { defineConfig } from "astro/config";
|
|
40
|
-
import remakeBlocks from "remake-blocks/astro";
|
|
76
|
+
import remakeBlocks from "@dr-ishaan/remake-blocks/astro";
|
|
41
77
|
|
|
42
78
|
export default defineConfig({
|
|
43
79
|
integrations: [remakeBlocks()],
|
|
@@ -62,7 +98,7 @@ Then use callouts in any Markdown or MDX file:
|
|
|
62
98
|
```js
|
|
63
99
|
import { unified } from "unified";
|
|
64
100
|
import remarkParse from "remark-parse";
|
|
65
|
-
import { remarkRemakeBlocks } from "remake-blocks";
|
|
101
|
+
import { remarkRemakeBlocks } from "@dr-ishaan/remake-blocks";
|
|
66
102
|
import remarkRehype from "remark-rehype";
|
|
67
103
|
import rehypeStringify from "rehype-stringify";
|
|
68
104
|
|
|
@@ -133,47 +169,77 @@ Consecutive `[!]` blocks are automatically grouped into an accordion. Nested `[!
|
|
|
133
169
|
|
|
134
170
|
## Syntax
|
|
135
171
|
|
|
136
|
-
###
|
|
172
|
+
### Blockquote callouts (primary syntax)
|
|
137
173
|
|
|
138
174
|
```markdown
|
|
139
175
|
> [!NOTE]
|
|
140
176
|
> Content goes here.
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
### Custom Title
|
|
144
177
|
|
|
145
|
-
```markdown
|
|
146
178
|
> [!WARNING] Breaking Change
|
|
147
179
|
> The v2 API has been deprecated.
|
|
180
|
+
|
|
181
|
+
> [!FAQ]-
|
|
182
|
+
> Click to reveal the answer.
|
|
183
|
+
|
|
184
|
+
> [!TIP]+
|
|
185
|
+
> This starts expanded but can be collapsed.
|
|
148
186
|
```
|
|
149
187
|
|
|
150
|
-
###
|
|
188
|
+
### Directive syntax (Starlight/Docusaurus compat)
|
|
189
|
+
|
|
190
|
+
Opt-in via `enableDirectiveSyntax: true`:
|
|
151
191
|
|
|
152
192
|
```markdown
|
|
153
|
-
|
|
154
|
-
|
|
193
|
+
:::note
|
|
194
|
+
Basic callout.
|
|
195
|
+
:::
|
|
196
|
+
|
|
197
|
+
:::note[Custom Title]
|
|
198
|
+
With title.
|
|
199
|
+
:::
|
|
200
|
+
|
|
201
|
+
:::warning{fold=-}
|
|
202
|
+
Collapsed callout.
|
|
203
|
+
:::
|
|
204
|
+
|
|
205
|
+
:::note[Title]{#my-id .custom-class data-type="example"}
|
|
206
|
+
With full directive attributes.
|
|
207
|
+
:::
|
|
155
208
|
```
|
|
156
209
|
|
|
157
|
-
###
|
|
210
|
+
### MkDocs admonition syntax (MkDocs Material compat)
|
|
211
|
+
|
|
212
|
+
Opt-in via `enableMkDocsSyntax: true`:
|
|
158
213
|
|
|
159
214
|
```markdown
|
|
160
|
-
|
|
161
|
-
|
|
215
|
+
!!! note
|
|
216
|
+
Non-collapsible callout (4-space indented body).
|
|
217
|
+
|
|
218
|
+
??? note
|
|
219
|
+
Collapsed callout.
|
|
220
|
+
|
|
221
|
+
???+ note
|
|
222
|
+
Expanded collapsible callout.
|
|
223
|
+
|
|
224
|
+
!!! note "Custom Title"
|
|
225
|
+
With custom title.
|
|
162
226
|
```
|
|
163
227
|
|
|
164
|
-
###
|
|
228
|
+
### Per-callout overrides
|
|
229
|
+
|
|
230
|
+
Use `{key=value}` syntax after the directive:
|
|
165
231
|
|
|
166
232
|
```markdown
|
|
167
|
-
> [!
|
|
168
|
-
>
|
|
169
|
-
>
|
|
170
|
-
>
|
|
171
|
-
>
|
|
172
|
-
> -
|
|
173
|
-
>
|
|
233
|
+
> [!NOTE]{icon=false} — hide icon for this callout
|
|
234
|
+
> [!NOTE]{icon="rocket"} — use a specific Lucide icon
|
|
235
|
+
> [!NOTE]{appearance=minimal} — minimal appearance variant
|
|
236
|
+
> [!NOTE]{appearance=hidden} — no title, no icon
|
|
237
|
+
> [!NOTE]{inline} — float left (responsive)
|
|
238
|
+
> [!NOTE]{inline-end} — float right (responsive)
|
|
239
|
+
> [!NOTE]{icon=false inline appearance=minimal} — multiple overrides
|
|
174
240
|
```
|
|
175
241
|
|
|
176
|
-
### Disclosure
|
|
242
|
+
### Disclosure widgets
|
|
177
243
|
|
|
178
244
|
```markdown
|
|
179
245
|
> [!] Section Title
|
|
@@ -193,56 +259,71 @@ Consecutive `[!]` blocks are automatically grouped into an accordion. Nested `[!
|
|
|
193
259
|
```js
|
|
194
260
|
// astro.config.mjs
|
|
195
261
|
import { defineConfig } from "astro/config";
|
|
196
|
-
import remakeBlocks from "remake-blocks/astro";
|
|
262
|
+
import remakeBlocks from "@dr-ishaan/remake-blocks/astro";
|
|
197
263
|
|
|
198
264
|
export default defineConfig({
|
|
199
265
|
integrations: [
|
|
200
266
|
remakeBlocks({
|
|
201
|
-
//
|
|
202
|
-
injectStyles: true,
|
|
203
|
-
|
|
204
|
-
//
|
|
205
|
-
|
|
267
|
+
// ── Core ──────────────────────────────────────────────
|
|
268
|
+
injectStyles: true, // auto-inject CSS (default: true)
|
|
269
|
+
enhanceBlockquotes: true, // style regular blockquotes (default: true)
|
|
270
|
+
dataCalloutType: true, // add data-callout-type attribute (default: true)
|
|
271
|
+
allowDangerousHtml: false, // ⚠️ safe-by-default HTML escaping (default: false)
|
|
206
272
|
|
|
207
|
-
//
|
|
273
|
+
// ── Callout classes ──────────────────────────────────
|
|
208
274
|
calloutClass: "callout",
|
|
209
|
-
|
|
210
|
-
// CSS class for callout title (default: "callout-title")
|
|
211
275
|
calloutTitleClass: "callout-title",
|
|
212
|
-
|
|
213
|
-
// CSS class for callout body (default: "callout-body")
|
|
214
276
|
calloutBodyClass: "callout-body",
|
|
215
277
|
|
|
216
|
-
//
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
//
|
|
222
|
-
//
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
//
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
278
|
+
// ── Disclosure widgets ───────────────────────────────
|
|
279
|
+
enableDisclosures: true, // enable [!] syntax (default: true)
|
|
280
|
+
enableAccordion: true, // auto-group consecutive [!] (default: true)
|
|
281
|
+
enableTreeView: true, // nested [!] tree view (default: true)
|
|
282
|
+
|
|
283
|
+
// ── Alternative syntaxes (opt-in) ────────────────────
|
|
284
|
+
enableDirectiveSyntax: false, // :::note[Title] syntax (default: false)
|
|
285
|
+
enableMkDocsSyntax: false, // !!! note / ??? note syntax (default: false)
|
|
286
|
+
|
|
287
|
+
// ── Visual options ───────────────────────────────────
|
|
288
|
+
showIndicator: true, // show icons globally (default: true)
|
|
289
|
+
iconSet: "octicon", // "octicon" | "lucide" | "emoji" | "none"
|
|
290
|
+
appearance: "default", // "default" | "minimal" | "simple" | "hidden"
|
|
291
|
+
|
|
292
|
+
// ── i18n labels ──────────────────────────────────────
|
|
293
|
+
labels: {
|
|
294
|
+
note: "注意",
|
|
295
|
+
tip: "ヒント",
|
|
296
|
+
warning: "警告",
|
|
297
|
+
},
|
|
298
|
+
|
|
299
|
+
// ── Aliases ──────────────────────────────────────────
|
|
300
|
+
aliases: {
|
|
301
|
+
note: ["n"],
|
|
302
|
+
tip: ["t"],
|
|
303
|
+
},
|
|
304
|
+
|
|
305
|
+
// ── Power-user options ───────────────────────────────
|
|
306
|
+
tags: { // override HTML element names
|
|
307
|
+
container: "aside",
|
|
308
|
+
title: "div",
|
|
309
|
+
body: "div",
|
|
310
|
+
},
|
|
311
|
+
props: { // per-type HTML attributes (static or function)
|
|
312
|
+
note: { "data-category": "info" },
|
|
313
|
+
warning: (parsed) => ({ "data-severity": parsed.collapsible ? "collapsible" : "static" }),
|
|
314
|
+
},
|
|
315
|
+
build: (parsed, config, bodyHtml, options) => { // full custom render
|
|
316
|
+
return `<div class="my-callout">${bodyHtml}</div>`;
|
|
317
|
+
},
|
|
318
|
+
|
|
319
|
+
// ── Custom callout types ─────────────────────────────
|
|
239
320
|
customCallouts: [
|
|
240
321
|
{
|
|
241
|
-
type: "
|
|
242
|
-
icon: "
|
|
243
|
-
className: "callout-
|
|
244
|
-
defaultTitle: "
|
|
245
|
-
color: "#
|
|
322
|
+
type: "machine-learning",
|
|
323
|
+
icon: "🧠",
|
|
324
|
+
className: "callout-ml",
|
|
325
|
+
defaultTitle: "Machine Learning",
|
|
326
|
+
color: "#7c3aed",
|
|
246
327
|
backgroundColor: "#f5f3ff",
|
|
247
328
|
},
|
|
248
329
|
],
|
|
@@ -253,6 +334,32 @@ export default defineConfig({
|
|
|
253
334
|
|
|
254
335
|
---
|
|
255
336
|
|
|
337
|
+
## Themes
|
|
338
|
+
|
|
339
|
+
4 swappable CSS themes are available. Import the one you want:
|
|
340
|
+
|
|
341
|
+
```js
|
|
342
|
+
// Default (github) — auto-injected when injectStyles: true
|
|
343
|
+
import "@dr-ishaan/remake-blocks/styles.css";
|
|
344
|
+
|
|
345
|
+
// Or pick a specific theme:
|
|
346
|
+
import "@dr-ishaan/remake-blocks/theme/github.css"; // GitHub style
|
|
347
|
+
import "@dr-ishaan/remake-blocks/theme/obsidian.css"; // Obsidian style
|
|
348
|
+
import "@dr-ishaan/remake-blocks/theme/vitepress.css"; // VitePress style
|
|
349
|
+
import "@dr-ishaan/remake-blocks/theme/docusaurus.css"; // Docusaurus style
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
Each theme includes:
|
|
353
|
+
- Full light + dark mode (`prefers-color-scheme` + `data-theme` attribute)
|
|
354
|
+
- All 27 callout types with per-type colors
|
|
355
|
+
- Enhanced blockquote styling (rounded left accent line)
|
|
356
|
+
- Disclosure widget styling (card with rounded left accent line)
|
|
357
|
+
- Accordion + tree view styling
|
|
358
|
+
- Inline callout CSS (responsive)
|
|
359
|
+
- Print-optimized styles
|
|
360
|
+
|
|
361
|
+
---
|
|
362
|
+
|
|
256
363
|
## Security: Safe-by-Default
|
|
257
364
|
|
|
258
365
|
By default, **raw HTML in markdown is HTML-escaped** before being placed in callout bodies. This prevents XSS attacks from untrusted markdown content.
|
|
@@ -286,14 +393,30 @@ Only set `allowDangerousHtml: true` if:
|
|
|
286
393
|
1. You fully trust your markdown source, **AND**
|
|
287
394
|
2. You have sanitized the markdown with a tool like `rehype-sanitize`
|
|
288
395
|
|
|
396
|
+
### rehype-sanitize schema
|
|
397
|
+
|
|
398
|
+
A compatible sanitize schema is shipped for strict security pipelines:
|
|
399
|
+
|
|
400
|
+
```js
|
|
401
|
+
import schema from "@dr-ishaan/remake-blocks/sanitize-schema.json";
|
|
402
|
+
import rehypeSanitize from "rehype-sanitize";
|
|
403
|
+
|
|
404
|
+
// In your pipeline:
|
|
405
|
+
const processor = unified()
|
|
406
|
+
.use(remarkParse)
|
|
407
|
+
.use(remarkRemakeBlocks)
|
|
408
|
+
.use(remarkRehype, { allowDangerousHtml: true })
|
|
409
|
+
.use(rehypeSanitize, schema)
|
|
410
|
+
.use(rehypeStringify);
|
|
411
|
+
```
|
|
412
|
+
|
|
289
413
|
### Custom Callout Config Validation
|
|
290
414
|
|
|
291
415
|
Custom callout configurations are validated and normalized:
|
|
292
416
|
- Missing fields are filled with safe defaults (no crash)
|
|
293
417
|
- `null` or non-object entries are skipped
|
|
294
|
-
-
|
|
295
|
-
- `
|
|
296
|
-
- `color` is validated against a safe CSS color pattern (hex, rgb, hsl, var(), named, etc.); invalid values fall back to a default gray
|
|
418
|
+
- `className` is HTML-escaped (prevents attribute breakout)
|
|
419
|
+
- `color` is validated against a safe CSS color pattern; invalid values fall back to gray
|
|
297
420
|
|
|
298
421
|
---
|
|
299
422
|
|
|
@@ -321,15 +444,24 @@ If a custom callout's `type` matches a built-in, the built-in is overridden.
|
|
|
321
444
|
|
|
322
445
|
---
|
|
323
446
|
|
|
324
|
-
##
|
|
447
|
+
## i18n Label Customization
|
|
325
448
|
|
|
326
|
-
|
|
449
|
+
Override default titles for any callout type — useful for non-English documentation:
|
|
327
450
|
|
|
328
451
|
```js
|
|
329
|
-
|
|
330
|
-
|
|
452
|
+
remakeBlocks({
|
|
453
|
+
labels: {
|
|
454
|
+
note: "注意",
|
|
455
|
+
tip: "ヒント",
|
|
456
|
+
warning: "警告",
|
|
457
|
+
caution: "危険",
|
|
458
|
+
important: "重要",
|
|
459
|
+
},
|
|
460
|
+
})
|
|
331
461
|
```
|
|
332
462
|
|
|
463
|
+
Works with all 27 builtin types, custom callout types, and all 3 syntaxes (blockquote, directive, MkDocs).
|
|
464
|
+
|
|
333
465
|
---
|
|
334
466
|
|
|
335
467
|
## Dark Mode
|
|
@@ -373,9 +505,10 @@ See `styles.css` for the complete list of CSS custom properties.
|
|
|
373
505
|
Each callout renders as:
|
|
374
506
|
|
|
375
507
|
```html
|
|
376
|
-
<aside class="callout callout-note" data-callout-type="note"
|
|
377
|
-
|
|
378
|
-
|
|
508
|
+
<aside class="callout callout-note" data-callout-type="note" data-collapsible="false"
|
|
509
|
+
role="note" aria-labelledby="callout-note-1" dir="auto">
|
|
510
|
+
<div class="callout-title" style="color:#0969da" id="callout-note-1" dir="auto">
|
|
511
|
+
<span class="callout-icon" style="color:#0969da" aria-hidden="true">
|
|
379
512
|
<!-- SVG icon -->
|
|
380
513
|
</span>
|
|
381
514
|
<span class="callout-title-text">Note</span>
|
|
@@ -389,9 +522,10 @@ Each callout renders as:
|
|
|
389
522
|
Collapsible callouts use `<details>`/`<summary>`:
|
|
390
523
|
|
|
391
524
|
```html
|
|
392
|
-
<details class="callout callout-faq collapsible" data-callout-type="faq"
|
|
393
|
-
|
|
394
|
-
|
|
525
|
+
<details class="callout callout-faq collapsible" data-callout-type="faq" data-collapsible="true"
|
|
526
|
+
role="note" aria-labelledby="callout-faq-1" dir="auto">
|
|
527
|
+
<summary class="callout-title" style="color:#b45309" id="callout-faq-1" dir="auto">
|
|
528
|
+
<span class="callout-icon" style="color:#b45309" aria-hidden="true"><!-- SVG --></span>
|
|
395
529
|
<span class="callout-title-text">FAQ</span>
|
|
396
530
|
</summary>
|
|
397
531
|
<div class="callout-body">
|
|
@@ -402,11 +536,27 @@ Collapsible callouts use `<details>`/`<summary>`:
|
|
|
402
536
|
|
|
403
537
|
---
|
|
404
538
|
|
|
539
|
+
## Exported Helpers
|
|
540
|
+
|
|
541
|
+
For users who supply a custom `build()` render function:
|
|
542
|
+
|
|
543
|
+
```js
|
|
544
|
+
import { escapeHtml, escapeAttribute, sanitizeColor } from "@dr-ishaan/remake-blocks";
|
|
545
|
+
```
|
|
546
|
+
|
|
547
|
+
| Helper | Description |
|
|
548
|
+
|--------|-------------|
|
|
549
|
+
| `escapeHtml(str)` | Escapes `& < > " '` to HTML entities |
|
|
550
|
+
| `escapeAttribute(str)` | Same as `escapeHtml`, for attribute values |
|
|
551
|
+
| `sanitizeColor(value, fallback)` | Validates CSS color; returns fallback if dangerous |
|
|
552
|
+
|
|
553
|
+
---
|
|
554
|
+
|
|
405
555
|
## Caveats
|
|
406
556
|
|
|
407
557
|
### Strikethrough (`~~text~~`) requires `remark-gfm`
|
|
408
558
|
|
|
409
|
-
The plugin's body serializer handles `<del>` nodes correctly, but `remark-parse` alone does **not** enable GFM strikethrough. To use `~~strikethrough~~` syntax in callout bodies, add `remark-gfm
|
|
559
|
+
The plugin's body serializer handles `<del>` nodes correctly, but `remark-parse` alone does **not** enable GFM strikethrough. To use `~~strikethrough~~` syntax in callout bodies, add `remark-gfm`:
|
|
410
560
|
|
|
411
561
|
```js
|
|
412
562
|
import remarkGfm from "remark-gfm";
|
|
@@ -419,14 +569,7 @@ export default defineConfig({
|
|
|
419
569
|
|
|
420
570
|
### Horizontal rule after directive becomes a setext H2
|
|
421
571
|
|
|
422
|
-
In CommonMark,
|
|
423
|
-
|
|
424
|
-
```markdown
|
|
425
|
-
> [!NOTE]
|
|
426
|
-
> ---
|
|
427
|
-
```
|
|
428
|
-
|
|
429
|
-
is interpreted as a setext H2 heading ("[!NOTE]" with `---` underline), **not** as a callout with a thematic break body. To get a thematic break in the body, add a blank line before `---`:
|
|
572
|
+
In CommonMark, `> [!NOTE]\n> ---` is interpreted as a setext H2 heading, **not** as a callout with a thematic break body. Add a blank line before `---`:
|
|
430
573
|
|
|
431
574
|
```markdown
|
|
432
575
|
> [!NOTE]
|
|
@@ -439,7 +582,7 @@ is interpreted as a setext H2 heading ("[!NOTE]" with `---` underline), **not**
|
|
|
439
582
|
|
|
440
583
|
### Tables and other GFM features require `remark-gfm`
|
|
441
584
|
|
|
442
|
-
GFM-only features like tables, autolinks, and task list items require the `remark-gfm` plugin.
|
|
585
|
+
GFM-only features like tables, autolinks, and task list items require the `remark-gfm` plugin.
|
|
443
586
|
|
|
444
587
|
---
|
|
445
588
|
|
|
@@ -450,7 +593,7 @@ The remark plugin can be used independently of the Astro integration:
|
|
|
450
593
|
```js
|
|
451
594
|
import { unified } from "unified";
|
|
452
595
|
import remarkParse from "remark-parse";
|
|
453
|
-
import { remarkRemakeBlocks } from "remake-blocks";
|
|
596
|
+
import { remarkRemakeBlocks } from "@dr-ishaan/remake-blocks";
|
|
454
597
|
|
|
455
598
|
const processor = unified()
|
|
456
599
|
.use(remarkParse)
|
|
@@ -460,7 +603,7 @@ const processor = unified()
|
|
|
460
603
|
A backward-compatible alias `remarkCalloutBlocks` is also exported:
|
|
461
604
|
|
|
462
605
|
```js
|
|
463
|
-
import { remarkCalloutBlocks } from "remake-blocks";
|
|
606
|
+
import { remarkCalloutBlocks } from "@dr-ishaan/remake-blocks";
|
|
464
607
|
```
|
|
465
608
|
|
|
466
609
|
---
|
package/dist/styles.css
CHANGED
|
@@ -56,16 +56,16 @@
|
|
|
56
56
|
/* -- Enhanced Blockquote ---------------------------------------------- */
|
|
57
57
|
--blockquote-enhanced-border: #d0d7de;
|
|
58
58
|
--blockquote-enhanced-bg: #f6f8fa;
|
|
59
|
-
--blockquote-enhanced-color: #
|
|
59
|
+
--blockquote-enhanced-color: #24292f;
|
|
60
60
|
--blockquote-padding: 8px 14px;
|
|
61
61
|
--blockquote-margin: 10px 0;
|
|
62
62
|
|
|
63
63
|
/* -- Disclosure Widget ------------------------------------------------ */
|
|
64
64
|
--disclosure-border: #d0d7de;
|
|
65
|
-
--disclosure-bg:
|
|
65
|
+
--disclosure-bg: #f6f8fa;
|
|
66
66
|
--disclosure-title-color: #24292f;
|
|
67
67
|
--disclosure-body-color: inherit;
|
|
68
|
-
--disclosure-radius:
|
|
68
|
+
--disclosure-radius: 8px;
|
|
69
69
|
--disclosure-padding: 8px 12px;
|
|
70
70
|
--disclosure-title-font-size: 1.0625em;
|
|
71
71
|
--disclosure-body-font-size: 1.0625em;
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
--blockquote-enhanced-color: #8b949e;
|
|
118
118
|
|
|
119
119
|
--disclosure-border: #444c56;
|
|
120
|
-
--disclosure-bg:
|
|
120
|
+
--disclosure-bg: #161b22;
|
|
121
121
|
--disclosure-title-color: #e6edf3;
|
|
122
122
|
--disclosure-body-color: inherit;
|
|
123
123
|
}
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
--blockquote-enhanced-color: #8b949e;
|
|
167
167
|
|
|
168
168
|
--disclosure-border: #444c56;
|
|
169
|
-
--disclosure-bg:
|
|
169
|
+
--disclosure-bg: #161b22;
|
|
170
170
|
--disclosure-title-color: #e6edf3;
|
|
171
171
|
--disclosure-body-color: inherit;
|
|
172
172
|
}
|
|
@@ -336,12 +336,25 @@
|
|
|
336
336
|
position: relative;
|
|
337
337
|
margin: 0;
|
|
338
338
|
padding: var(--blockquote-padding);
|
|
339
|
-
border-left:
|
|
339
|
+
border-left: none;
|
|
340
340
|
background-color: var(--blockquote-enhanced-bg);
|
|
341
341
|
border-radius: 0 var(--callout-radius) var(--callout-radius) 0;
|
|
342
342
|
color: var(--blockquote-enhanced-color);
|
|
343
343
|
font-style: italic;
|
|
344
344
|
line-height: 1.5;
|
|
345
|
+
overflow: hidden;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/* v1.4.1: Rounded left line via pseudo-element (pill-shaped ends) */
|
|
349
|
+
.blockquote-enhanced blockquote::before {
|
|
350
|
+
content: "";
|
|
351
|
+
position: absolute;
|
|
352
|
+
left: 0;
|
|
353
|
+
top: 0;
|
|
354
|
+
bottom: 0;
|
|
355
|
+
width: 4px;
|
|
356
|
+
background: var(--blockquote-enhanced-border);
|
|
357
|
+
border-radius: 4px;
|
|
345
358
|
}
|
|
346
359
|
|
|
347
360
|
.blockquote-enhanced blockquote > *:first-child { margin-top: 0; }
|
|
@@ -404,19 +417,34 @@
|
|
|
404
417
|
* Always renders as <details>/<summary>.
|
|
405
418
|
*/
|
|
406
419
|
|
|
420
|
+
/* v1.4.1: G-1 design — card with rounded left accent line, no full border */
|
|
407
421
|
.disclosure {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
border
|
|
422
|
+
position: relative;
|
|
423
|
+
margin: 12px 0;
|
|
424
|
+
border: none;
|
|
425
|
+
border-radius: 8px;
|
|
411
426
|
background: var(--disclosure-bg);
|
|
412
427
|
overflow: hidden;
|
|
413
428
|
}
|
|
414
429
|
|
|
430
|
+
/* Rounded left accent line (pill-shaped ends, matching blockquote) */
|
|
431
|
+
.disclosure::before {
|
|
432
|
+
content: "";
|
|
433
|
+
position: absolute;
|
|
434
|
+
left: 0;
|
|
435
|
+
top: 0;
|
|
436
|
+
bottom: 0;
|
|
437
|
+
width: 4px;
|
|
438
|
+
background: var(--disclosure-border);
|
|
439
|
+
border-radius: 4px;
|
|
440
|
+
z-index: 1;
|
|
441
|
+
}
|
|
442
|
+
|
|
415
443
|
.disclosure > summary {
|
|
416
444
|
display: flex;
|
|
417
445
|
align-items: center;
|
|
418
|
-
gap:
|
|
419
|
-
padding:
|
|
446
|
+
gap: 8px;
|
|
447
|
+
padding: 12px 16px 10px 20px;
|
|
420
448
|
font-weight: 600;
|
|
421
449
|
font-size: var(--disclosure-title-font-size);
|
|
422
450
|
line-height: 1.3;
|
|
@@ -424,7 +452,8 @@
|
|
|
424
452
|
cursor: pointer;
|
|
425
453
|
user-select: none;
|
|
426
454
|
list-style: none;
|
|
427
|
-
|
|
455
|
+
border-bottom: 1px solid transparent;
|
|
456
|
+
transition: border-bottom-color 0.15s ease;
|
|
428
457
|
}
|
|
429
458
|
|
|
430
459
|
.disclosure > summary:hover {
|
|
@@ -439,23 +468,29 @@
|
|
|
439
468
|
.disclosure > summary::before {
|
|
440
469
|
content: "";
|
|
441
470
|
flex-shrink: 0;
|
|
442
|
-
width:
|
|
443
|
-
height:
|
|
444
|
-
border-right:
|
|
445
|
-
border-bottom:
|
|
471
|
+
width: 7px;
|
|
472
|
+
height: 7px;
|
|
473
|
+
border-right: 2px solid currentColor;
|
|
474
|
+
border-bottom: 2px solid currentColor;
|
|
446
475
|
transform: rotate(45deg);
|
|
447
476
|
transition: transform 0.2s ease;
|
|
477
|
+
margin-right: 2px;
|
|
448
478
|
}
|
|
449
479
|
|
|
450
480
|
.disclosure[open] > summary::before {
|
|
451
481
|
transform: rotate(-135deg);
|
|
452
482
|
}
|
|
453
483
|
|
|
484
|
+
/* Separator line appears only when expanded */
|
|
485
|
+
.disclosure[open] > summary {
|
|
486
|
+
border-bottom: 1px solid var(--disclosure-border);
|
|
487
|
+
}
|
|
488
|
+
|
|
454
489
|
.disclosure-title {
|
|
455
490
|
display: flex;
|
|
456
491
|
align-items: center;
|
|
457
|
-
gap:
|
|
458
|
-
padding:
|
|
492
|
+
gap: 8px;
|
|
493
|
+
padding: 12px 16px 10px 20px;
|
|
459
494
|
font-weight: 600;
|
|
460
495
|
font-size: var(--disclosure-title-font-size);
|
|
461
496
|
line-height: 1.3;
|
|
@@ -465,9 +500,9 @@
|
|
|
465
500
|
}
|
|
466
501
|
|
|
467
502
|
.disclosure-body {
|
|
468
|
-
padding:
|
|
503
|
+
padding: 10px 16px 14px 20px;
|
|
469
504
|
font-size: var(--disclosure-body-font-size);
|
|
470
|
-
line-height: 1.
|
|
505
|
+
line-height: 1.6;
|
|
471
506
|
color: var(--disclosure-body-color);
|
|
472
507
|
animation: callout-fade-in 0.15s ease-out;
|
|
473
508
|
}
|
|
@@ -516,11 +551,27 @@
|
|
|
516
551
|
* Progressive enhancement: without JS, each disclosure still toggles independently.
|
|
517
552
|
*/
|
|
518
553
|
|
|
554
|
+
/* v1.4.1: Accordion — card container matching disclosure G-1 design */
|
|
519
555
|
.disclosure-accordion {
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
border
|
|
556
|
+
position: relative;
|
|
557
|
+
margin: 12px 0;
|
|
558
|
+
border: none;
|
|
559
|
+
border-radius: 8px;
|
|
523
560
|
overflow: hidden;
|
|
561
|
+
background: var(--disclosure-bg);
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
/* Left accent line for the entire accordion */
|
|
565
|
+
.disclosure-accordion::before {
|
|
566
|
+
content: "";
|
|
567
|
+
position: absolute;
|
|
568
|
+
left: 0;
|
|
569
|
+
top: 0;
|
|
570
|
+
bottom: 0;
|
|
571
|
+
width: 4px;
|
|
572
|
+
background: var(--disclosure-border);
|
|
573
|
+
border-radius: 4px;
|
|
574
|
+
z-index: 1;
|
|
524
575
|
}
|
|
525
576
|
|
|
526
577
|
.disclosure-accordion > .disclosure {
|
|
@@ -529,6 +580,10 @@
|
|
|
529
580
|
border-radius: 0;
|
|
530
581
|
}
|
|
531
582
|
|
|
583
|
+
.disclosure-accordion > .disclosure::before {
|
|
584
|
+
display: none; /* inner disclosures don't need their own left line */
|
|
585
|
+
}
|
|
586
|
+
|
|
532
587
|
/* Connect accordion items with a subtle divider */
|
|
533
588
|
.disclosure-accordion > .disclosure + .disclosure {
|
|
534
589
|
border-top: 1px solid var(--disclosure-border);
|
|
@@ -614,9 +669,12 @@
|
|
|
614
669
|
@media print {
|
|
615
670
|
.callout { box-shadow: none; break-inside: avoid; }
|
|
616
671
|
.callout::before { display: none; }
|
|
617
|
-
.blockquote-enhanced blockquote { background: none;
|
|
618
|
-
.
|
|
619
|
-
.disclosure
|
|
672
|
+
.blockquote-enhanced blockquote { background: none; }
|
|
673
|
+
.blockquote-enhanced blockquote::before { width: 2px; }
|
|
674
|
+
.disclosure { box-shadow: none; }
|
|
675
|
+
.disclosure::before { width: 2px; }
|
|
676
|
+
.disclosure-accordion { box-shadow: none; }
|
|
677
|
+
.disclosure-accordion::before { width: 2px; }
|
|
620
678
|
.disclosure-tree { border-left-width: 1px; }
|
|
621
679
|
}
|
|
622
680
|
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
/* -- Enhanced Blockquote ---------------------------------------------- */
|
|
66
66
|
--blockquote-enhanced-border: #d0d7de;
|
|
67
67
|
--blockquote-enhanced-bg: #f6f8fa;
|
|
68
|
-
--blockquote-enhanced-color: #
|
|
68
|
+
--blockquote-enhanced-color: #24292f;
|
|
69
69
|
--blockquote-padding: 14px 18px;
|
|
70
70
|
--blockquote-margin: 14px 0;
|
|
71
71
|
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
|
|
121
121
|
--blockquote-enhanced-border: #444c56;
|
|
122
122
|
--blockquote-enhanced-bg: #161b22;
|
|
123
|
-
--blockquote-enhanced-color: #
|
|
123
|
+
--blockquote-enhanced-color: #e6edf3;
|
|
124
124
|
|
|
125
125
|
--disclosure-border: #444c56;
|
|
126
126
|
--disclosure-bg: #161b22;
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
|
|
169
169
|
--blockquote-enhanced-border: #444c56;
|
|
170
170
|
--blockquote-enhanced-bg: #161b22;
|
|
171
|
-
--blockquote-enhanced-color: #
|
|
171
|
+
--blockquote-enhanced-color: #e6edf3;
|
|
172
172
|
|
|
173
173
|
--disclosure-border: #444c56;
|
|
174
174
|
--disclosure-bg: #161b22;
|
|
@@ -332,6 +332,18 @@
|
|
|
332
332
|
box-shadow: var(--callout-shadow);
|
|
333
333
|
}
|
|
334
334
|
|
|
335
|
+
/* v1.4.1: Rounded left line via pseudo-element (pill-shaped ends) */
|
|
336
|
+
.blockquote-enhanced blockquote::before {
|
|
337
|
+
content: "";
|
|
338
|
+
position: absolute;
|
|
339
|
+
left: 0;
|
|
340
|
+
top: 0;
|
|
341
|
+
bottom: 0;
|
|
342
|
+
width: 4px;
|
|
343
|
+
background: var(--blockquote-enhanced-border);
|
|
344
|
+
border-radius: 4px;
|
|
345
|
+
}
|
|
346
|
+
|
|
335
347
|
.blockquote-enhanced blockquote > *:first-child { margin-top: 0; }
|
|
336
348
|
.blockquote-enhanced blockquote > *:last-child { margin-bottom: 0; }
|
|
337
349
|
.blockquote-enhanced blockquote p { margin: 0.2em 0; }
|
|
@@ -416,18 +428,24 @@
|
|
|
416
428
|
.disclosure > summary::before {
|
|
417
429
|
content: "";
|
|
418
430
|
flex-shrink: 0;
|
|
419
|
-
width:
|
|
420
|
-
height:
|
|
421
|
-
border-right:
|
|
422
|
-
border-bottom:
|
|
431
|
+
width: 7px;
|
|
432
|
+
height: 7px;
|
|
433
|
+
border-right: 2px solid currentColor;
|
|
434
|
+
border-bottom: 2px solid currentColor;
|
|
423
435
|
transform: rotate(45deg);
|
|
424
436
|
transition: transform 0.2s ease;
|
|
437
|
+
margin-right: 2px;
|
|
425
438
|
}
|
|
426
439
|
|
|
427
440
|
.disclosure[open] > summary::before {
|
|
428
441
|
transform: rotate(-135deg);
|
|
429
442
|
}
|
|
430
443
|
|
|
444
|
+
/* Separator line appears only when expanded */
|
|
445
|
+
.disclosure[open] > summary {
|
|
446
|
+
border-bottom: 1px solid var(--disclosure-border);
|
|
447
|
+
}
|
|
448
|
+
|
|
431
449
|
.disclosure-title {
|
|
432
450
|
display: flex;
|
|
433
451
|
align-items: center;
|
|
@@ -442,7 +460,7 @@
|
|
|
442
460
|
}
|
|
443
461
|
|
|
444
462
|
.disclosure-body {
|
|
445
|
-
padding:
|
|
463
|
+
padding: 10px 16px 14px 20px;
|
|
446
464
|
font-size: var(--disclosure-body-font-size);
|
|
447
465
|
line-height: 1.5;
|
|
448
466
|
color: var(--disclosure-body-color);
|
package/dist/theme/github.css
CHANGED
|
@@ -56,16 +56,16 @@
|
|
|
56
56
|
/* -- Enhanced Blockquote ---------------------------------------------- */
|
|
57
57
|
--blockquote-enhanced-border: #d0d7de;
|
|
58
58
|
--blockquote-enhanced-bg: #f6f8fa;
|
|
59
|
-
--blockquote-enhanced-color: #
|
|
59
|
+
--blockquote-enhanced-color: #24292f;
|
|
60
60
|
--blockquote-padding: 8px 14px;
|
|
61
61
|
--blockquote-margin: 10px 0;
|
|
62
62
|
|
|
63
63
|
/* -- Disclosure Widget ------------------------------------------------ */
|
|
64
64
|
--disclosure-border: #d0d7de;
|
|
65
|
-
--disclosure-bg:
|
|
65
|
+
--disclosure-bg: #f6f8fa;
|
|
66
66
|
--disclosure-title-color: #24292f;
|
|
67
67
|
--disclosure-body-color: inherit;
|
|
68
|
-
--disclosure-radius:
|
|
68
|
+
--disclosure-radius: 8px;
|
|
69
69
|
--disclosure-padding: 8px 12px;
|
|
70
70
|
--disclosure-title-font-size: 1.0625em;
|
|
71
71
|
--disclosure-body-font-size: 1.0625em;
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
--blockquote-enhanced-color: #8b949e;
|
|
118
118
|
|
|
119
119
|
--disclosure-border: #444c56;
|
|
120
|
-
--disclosure-bg:
|
|
120
|
+
--disclosure-bg: #161b22;
|
|
121
121
|
--disclosure-title-color: #e6edf3;
|
|
122
122
|
--disclosure-body-color: inherit;
|
|
123
123
|
}
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
--blockquote-enhanced-color: #8b949e;
|
|
167
167
|
|
|
168
168
|
--disclosure-border: #444c56;
|
|
169
|
-
--disclosure-bg:
|
|
169
|
+
--disclosure-bg: #161b22;
|
|
170
170
|
--disclosure-title-color: #e6edf3;
|
|
171
171
|
--disclosure-body-color: inherit;
|
|
172
172
|
}
|
|
@@ -336,12 +336,25 @@
|
|
|
336
336
|
position: relative;
|
|
337
337
|
margin: 0;
|
|
338
338
|
padding: var(--blockquote-padding);
|
|
339
|
-
border-left:
|
|
339
|
+
border-left: none;
|
|
340
340
|
background-color: var(--blockquote-enhanced-bg);
|
|
341
341
|
border-radius: 0 var(--callout-radius) var(--callout-radius) 0;
|
|
342
342
|
color: var(--blockquote-enhanced-color);
|
|
343
343
|
font-style: italic;
|
|
344
344
|
line-height: 1.5;
|
|
345
|
+
overflow: hidden;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/* v1.4.1: Rounded left line via pseudo-element (pill-shaped ends) */
|
|
349
|
+
.blockquote-enhanced blockquote::before {
|
|
350
|
+
content: "";
|
|
351
|
+
position: absolute;
|
|
352
|
+
left: 0;
|
|
353
|
+
top: 0;
|
|
354
|
+
bottom: 0;
|
|
355
|
+
width: 4px;
|
|
356
|
+
background: var(--blockquote-enhanced-border);
|
|
357
|
+
border-radius: 4px;
|
|
345
358
|
}
|
|
346
359
|
|
|
347
360
|
.blockquote-enhanced blockquote > *:first-child { margin-top: 0; }
|
|
@@ -404,19 +417,34 @@
|
|
|
404
417
|
* Always renders as <details>/<summary>.
|
|
405
418
|
*/
|
|
406
419
|
|
|
420
|
+
/* v1.4.1: G-1 design — card with rounded left accent line, no full border */
|
|
407
421
|
.disclosure {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
border
|
|
422
|
+
position: relative;
|
|
423
|
+
margin: 12px 0;
|
|
424
|
+
border: none;
|
|
425
|
+
border-radius: 8px;
|
|
411
426
|
background: var(--disclosure-bg);
|
|
412
427
|
overflow: hidden;
|
|
413
428
|
}
|
|
414
429
|
|
|
430
|
+
/* Rounded left accent line (pill-shaped ends, matching blockquote) */
|
|
431
|
+
.disclosure::before {
|
|
432
|
+
content: "";
|
|
433
|
+
position: absolute;
|
|
434
|
+
left: 0;
|
|
435
|
+
top: 0;
|
|
436
|
+
bottom: 0;
|
|
437
|
+
width: 4px;
|
|
438
|
+
background: var(--disclosure-border);
|
|
439
|
+
border-radius: 4px;
|
|
440
|
+
z-index: 1;
|
|
441
|
+
}
|
|
442
|
+
|
|
415
443
|
.disclosure > summary {
|
|
416
444
|
display: flex;
|
|
417
445
|
align-items: center;
|
|
418
|
-
gap:
|
|
419
|
-
padding:
|
|
446
|
+
gap: 8px;
|
|
447
|
+
padding: 12px 16px 10px 20px;
|
|
420
448
|
font-weight: 600;
|
|
421
449
|
font-size: var(--disclosure-title-font-size);
|
|
422
450
|
line-height: 1.3;
|
|
@@ -424,7 +452,8 @@
|
|
|
424
452
|
cursor: pointer;
|
|
425
453
|
user-select: none;
|
|
426
454
|
list-style: none;
|
|
427
|
-
|
|
455
|
+
border-bottom: 1px solid transparent;
|
|
456
|
+
transition: border-bottom-color 0.15s ease;
|
|
428
457
|
}
|
|
429
458
|
|
|
430
459
|
.disclosure > summary:hover {
|
|
@@ -439,23 +468,29 @@
|
|
|
439
468
|
.disclosure > summary::before {
|
|
440
469
|
content: "";
|
|
441
470
|
flex-shrink: 0;
|
|
442
|
-
width:
|
|
443
|
-
height:
|
|
444
|
-
border-right:
|
|
445
|
-
border-bottom:
|
|
471
|
+
width: 7px;
|
|
472
|
+
height: 7px;
|
|
473
|
+
border-right: 2px solid currentColor;
|
|
474
|
+
border-bottom: 2px solid currentColor;
|
|
446
475
|
transform: rotate(45deg);
|
|
447
476
|
transition: transform 0.2s ease;
|
|
477
|
+
margin-right: 2px;
|
|
448
478
|
}
|
|
449
479
|
|
|
450
480
|
.disclosure[open] > summary::before {
|
|
451
481
|
transform: rotate(-135deg);
|
|
452
482
|
}
|
|
453
483
|
|
|
484
|
+
/* Separator line appears only when expanded */
|
|
485
|
+
.disclosure[open] > summary {
|
|
486
|
+
border-bottom: 1px solid var(--disclosure-border);
|
|
487
|
+
}
|
|
488
|
+
|
|
454
489
|
.disclosure-title {
|
|
455
490
|
display: flex;
|
|
456
491
|
align-items: center;
|
|
457
|
-
gap:
|
|
458
|
-
padding:
|
|
492
|
+
gap: 8px;
|
|
493
|
+
padding: 12px 16px 10px 20px;
|
|
459
494
|
font-weight: 600;
|
|
460
495
|
font-size: var(--disclosure-title-font-size);
|
|
461
496
|
line-height: 1.3;
|
|
@@ -465,9 +500,9 @@
|
|
|
465
500
|
}
|
|
466
501
|
|
|
467
502
|
.disclosure-body {
|
|
468
|
-
padding:
|
|
503
|
+
padding: 10px 16px 14px 20px;
|
|
469
504
|
font-size: var(--disclosure-body-font-size);
|
|
470
|
-
line-height: 1.
|
|
505
|
+
line-height: 1.6;
|
|
471
506
|
color: var(--disclosure-body-color);
|
|
472
507
|
animation: callout-fade-in 0.15s ease-out;
|
|
473
508
|
}
|
|
@@ -516,11 +551,27 @@
|
|
|
516
551
|
* Progressive enhancement: without JS, each disclosure still toggles independently.
|
|
517
552
|
*/
|
|
518
553
|
|
|
554
|
+
/* v1.4.1: Accordion — card container matching disclosure G-1 design */
|
|
519
555
|
.disclosure-accordion {
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
border
|
|
556
|
+
position: relative;
|
|
557
|
+
margin: 12px 0;
|
|
558
|
+
border: none;
|
|
559
|
+
border-radius: 8px;
|
|
523
560
|
overflow: hidden;
|
|
561
|
+
background: var(--disclosure-bg);
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
/* Left accent line for the entire accordion */
|
|
565
|
+
.disclosure-accordion::before {
|
|
566
|
+
content: "";
|
|
567
|
+
position: absolute;
|
|
568
|
+
left: 0;
|
|
569
|
+
top: 0;
|
|
570
|
+
bottom: 0;
|
|
571
|
+
width: 4px;
|
|
572
|
+
background: var(--disclosure-border);
|
|
573
|
+
border-radius: 4px;
|
|
574
|
+
z-index: 1;
|
|
524
575
|
}
|
|
525
576
|
|
|
526
577
|
.disclosure-accordion > .disclosure {
|
|
@@ -529,6 +580,10 @@
|
|
|
529
580
|
border-radius: 0;
|
|
530
581
|
}
|
|
531
582
|
|
|
583
|
+
.disclosure-accordion > .disclosure::before {
|
|
584
|
+
display: none; /* inner disclosures don't need their own left line */
|
|
585
|
+
}
|
|
586
|
+
|
|
532
587
|
/* Connect accordion items with a subtle divider */
|
|
533
588
|
.disclosure-accordion > .disclosure + .disclosure {
|
|
534
589
|
border-top: 1px solid var(--disclosure-border);
|
|
@@ -614,9 +669,12 @@
|
|
|
614
669
|
@media print {
|
|
615
670
|
.callout { box-shadow: none; break-inside: avoid; }
|
|
616
671
|
.callout::before { display: none; }
|
|
617
|
-
.blockquote-enhanced blockquote { background: none;
|
|
618
|
-
.
|
|
619
|
-
.disclosure
|
|
672
|
+
.blockquote-enhanced blockquote { background: none; }
|
|
673
|
+
.blockquote-enhanced blockquote::before { width: 2px; }
|
|
674
|
+
.disclosure { box-shadow: none; }
|
|
675
|
+
.disclosure::before { width: 2px; }
|
|
676
|
+
.disclosure-accordion { box-shadow: none; }
|
|
677
|
+
.disclosure-accordion::before { width: 2px; }
|
|
620
678
|
.disclosure-tree { border-left-width: 1px; }
|
|
621
679
|
}
|
|
622
680
|
|
package/dist/theme/obsidian.css
CHANGED
|
@@ -65,13 +65,13 @@
|
|
|
65
65
|
/* -- Enhanced Blockquote ---------------------------------------------- */
|
|
66
66
|
--blockquote-enhanced-border: #a0a8b8;
|
|
67
67
|
--blockquote-enhanced-bg: rgba(160, 168, 184, 0.05);
|
|
68
|
-
--blockquote-enhanced-color: #
|
|
68
|
+
--blockquote-enhanced-color: #24292f;
|
|
69
69
|
--blockquote-padding: 10px 14px;
|
|
70
70
|
--blockquote-margin: 12px 0;
|
|
71
71
|
|
|
72
72
|
/* -- Disclosure Widget ------------------------------------------------ */
|
|
73
73
|
--disclosure-border: #a0a8b8;
|
|
74
|
-
--disclosure-bg:
|
|
74
|
+
--disclosure-bg: #f6f8fa;
|
|
75
75
|
--disclosure-title-color: #24292f;
|
|
76
76
|
--disclosure-body-color: inherit;
|
|
77
77
|
--disclosure-radius: 8px;
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
|
|
121
121
|
--blockquote-enhanced-border: #5a626c;
|
|
122
122
|
--blockquote-enhanced-bg: rgba(138, 146, 163, 0.08);
|
|
123
|
-
--blockquote-enhanced-color: #
|
|
123
|
+
--blockquote-enhanced-color: #e6edf3;
|
|
124
124
|
|
|
125
125
|
--disclosure-border: #5a626c;
|
|
126
126
|
--disclosure-bg: rgba(138, 146, 163, 0.05);
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
|
|
169
169
|
--blockquote-enhanced-border: #5a626c;
|
|
170
170
|
--blockquote-enhanced-bg: rgba(138, 146, 163, 0.08);
|
|
171
|
-
--blockquote-enhanced-color: #
|
|
171
|
+
--blockquote-enhanced-color: #e6edf3;
|
|
172
172
|
|
|
173
173
|
--disclosure-border: #5a626c;
|
|
174
174
|
--disclosure-bg: rgba(138, 146, 163, 0.05);
|
|
@@ -324,12 +324,25 @@
|
|
|
324
324
|
position: relative;
|
|
325
325
|
margin: 0;
|
|
326
326
|
padding: var(--blockquote-padding);
|
|
327
|
-
border-left:
|
|
327
|
+
border-left: none;
|
|
328
328
|
background-color: var(--blockquote-enhanced-bg);
|
|
329
329
|
border-radius: 0 var(--callout-radius) var(--callout-radius) 0;
|
|
330
330
|
color: var(--blockquote-enhanced-color);
|
|
331
331
|
font-style: italic;
|
|
332
332
|
line-height: 1.5;
|
|
333
|
+
overflow: hidden;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/* v1.4.1: Rounded left line via pseudo-element (pill-shaped ends) */
|
|
337
|
+
.blockquote-enhanced blockquote::before {
|
|
338
|
+
content: "";
|
|
339
|
+
position: absolute;
|
|
340
|
+
left: 0;
|
|
341
|
+
top: 0;
|
|
342
|
+
bottom: 0;
|
|
343
|
+
width: 4px;
|
|
344
|
+
background: var(--blockquote-enhanced-border);
|
|
345
|
+
border-radius: 4px;
|
|
333
346
|
}
|
|
334
347
|
|
|
335
348
|
.blockquote-enhanced blockquote > *:first-child { margin-top: 0; }
|
|
@@ -395,7 +408,7 @@
|
|
|
395
408
|
display: flex;
|
|
396
409
|
align-items: center;
|
|
397
410
|
gap: 6px;
|
|
398
|
-
padding:
|
|
411
|
+
padding: 12px 16px 10px 20px;
|
|
399
412
|
font-weight: 600;
|
|
400
413
|
font-size: var(--disclosure-title-font-size);
|
|
401
414
|
line-height: 1.3;
|
|
@@ -403,7 +416,8 @@
|
|
|
403
416
|
cursor: pointer;
|
|
404
417
|
user-select: none;
|
|
405
418
|
list-style: none;
|
|
406
|
-
|
|
419
|
+
border-bottom: 1px solid transparent;
|
|
420
|
+
transition: border-bottom-color 0.15s ease;
|
|
407
421
|
}
|
|
408
422
|
|
|
409
423
|
.disclosure > summary:hover {
|
|
@@ -416,18 +430,24 @@
|
|
|
416
430
|
.disclosure > summary::before {
|
|
417
431
|
content: "";
|
|
418
432
|
flex-shrink: 0;
|
|
419
|
-
width:
|
|
420
|
-
height:
|
|
421
|
-
border-right:
|
|
422
|
-
border-bottom:
|
|
433
|
+
width: 7px;
|
|
434
|
+
height: 7px;
|
|
435
|
+
border-right: 2px solid currentColor;
|
|
436
|
+
border-bottom: 2px solid currentColor;
|
|
423
437
|
transform: rotate(45deg);
|
|
424
438
|
transition: transform 0.2s ease;
|
|
439
|
+
margin-right: 2px;
|
|
425
440
|
}
|
|
426
441
|
|
|
427
442
|
.disclosure[open] > summary::before {
|
|
428
443
|
transform: rotate(-135deg);
|
|
429
444
|
}
|
|
430
445
|
|
|
446
|
+
/* Separator line appears only when expanded */
|
|
447
|
+
.disclosure[open] > summary {
|
|
448
|
+
border-bottom: 1px solid var(--disclosure-border);
|
|
449
|
+
}
|
|
450
|
+
|
|
431
451
|
.disclosure-title {
|
|
432
452
|
display: flex;
|
|
433
453
|
align-items: center;
|
|
@@ -442,7 +462,7 @@
|
|
|
442
462
|
}
|
|
443
463
|
|
|
444
464
|
.disclosure-body {
|
|
445
|
-
padding:
|
|
465
|
+
padding: 10px 16px 14px 20px;
|
|
446
466
|
font-size: var(--disclosure-body-font-size);
|
|
447
467
|
line-height: 1.5;
|
|
448
468
|
color: var(--disclosure-body-color);
|
package/dist/theme/vitepress.css
CHANGED
|
@@ -66,13 +66,13 @@
|
|
|
66
66
|
/* -- Enhanced Blockquote ---------------------------------------------- */
|
|
67
67
|
--blockquote-enhanced-border: #d0d7de;
|
|
68
68
|
--blockquote-enhanced-bg: #f6f8fa;
|
|
69
|
-
--blockquote-enhanced-color: #
|
|
69
|
+
--blockquote-enhanced-color: #24292f;
|
|
70
70
|
--blockquote-padding: 16px 20px;
|
|
71
71
|
--blockquote-margin: 16px 0;
|
|
72
72
|
|
|
73
73
|
/* -- Disclosure Widget ------------------------------------------------ */
|
|
74
74
|
--disclosure-border: #d0d7de;
|
|
75
|
-
--disclosure-bg:
|
|
75
|
+
--disclosure-bg: #f6f8fa;
|
|
76
76
|
--disclosure-title-color: #24292f;
|
|
77
77
|
--disclosure-body-color: inherit;
|
|
78
78
|
--disclosure-radius: 0;
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
|
|
121
121
|
--blockquote-enhanced-border: #444c56;
|
|
122
122
|
--blockquote-enhanced-bg: #161b22;
|
|
123
|
-
--blockquote-enhanced-color: #
|
|
123
|
+
--blockquote-enhanced-color: #e6edf3;
|
|
124
124
|
|
|
125
125
|
--disclosure-border: #444c56;
|
|
126
126
|
--disclosure-title-color: #e6edf3;
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
|
|
166
166
|
--blockquote-enhanced-border: #444c56;
|
|
167
167
|
--blockquote-enhanced-bg: #161b22;
|
|
168
|
-
--blockquote-enhanced-color: #
|
|
168
|
+
--blockquote-enhanced-color: #e6edf3;
|
|
169
169
|
|
|
170
170
|
--disclosure-border: #444c56;
|
|
171
171
|
--disclosure-title-color: #e6edf3;
|
|
@@ -325,6 +325,19 @@
|
|
|
325
325
|
color: var(--blockquote-enhanced-color);
|
|
326
326
|
font-style: italic;
|
|
327
327
|
line-height: 1.5;
|
|
328
|
+
overflow: hidden;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/* v1.4.1: Rounded left line via pseudo-element (pill-shaped ends) */
|
|
332
|
+
.blockquote-enhanced blockquote::before {
|
|
333
|
+
content: "";
|
|
334
|
+
position: absolute;
|
|
335
|
+
left: 0;
|
|
336
|
+
top: 0;
|
|
337
|
+
bottom: 0;
|
|
338
|
+
width: 4px;
|
|
339
|
+
background: var(--blockquote-enhanced-border);
|
|
340
|
+
border-radius: 4px;
|
|
328
341
|
}
|
|
329
342
|
|
|
330
343
|
.blockquote-enhanced blockquote > *:first-child { margin-top: 0; }
|
|
@@ -411,18 +424,24 @@
|
|
|
411
424
|
.disclosure > summary::before {
|
|
412
425
|
content: "";
|
|
413
426
|
flex-shrink: 0;
|
|
414
|
-
width:
|
|
415
|
-
height:
|
|
416
|
-
border-right:
|
|
417
|
-
border-bottom:
|
|
427
|
+
width: 7px;
|
|
428
|
+
height: 7px;
|
|
429
|
+
border-right: 2px solid currentColor;
|
|
430
|
+
border-bottom: 2px solid currentColor;
|
|
418
431
|
transform: rotate(45deg);
|
|
419
432
|
transition: transform 0.2s ease;
|
|
433
|
+
margin-right: 2px;
|
|
420
434
|
}
|
|
421
435
|
|
|
422
436
|
.disclosure[open] > summary::before {
|
|
423
437
|
transform: rotate(-135deg);
|
|
424
438
|
}
|
|
425
439
|
|
|
440
|
+
/* Separator line appears only when expanded */
|
|
441
|
+
.disclosure[open] > summary {
|
|
442
|
+
border-bottom: 1px solid var(--disclosure-border);
|
|
443
|
+
}
|
|
444
|
+
|
|
426
445
|
.disclosure-title {
|
|
427
446
|
display: flex;
|
|
428
447
|
align-items: center;
|
|
@@ -437,7 +456,7 @@
|
|
|
437
456
|
}
|
|
438
457
|
|
|
439
458
|
.disclosure-body {
|
|
440
|
-
padding:
|
|
459
|
+
padding: 10px 16px 14px 20px;
|
|
441
460
|
font-size: var(--disclosure-body-font-size);
|
|
442
461
|
line-height: 1.5;
|
|
443
462
|
color: var(--disclosure-body-color);
|
|
@@ -569,8 +588,8 @@
|
|
|
569
588
|
@media print {
|
|
570
589
|
.callout { box-shadow: none; break-inside: avoid; }
|
|
571
590
|
.blockquote-enhanced blockquote { background: none; border-left-width: 2px; }
|
|
572
|
-
.disclosure {
|
|
573
|
-
.disclosure-accordion {
|
|
591
|
+
.disclosure::before { width: 2px; }
|
|
592
|
+
.disclosure-accordion::before { width: 2px; }
|
|
574
593
|
.disclosure-tree { border-left-width: 1px; }
|
|
575
594
|
}
|
|
576
595
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dr-ishaan/remake-blocks",
|
|
3
|
-
"version": "1.4.
|
|
4
|
-
"description": "Astro 6 + remark plugin
|
|
3
|
+
"version": "1.4.2",
|
|
4
|
+
"description": "Astro 6 + remark plugin — 27 callout types, 4 themes, disclosure widgets, inline callouts, directive syntax, MkDocs syntax, i18n labels, safe-by-default XSS escaping, WCAG accessibility, Lucide/emoji icons",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|