@miragon/slidev-toolkit 1.3.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/components/CardGrid.vue +1 -0
- package/components/SplitView.vue +1 -0
- package/package.json +1 -1
- package/styles/code.css +17 -0
- package/styles/index.css +1 -0
- package/styles/table.css +62 -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/components/CardGrid.vue
CHANGED
package/components/SplitView.vue
CHANGED
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
|
+
}
|
package/styles/index.css
CHANGED
package/styles/table.css
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/* Tables — Miragon CI frame for native Markdown tables.
|
|
2
|
+
*
|
|
3
|
+
* A Markdown table (`| a | b |`) is plain markdown, so it needs no component and
|
|
4
|
+
* keeps the slide source clean (it passes the no-raw-html check). This file gives
|
|
5
|
+
* every rendered `<table>` the same white-card treatment the <Card> component and
|
|
6
|
+
* code fences use: white surface, thin grey border, soft blue brand shadow,
|
|
7
|
+
* rounded corners. Header text stays BLACK (the heading rule); the single
|
|
8
|
+
* restrained accent is the blue rule under the header row. Body text is Geist
|
|
9
|
+
* Mono, matching the "Geist Mono for code and tables" CI invariant.
|
|
10
|
+
*
|
|
11
|
+
* Anchor: `#slideshow` is the single container that wraps EVERY slide page
|
|
12
|
+
* (`#slideshow > .slidev-page > <layout root>`), so this reaches tables in every
|
|
13
|
+
* layout — including the custom ones (`content`, `compare`, …) whose root is NOT
|
|
14
|
+
* `.slidev-layout`. Slidev's own defaults live on `.slidev-layout table`
|
|
15
|
+
* (specificity 0,1,1); anchoring on the `#slideshow` id (1,0,1) wins the cascade
|
|
16
|
+
* regardless of load order, without needing `!important`. Column alignment
|
|
17
|
+
* (`:---`, `---:`, `:--:`) is emitted by markdown-it as an inline `text-align`
|
|
18
|
+
* style, so it keeps working on top of these rules with no extra selectors.
|
|
19
|
+
*
|
|
20
|
+
* Colours come from theme.css; the only literal hex are the shared border/row
|
|
21
|
+
* neutrals already used across the toolkit (see code.css).
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
#slideshow table {
|
|
25
|
+
border-collapse: separate;
|
|
26
|
+
border-spacing: 0;
|
|
27
|
+
width: auto;
|
|
28
|
+
margin: 0.5rem 0 1.25rem;
|
|
29
|
+
font-family: var(--miragon-font-mono);
|
|
30
|
+
font-size: 0.95rem;
|
|
31
|
+
line-height: 1.5;
|
|
32
|
+
background: var(--miragon-white);
|
|
33
|
+
border: 1px solid #e5e7eb;
|
|
34
|
+
border-radius: 0.6rem;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
box-shadow: 0 8px 20px rgba(51, 93, 229, 0.06);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* Header row: black label, restrained blue accent rule underneath. */
|
|
40
|
+
#slideshow thead th {
|
|
41
|
+
color: var(--miragon-text-primary);
|
|
42
|
+
font-weight: 700;
|
|
43
|
+
background: var(--miragon-blue-light);
|
|
44
|
+
border-bottom: 2px solid var(--miragon-blue);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
#slideshow th,
|
|
48
|
+
#slideshow td {
|
|
49
|
+
padding: 0.55rem 1.1rem;
|
|
50
|
+
text-align: left;
|
|
51
|
+
color: var(--miragon-text-secondary);
|
|
52
|
+
border-bottom: 1px solid #eef1f5;
|
|
53
|
+
vertical-align: top;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Subtle zebra striping for scannability; last row carries no divider. */
|
|
57
|
+
#slideshow tbody tr:nth-child(even) td {
|
|
58
|
+
background: var(--miragon-gray-light);
|
|
59
|
+
}
|
|
60
|
+
#slideshow tbody tr:last-child td {
|
|
61
|
+
border-bottom: none;
|
|
62
|
+
}
|