Skip to content

Commit 0a3208d

Browse files
committed
docs: enhance blockquote styling with alert support
Improve blockquote design: - Increase padding and add border-radius for better visual appeal - Add subtle box-shadow for depth - Support GitHub-style alerts (Note, Tip, Important, Warning, Caution) - Color-coded left borders for each alert type: - Note: blue - Tip: green - Important: purple - Warning: orange - Caution: red - Better paragraph spacing within blockquotes Usage: > **Note**: This is a note > **Warning**: This is a warning > **Tip**: This is a tip
1 parent d6f1631 commit 0a3208d

File tree

1 file changed

+75
-8
lines changed

1 file changed

+75
-8
lines changed

docs/theme/custom.css

Lines changed: 75 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -291,17 +291,84 @@ table code {
291291
font-size: 0.9em;
292292
}
293293

294-
/* Blockquotes (callout style) */
294+
/* Blockquotes with GitHub-style alerts support */
295295
blockquote {
296-
border: 1px solid var(--color-border) !important;
297-
border-left: 4px solid var(--color-plan-mode) !important;
298-
background: color-mix(in srgb, var(--color-background-secondary), white 1.5%) !important;
299-
padding: 0.5rem 0.6rem;
300-
margin: 1.2rem 0;
301-
color: color-mix(in srgb, var(--color-text), white 6%) !important;
296+
border: 1px solid var(--color-border);
297+
border-left: 4px solid var(--color-plan-mode);
298+
background: color-mix(in srgb, var(--color-background-secondary), white 2%);
299+
padding: 1rem 1.2rem;
300+
margin: 1.5rem 0;
301+
border-radius: var(--radius-md);
302+
color: var(--color-text);
303+
box-shadow: var(--shadow-1);
304+
}
305+
306+
blockquote p {
307+
margin: 0.5rem 0;
308+
}
309+
310+
blockquote p:first-child {
311+
margin-top: 0;
312+
}
313+
314+
blockquote p:last-child {
315+
margin-bottom: 0;
316+
}
317+
318+
/* GitHub-style alert callouts */
319+
/* NOTE: blue */
320+
blockquote:has(p:first-child > strong:first-child:is([class*="Note"], [class*="note"])),
321+
blockquote > p:first-child:has(strong:first-child:is([class*="Note"], [class*="note"])) {
322+
border-left-color: hsl(210 70% 50%);
323+
}
324+
blockquote:has(p:first-child > strong:first-child:is([class*="Note"], [class*="note"])) p:first-child strong:first-child,
325+
blockquote > p:first-child strong:first-child:is([class*="Note"], [class*="note"]) {
326+
color: hsl(210 70% 60%) !important;
302327
}
328+
329+
/* TIP: green */
330+
blockquote:has(p:first-child > strong:first-child:is([class*="Tip"], [class*="TIP"])),
331+
blockquote > p:first-child:has(strong:first-child:is([class*="Tip"], [class*="TIP"])) {
332+
border-left-color: hsl(120 50% 45%);
333+
}
334+
blockquote:has(p:first-child > strong:first-child:is([class*="Tip"], [class*="TIP"])) p:first-child strong:first-child,
335+
blockquote > p:first-child strong:first-child:is([class*="Tip"], [class*="TIP"]) {
336+
color: hsl(120 50% 55%) !important;
337+
}
338+
339+
/* IMPORTANT: purple */
340+
blockquote:has(p:first-child > strong:first-child:is([class*="Important"], [class*="IMPORTANT"])),
341+
blockquote > p:first-child:has(strong:first-child:is([class*="Important"], [class*="IMPORTANT"])) {
342+
border-left-color: hsl(268 94% 60%);
343+
}
344+
blockquote:has(p:first-child > strong:first-child:is([class*="Important"], [class*="IMPORTANT"])) p:first-child strong:first-child,
345+
blockquote > p:first-child strong:first-child:is([class*="Important"], [class*="IMPORTANT"]) {
346+
color: hsl(268 94% 65%) !important;
347+
}
348+
349+
/* WARNING: orange/yellow */
350+
blockquote:has(p:first-child > strong:first-child:is([class*="Warning"], [class*="WARNING"])),
351+
blockquote > p:first-child:has(strong:first-child:is([class*="Warning"], [class*="WARNING"])) {
352+
border-left-color: hsl(38 92% 50%);
353+
}
354+
blockquote:has(p:first-child > strong:first-child:is([class*="Warning"], [class*="WARNING"])) p:first-child strong:first-child,
355+
blockquote > p:first-child strong:first-child:is([class*="Warning"], [class*="WARNING"]) {
356+
color: hsl(38 92% 60%) !important;
357+
}
358+
359+
/* CAUTION: red */
360+
blockquote:has(p:first-child > strong:first-child:is([class*="Caution"], [class*="CAUTION"])),
361+
blockquote > p:first-child:has(strong:first-child:is([class*="Caution"], [class*="CAUTION"])) {
362+
border-left-color: hsl(0 70% 55%);
363+
}
364+
blockquote:has(p:first-child > strong:first-child:is([class*="Caution"], [class*="CAUTION"])) p:first-child strong:first-child,
365+
blockquote > p:first-child strong:first-child:is([class*="Caution"], [class*="CAUTION"]) {
366+
color: hsl(0 70% 60%) !important;
367+
}
368+
369+
/* Default strong styling in blockquotes */
303370
blockquote strong {
304-
color: var(--color-plan-mode) !important;
371+
color: var(--color-plan-mode);
305372
}
306373

307374
/* kbd (for keybinds page) */

0 commit comments

Comments
 (0)