@codename/deck 0.3.0 → 0.4.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/dist/deck.css CHANGED
@@ -43,6 +43,8 @@
43
43
  .deck-slide [data-align="center"] { text-align: center; }
44
44
  .deck-block { position: relative; flex: 1 1 auto; min-block-size: 12cqi; overflow: hidden; }
45
45
  .deck-block .deck-chart, .deck-block .deck-diagram { position: absolute; inset: 0; display: grid; place-items: center; }
46
+ /* A diagram's picture held to its box, its track sized so its share of it can be. */
47
+ .deck-block .deck-diagram { grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
46
48
  .deck-block .deck-diagram img { max-inline-size: 100%; max-block-size: 100%; }
47
49
  .deck-block .deck-block-source { display: none; }
48
50
  .deck-block.is-failed .deck-block-source { display: block; }
@@ -79,9 +81,113 @@
79
81
  .deck-slide[data-title="huge"] :is(h2, .deck-h2) { font-size: 2.4em; }
80
82
  /* What the usual layouts add to their definition: Slidev's looks for them. */
81
83
  .deck-layout-section .deck-slot::before { content: ""; display: block; inline-size: 3em; block-size: 0.3em; background: var(--deck-fill); margin-block-end: 0.8em; border-radius: 0.15em; }
84
+ .deck-layout-subsection .deck-slot::before { content: ""; display: block; inline-size: 2em; block-size: 0.2em; background: var(--deck-primary); margin-block-end: 0.7em; border-radius: 0.1em; }
82
85
  .deck-layout-statement :is(h1, h2, p, .deck-h1, .deck-h2) { font-size: 2.4em; font-family: var(--deck-heading); font-weight: 700; line-height: 1.2; }
83
86
  .deck-slide.deck-layout-fact :is(h1, .deck-h1) { font-size: 5em; color: var(--deck-primary); margin-block-end: 0.15em; }
84
87
  .deck-layout-quote blockquote { font-size: 1.7em; border: 0; padding: 0; font-family: var(--deck-heading); }
88
+ /* A mind map (mindmap.js): its words where its layout puts them, in em of its own type, the whole shrunk to its box; its
89
+ root on the fill, each branch in a colour of the charts', its lines and its first words' rim. */
90
+ .deck-mindmap { position: relative; flex: 1 1 auto; align-self: stretch; min-block-size: 12cqi; overflow: hidden; }
91
+ .deck-map-plane { position: absolute; top: 50%; left: 50%; translate: -50% -50%; }
92
+ .deck-map-lines { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; overflow: visible; }
93
+ .deck-map-lines path { fill: none; stroke: var(--deck-map-colour); stroke-width: 0.07; stroke-linecap: round; }
94
+ .deck-map-lines path[data-depth="1"] { stroke-width: 0.15; }
95
+ .deck-slide .deck-map-tree, .deck-slide .deck-map-tree :is(ul, li) { margin: 0; padding: 0; list-style: none; }
96
+ .deck-slide .deck-mindmap .deck-map-node { position: absolute; inline-size: max-content; max-inline-size: 11em; margin: 0; padding: 0.15em 0.35em; font-family: var(--deck-body); font-size: 0.85em; font-weight: 400; line-height: 1.2; letter-spacing: 0; text-align: center; text-wrap: balance; color: inherit; }
97
+ /* A chart or a diagram in a node, under its words, at a size of its own. */
98
+ .deck-slide .deck-mindmap .deck-map-node.has-block[data-depth] { display: flex; flex-direction: column; align-items: center; gap: 0.2em; max-inline-size: none; }
99
+ .deck-slide .deck-mindmap .deck-map-node .deck-block { flex: none; inline-size: 13em; block-size: 7.5em; min-block-size: 0; margin: 0; font-size: 0.85em; }
100
+ /* Words wrapped beyond the first branches keep to the side their line comes from. */
101
+ .deck-slide .deck-mindmap .deck-map-node[data-side="right"]:not([data-depth="1"]) { text-align: left; }
102
+ .deck-slide .deck-mindmap .deck-map-node[data-side="left"]:not([data-depth="1"]) { text-align: right; }
103
+ .deck-slide .deck-mindmap .deck-map-node[data-depth="0"] { max-inline-size: 9em; padding: 0.55em 1em; font-family: var(--deck-heading); font-size: 1.35em; font-weight: 700; background: var(--deck-fill); color: var(--deck-on-fill); border-radius: 1.2em; }
104
+ .deck-slide .deck-mindmap .deck-map-node[data-depth="0"]:empty { inline-size: 0.8em; block-size: 0.8em; padding: 0; border-radius: 50%; }
105
+ .deck-slide .deck-mindmap .deck-map-node[data-depth="1"] { max-inline-size: 9em; padding: 0.3em 0.8em; font-size: 1em; font-weight: 600; background: color-mix(in srgb, var(--deck-map-colour) 14%, transparent); border: 0.12em solid var(--deck-map-colour); border-radius: 1em; }
106
+ .deck-mindmap [data-branch="1"] { --deck-map-colour: var(--deck-series-1); }
107
+ .deck-mindmap [data-branch="2"] { --deck-map-colour: var(--deck-series-2); }
108
+ .deck-mindmap [data-branch="3"] { --deck-map-colour: var(--deck-series-3); }
109
+ .deck-mindmap [data-branch="4"] { --deck-map-colour: var(--deck-series-4); }
110
+ .deck-mindmap [data-branch="5"] { --deck-map-colour: var(--deck-series-5); }
111
+ .deck-mindmap [data-branch="6"] { --deck-map-colour: var(--deck-series-6); }
112
+ /* A branch shown a click fades in where it is: moved, its words would be placed from it. */
113
+ .deck-mindmap .deck-step:not(.is-on) { translate: none; }
114
+ /* Figures (figures.js): a slot's lists as cards, key figures, a timeline, chevrons, a programme, a pyramid or a bento;
115
+ its parts face to face or in a matrix; the deck's contents. In em of the slot's type, so they shrink with it. */
116
+ .deck-figure { flex: 1 1 auto; min-block-size: 0; display: grid; gap: 1em; align-content: center; line-break: strict; }
117
+ .deck-slide .deck-figure :is(p, ul, ol) { margin-block: 0 0.4em; }
118
+ .deck-slide .deck-figure :is(p, ul, ol):last-child { margin-block-end: 0; }
119
+ .deck-words { display: block; }
120
+ .deck-figure .deck-lead { font-family: var(--deck-heading); font-weight: 700; line-height: 1.2; }
121
+ .deck-figure .deck-text { line-height: 1.35; }
122
+ .deck-figure :is(ul, ol).deck-words { font-size: 0.85em; }
123
+ /* On the fill, words are on the fill's ink, their bold and links too. */
124
+ :is(.deck-tile.is-big, .deck-part.is-highlight, .deck-chevron, .deck-level) :is(strong, a, h3, .deck-h3) { color: inherit; }
125
+ :is(.deck-tile.is-big, .deck-part.is-highlight) li::marker { color: inherit; }
126
+ /* A chart or a diagram on the fill would lose its first colour, the fill's: what holds one is on the soft fill, ringed with it. */
127
+ :is(.deck-tile.is-big, .deck-part.is-highlight):has(.deck-block) { background: var(--deck-soft); color: var(--deck-ink); border: 0.15em solid var(--deck-fill); }
128
+ /* Steps: a row of cards, each with its number. */
129
+ .deck-steps { align-items: stretch; }
130
+ .deck-card { display: flex; flex-direction: column; gap: 0.45em; padding: 1.1em 1em; background: var(--deck-soft); border-radius: var(--deck-radius); }
131
+ .deck-badge { display: grid; place-items: center; text-align: center; inline-size: 1.9em; block-size: 1.9em; border-radius: 50%; background: var(--deck-fill); color: var(--deck-on-fill); font-family: var(--deck-heading); font-weight: 700; font-variant-numeric: tabular-nums; }
132
+ .deck-card .deck-lead { font-size: 1.05em; }
133
+ .deck-card .deck-text { font-size: 0.9em; }
134
+ /* Key figures: a row of numbers, each with what it counts, a rule between them. */
135
+ .deck-metrics { gap: 1em 0; text-align: center; }
136
+ .deck-metric { display: flex; flex-direction: column; align-items: center; gap: 0.35em; padding: 0.3em 1em; }
137
+ .deck-metric + .deck-metric { border-inline-start: 1px solid var(--deck-line); }
138
+ .deck-metric .deck-lead { font-size: 3.4em; font-weight: 800; line-height: 1; letter-spacing: -0.02em; color: var(--deck-primary); font-variant-numeric: tabular-nums; }
139
+ /* A timeline: its milestones along a line, each its lead over its dot and its words under it. */
140
+ .deck-timeline { grid-template-rows: auto auto auto; gap: 0.6em 0; justify-items: center; text-align: center; }
141
+ .deck-timeline-line { grid-row: 2; grid-column: 1 / -1; justify-self: stretch; align-self: center; block-size: 0.2em; margin-inline: calc(50% / var(--deck-count)); background: var(--deck-line); border-radius: 0.1em; }
142
+ .deck-timeline .deck-lead { align-self: end; padding-inline: 0.4em; font-size: 1.2em; color: var(--deck-primary); }
143
+ .deck-dot { inline-size: 1.15em; block-size: 1.15em; border-radius: 50%; background: var(--deck-fill); border: 0.22em solid var(--deck-paper); }
144
+ .deck-milestone { align-self: start; padding-inline: 0.4em; font-size: 0.9em; }
145
+ /* A process: chevrons, each holding a step's name, its words under it; they point the way the language reads. */
146
+ .deck-process { gap: 0.7em 0; }
147
+ .deck-chevron { --deck-tip: 0.9em; display: flex; align-items: center; justify-content: center; min-block-size: 3.2em; padding: 0.5em calc(var(--deck-tip) + 0.3em) 0.5em calc(var(--deck-tip) * 2); margin-inline-end: calc(0.3em - var(--deck-tip)); background: var(--deck-fill); color: var(--deck-on-fill); text-align: center;
148
+ clip-path: polygon(0% 0%, calc(100% - var(--deck-tip)) 0%, 100% 50%, calc(100% - var(--deck-tip)) 100%, 0% 100%, var(--deck-tip) 50%); }
149
+ .deck-chevron[data-first] { padding-inline-start: 0.9em; clip-path: polygon(0% 0%, calc(100% - var(--deck-tip)) 0%, 100% 50%, calc(100% - var(--deck-tip)) 100%, 0% 100%); }
150
+ .deck-chevron[data-last] { margin-inline-end: 0; }
151
+ .deck[dir="rtl"] .deck-chevron { clip-path: polygon(100% 0%, var(--deck-tip) 0%, 0% 50%, var(--deck-tip) 100%, 100% 100%, calc(100% - var(--deck-tip)) 50%); }
152
+ .deck[dir="rtl"] .deck-chevron[data-first] { clip-path: polygon(100% 0%, var(--deck-tip) 0%, 0% 50%, var(--deck-tip) 100%, 100% 100%); }
153
+ .deck-under { align-self: start; padding-inline: 0.6em; font-size: 0.9em; text-align: center; }
154
+ /* A programme, and the deck's contents: rows of a time (or a number) and its words, in two columns from seven. */
155
+ .deck-agenda { gap: 0 3em; }
156
+ .deck-agenda-col { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 1.2em; align-content: start; }
157
+ .deck-row { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: baseline; padding-block: 0.55em; border-block-end: 1px solid var(--deck-line); }
158
+ .deck-row > :not(.deck-lead) { grid-column: 2; }
159
+ .deck-row .deck-lead { color: var(--deck-primary); white-space: nowrap; font-variant-numeric: tabular-nums; }
160
+ .deck-contents { font-size: 1.1em; }
161
+ .deck-contents .deck-row { cursor: pointer; }
162
+ .deck-contents .deck-row:focus-visible { outline: 0.12em solid var(--deck-primary); outline-offset: 0.1em; }
163
+ .deck-contents .deck-row .deck-text { font-family: var(--deck-heading); font-weight: 600; }
164
+ .deck-contents .deck-row.is-sub { padding-block: 0.3em; border-block-end-style: dotted; font-size: 0.85em; }
165
+ .deck-contents .deck-row.is-sub .deck-text { font-family: var(--deck-body); font-weight: 400; }
166
+ /* A pyramid: its levels stacked, the first the narrowest, on top; what each says beside it. */
167
+ .deck-pyramid { gap: 0.3em 2em; justify-content: center; }
168
+ .deck-level { display: flex; align-items: center; justify-content: center; min-block-size: 2.6em; padding-block: 0.45em; background: var(--deck-fill); color: var(--deck-on-fill); text-align: center; }
169
+ .deck-level .deck-words { font-family: var(--deck-heading); font-weight: 700; }
170
+ .deck-beside { align-self: center; font-size: 0.9em; }
171
+ /* A bento: the first tile big, the others around it. */
172
+ .deck-bento { align-content: stretch; gap: 0.9em; grid-template-columns: 1.4fr repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; }
173
+ .deck-tile { display: flex; flex-direction: column; justify-content: safe flex-end; gap: 0.35em; padding: 1em 1.1em; background: var(--deck-soft); border-radius: var(--deck-radius); }
174
+ .deck-tile.is-big { grid-row: span 2; background: var(--deck-fill); color: var(--deck-on-fill); }
175
+ .deck-tile .deck-lead { font-size: 1.15em; }
176
+ .deck-tile.is-big .deck-lead { font-size: 1.9em; }
177
+ .deck-tile .deck-block { min-block-size: 6cqi; }
178
+ .deck-bento[data-count="1"] { grid-template-columns: 1fr; }
179
+ .deck-bento[data-count="2"] { grid-template-columns: 1.3fr 1fr; }
180
+ .deck-bento[data-count="2"] .deck-tile.is-big { grid-row: auto; }
181
+ .deck-bento[data-count="3"] { grid-template-columns: 1.3fr 1fr; }
182
+ .deck-bento[data-count="4"] .deck-tile:nth-child(2) { grid-column: span 2; }
183
+ /* Parts face to face, a medallion between them, the last on the fill; or four in a matrix, the second, top at the end, on the fill. */
184
+ .deck-versus, .deck-matrix { align-content: stretch; }
185
+ .deck-versus { column-gap: 0; grid-auto-rows: 1fr; }
186
+ .deck-matrix { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 0.8em; }
187
+ .deck-part { display: flex; flex-direction: column; padding: 1.1em 1.4em; background: var(--deck-soft); border-radius: var(--deck-radius); }
188
+ .deck-part.is-highlight { background: var(--deck-fill); color: var(--deck-on-fill); }
189
+ .deck-slide .deck-part :is(h1, h2, h3, h4, .deck-h) { font-size: 1.35em; color: inherit; margin-block-end: 0.45em; }
190
+ .deck-vs { position: relative; z-index: 1; align-self: center; display: grid; place-items: center; text-align: center; inline-size: 3.2em; block-size: 3.2em; margin-inline: -1em; border-radius: 50%; background: var(--deck-ink); color: var(--deck-paper); border: 0.25em solid var(--deck-paper); font-family: var(--deck-heading); font-weight: 800; font-size: 0.9em; letter-spacing: 0.02em; }
85
191
  /* Scripts without italics keep their upright letters. */
86
192
  .deck :is(blockquote, em):is(:lang(ar), :lang(fa), :lang(ur), :lang(he), :lang(ja), :lang(zh), :lang(ko), :lang(hi), :lang(th)) { font-style: normal; }
87
193
  .deck-layout-quote blockquote::before { content: "\201C"; display: block; font-size: 2.4em; line-height: 0.6; color: var(--deck-primary); }
@@ -93,6 +199,11 @@
93
199
  :is(.deck-layout-image-left, .deck-layout-image-right).has-image .deck-slot { padding: 6cqi 5cqi; justify-content: center; }
94
200
  :is(.deck-layout-image, .deck-layout-cover).has-image .deck-image { position: absolute; inset: 0; }
95
201
  :is(.deck-layout-image, .deck-layout-cover).has-image .deck-slot { position: relative; color: #fff; text-shadow: 0 0.05em 0.4em rgb(0 0 0 / 0.6); }
202
+ /* A quote over its picture, the whole slide, behind a veil. */
203
+ .deck-layout-quote.has-image .deck-image { position: absolute; inset: 0; }
204
+ .deck-layout-quote.has-image .deck-image::after { content: ""; position: absolute; inset: 0; background-color: rgb(0 0 0 / 0.55); }
205
+ .deck-layout-quote.has-image .deck-slot { position: relative; color: #fff; text-shadow: 0 0.05em 0.4em rgb(0 0 0 / 0.5); }
206
+ .deck-layout-quote.has-image blockquote::before { color: inherit; }
96
207
  .deck-layout-cover.has-image .deck-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(0 0 0 / 0.65), rgb(0 0 0 / 0.1)); }
97
208
  .deck-class-invert { background: var(--deck-ink); color: var(--deck-paper); }
98
209
  .deck-class-text-center .deck-slot { text-align: center; align-items: center; }