@miragon/slidev-toolkit 1.4.0 → 1.5.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/components/Card.vue +38 -2
- package/package.json +1 -1
- package/styles/code.css +17 -0
package/components/Card.vue
CHANGED
|
@@ -10,14 +10,28 @@
|
|
|
10
10
|
* 3 Karten: blue, teal, green
|
|
11
11
|
* 4 Karten: blue, blue-mid, green-deep, green
|
|
12
12
|
* <Card title="Deployment" accent="blue">Body …</Card>
|
|
13
|
+
*
|
|
14
|
+
* `icon` (optional): eine Iconify-UnoCSS-Klasse (`i-carbon-idea`, `i-ph-cube`, …).
|
|
15
|
+
* Wird sie gesetzt, erscheint das Icon über dem Titel und trägt dieselbe
|
|
16
|
+
* Akzentfarbe; ohne `icon` bleibt die Karte wie bisher rein textuell.
|
|
17
|
+
* Der volle Klassenname muss so im Slide stehen, damit UnoCSS ihn beim
|
|
18
|
+
* statischen Scan findet und generiert (Brand-Regel: Iconify `i-*`, kein Emoji).
|
|
19
|
+
* <Card title="Deployment" accent="blue" icon="i-carbon-rocket">Body …</Card>
|
|
20
|
+
*
|
|
21
|
+
* `align` (optional): richtet Icon, Titel und Body aus — `left` (Standard),
|
|
22
|
+
* `center` oder `right`. Betrifft nur die horizontale Ausrichtung des Inhalts;
|
|
23
|
+
* Hintergrund, Akzentlogik und alles andere bleiben unverändert.
|
|
24
|
+
* <Card title="Deployment" accent="blue" align="center">Body …</Card>
|
|
13
25
|
*/
|
|
14
26
|
const props = withDefaults(
|
|
15
27
|
defineProps<{
|
|
16
28
|
title?: string
|
|
17
29
|
accent?: 'blue' | 'blue-mid' | 'teal' | 'green-deep' | 'green-mid' | 'green'
|
|
18
30
|
padding?: 'compact' | 'standard' | 'generous'
|
|
31
|
+
icon?: string
|
|
32
|
+
align?: 'left' | 'center' | 'right'
|
|
19
33
|
}>(),
|
|
20
|
-
{ accent: 'blue', padding: 'standard' },
|
|
34
|
+
{ accent: 'blue', padding: 'standard', align: 'left' },
|
|
21
35
|
)
|
|
22
36
|
|
|
23
37
|
// Die §6.3-Progressions-Stops. Bewusst lokal: der einzige sanktionierte Hex-Ort.
|
|
@@ -32,7 +46,8 @@ const ACCENTS: Record<string, string> = {
|
|
|
32
46
|
</script>
|
|
33
47
|
|
|
34
48
|
<template>
|
|
35
|
-
<div class="mg-card" :class="`mg-card--${props.padding}`">
|
|
49
|
+
<div class="mg-card" :class="[`mg-card--${props.padding}`, `mg-card--align-${props.align}`]">
|
|
50
|
+
<span v-if="icon" class="mg-card__icon" :class="icon" :style="{ color: ACCENTS[props.accent] }" aria-hidden="true"></span>
|
|
36
51
|
<h3 v-if="title" class="mg-card__title" :style="{ color: ACCENTS[props.accent] }">{{ title }}</h3>
|
|
37
52
|
<div class="mg-card__body"><slot /></div>
|
|
38
53
|
</div>
|
|
@@ -53,6 +68,16 @@ const ACCENTS: Record<string, string> = {
|
|
|
53
68
|
.mg-card--compact { padding: 1rem; display: flex; flex-direction: column; }
|
|
54
69
|
.mg-card--standard { padding: 1.25rem; }
|
|
55
70
|
.mg-card--generous { padding: 1.5rem; }
|
|
71
|
+
.mg-card--align-center { text-align: center; }
|
|
72
|
+
.mg-card--align-right { text-align: right; }
|
|
73
|
+
.mg-card--align-center .mg-card__icon { margin-left: auto; margin-right: auto; }
|
|
74
|
+
.mg-card--align-right .mg-card__icon { margin-left: auto; }
|
|
75
|
+
|
|
76
|
+
.mg-card__icon {
|
|
77
|
+
display: block;
|
|
78
|
+
font-size: 1.6rem;
|
|
79
|
+
margin-bottom: 0.6rem;
|
|
80
|
+
}
|
|
56
81
|
.mg-card__title {
|
|
57
82
|
margin: 0;
|
|
58
83
|
font-weight: 700;
|
|
@@ -65,6 +90,17 @@ const ACCENTS: Record<string, string> = {
|
|
|
65
90
|
line-height: 1.55;
|
|
66
91
|
color: #4b5563;
|
|
67
92
|
}
|
|
93
|
+
/* Wrapping the body in blank lines (required for inline Markdown — `code`, **bold**,
|
|
94
|
+
links — to render inside the slot; see the slides skill) makes Markdown emit a
|
|
95
|
+
<p>. Left alone it would inherit Slidev's larger prose paragraph size and default
|
|
96
|
+
margins, so a block-form card would look different from a tight one. Normalise it:
|
|
97
|
+
inherit the card body size, no outer margins, even spacing between paragraphs. */
|
|
98
|
+
.mg-card__body :deep(p) {
|
|
99
|
+
margin: 0;
|
|
100
|
+
font-size: inherit;
|
|
101
|
+
line-height: inherit;
|
|
102
|
+
}
|
|
103
|
+
.mg-card__body :deep(p + p) { margin-top: 0.6em; }
|
|
68
104
|
.mg-card--compact .mg-card__body { flex: 1 1 auto; display: flex; flex-direction: column; }
|
|
69
105
|
/* A trailing diagram (<Figure src>) docks at the card bottom, so the image sits at
|
|
70
106
|
the same position in every card of a stretched grid regardless of text length. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miragon/slidev-toolkit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Miragon Slidev toolkit: the brand theme, the layout archetypes, the reusable components (Card, CardGrid, StepList, Figure, SplitView) and the BrandMeshBackground animation. Single source of design truth, consumed by the reference deck in this repo.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"slidev-theme",
|
package/styles/code.css
CHANGED
|
@@ -31,3 +31,20 @@
|
|
|
31
31
|
color: var(--miragon-text-muted);
|
|
32
32
|
font-size: 0.8rem;
|
|
33
33
|
}
|
|
34
|
+
|
|
35
|
+
/* Inline code (`like this`) — a small on-brand chip in Geist Mono. Without this
|
|
36
|
+
rule inline code falls back to Slidev/UnoCSS defaults (a lavender pill in a
|
|
37
|
+
generic mono face). `:not(pre) > code` matches only inline spans, never the
|
|
38
|
+
<code> inside a Shiki fence (that lives under <pre>), so fences keep their
|
|
39
|
+
frame above. Applies everywhere the same way, including inside <Card> bodies.
|
|
40
|
+
NOTE: for inline code to render at all inside a component (<Card>, …), the
|
|
41
|
+
body must be wrapped in blank lines — see the slides skill. */
|
|
42
|
+
:not(pre) > code {
|
|
43
|
+
font-family: var(--miragon-font-mono);
|
|
44
|
+
font-size: 0.85em;
|
|
45
|
+
color: var(--miragon-blue-dark);
|
|
46
|
+
background: var(--miragon-blue-light);
|
|
47
|
+
border: 1px solid #e5e7eb;
|
|
48
|
+
border-radius: 0.35rem;
|
|
49
|
+
padding: 0.1em 0.35em;
|
|
50
|
+
}
|