@miragon/slidev-toolkit 1.4.0 → 1.5.1
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 +58 -2
- package/components/Step.vue +29 -2
- package/components/StepList.vue +4 -3
- 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,37 @@ const ACCENTS: Record<string, string> = {
|
|
|
65
90
|
line-height: 1.55;
|
|
66
91
|
color: #4b5563;
|
|
67
92
|
}
|
|
93
|
+
/* Blank-line-wrapped inline Markdown emits a <p>; normalise it to the card body size (no prose bloat). */
|
|
94
|
+
.mg-card__body :deep(p) {
|
|
95
|
+
margin: 0;
|
|
96
|
+
font-size: inherit;
|
|
97
|
+
line-height: inherit;
|
|
98
|
+
}
|
|
99
|
+
.mg-card__body :deep(p + p) { margin-top: 0.6em; }
|
|
100
|
+
/* Same for bullet lists: normalise to the body size with a small blue square marker (like the content layout). */
|
|
101
|
+
.mg-card__body :deep(ul) {
|
|
102
|
+
list-style: none;
|
|
103
|
+
margin: 0;
|
|
104
|
+
padding: 0;
|
|
105
|
+
}
|
|
106
|
+
.mg-card__body :deep(li) {
|
|
107
|
+
position: relative;
|
|
108
|
+
font-size: inherit;
|
|
109
|
+
line-height: inherit;
|
|
110
|
+
padding-left: 1.1rem;
|
|
111
|
+
margin: 0;
|
|
112
|
+
}
|
|
113
|
+
.mg-card__body :deep(li + li) { margin-top: 0.4em; }
|
|
114
|
+
.mg-card__body :deep(li)::before {
|
|
115
|
+
content: '';
|
|
116
|
+
position: absolute;
|
|
117
|
+
left: 0;
|
|
118
|
+
top: 0.55em;
|
|
119
|
+
width: 0.4rem;
|
|
120
|
+
height: 0.4rem;
|
|
121
|
+
border-radius: 0.1rem;
|
|
122
|
+
background: var(--miragon-blue);
|
|
123
|
+
}
|
|
68
124
|
.mg-card--compact .mg-card__body { flex: 1 1 auto; display: flex; flex-direction: column; }
|
|
69
125
|
/* A trailing diagram (<Figure src>) docks at the card bottom, so the image sits at
|
|
70
126
|
the same position in every card of a stretched grid regardless of text length. */
|
package/components/Step.vue
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
/**
|
|
3
|
-
* Step — eine Zeile in einer <StepList>:
|
|
3
|
+
* Step — eine Zeile in einer <StepList>: nummeriertes Badge + fett gesetztes
|
|
4
|
+
* Label + Fließtext. Die Nummer kommt aus einem CSS-Counter, den die StepList
|
|
5
|
+
* zurücksetzt und jeder Step erhöht (kein index-Prop nötig).
|
|
4
6
|
* Das Label nutzt die primäre Textfarbe, der Body erbt die Farbe der StepList.
|
|
5
7
|
* <Step label="Client">ruft … auf</Step>
|
|
6
8
|
*/
|
|
@@ -8,10 +10,35 @@ defineProps<{ label?: string }>()
|
|
|
8
10
|
</script>
|
|
9
11
|
|
|
10
12
|
<template>
|
|
11
|
-
<div class="step"
|
|
13
|
+
<div class="step">
|
|
14
|
+
<span class="step__marker" aria-hidden="true"></span>
|
|
15
|
+
<span class="step__body"><strong v-if="label" class="step__label">{{ label }}:</strong> <slot /></span>
|
|
16
|
+
</div>
|
|
12
17
|
</template>
|
|
13
18
|
|
|
14
19
|
<style scoped>
|
|
20
|
+
.step {
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: baseline;
|
|
23
|
+
gap: 0.6rem;
|
|
24
|
+
counter-increment: miragon-step;
|
|
25
|
+
}
|
|
26
|
+
.step__marker {
|
|
27
|
+
flex: 0 0 auto;
|
|
28
|
+
align-self: flex-start;
|
|
29
|
+
width: 1.5rem;
|
|
30
|
+
height: 1.5rem;
|
|
31
|
+
border-radius: 50%;
|
|
32
|
+
background: var(--miragon-blue);
|
|
33
|
+
color: #fff;
|
|
34
|
+
font-size: 0.75rem;
|
|
35
|
+
font-weight: 700;
|
|
36
|
+
line-height: 1.5rem;
|
|
37
|
+
text-align: center;
|
|
38
|
+
}
|
|
39
|
+
.step__marker::before {
|
|
40
|
+
content: counter(miragon-step);
|
|
41
|
+
}
|
|
15
42
|
.step__label {
|
|
16
43
|
font-weight: 700;
|
|
17
44
|
color: var(--miragon-text-primary);
|
package/components/StepList.vue
CHANGED
|
@@ -20,9 +20,10 @@
|
|
|
20
20
|
.step-list {
|
|
21
21
|
display: flex;
|
|
22
22
|
flex-direction: column;
|
|
23
|
-
gap: 0.
|
|
24
|
-
font-size:
|
|
25
|
-
line-height: 1.
|
|
23
|
+
gap: 0.95rem;
|
|
24
|
+
font-size: 1.2rem;
|
|
25
|
+
line-height: 1.5;
|
|
26
26
|
color: var(--miragon-text-secondary);
|
|
27
|
+
counter-reset: miragon-step;
|
|
27
28
|
}
|
|
28
29
|
</style>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miragon/slidev-toolkit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
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
|
+
}
|