@atom63/slides 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/README.md +34 -0
- package/dist/{chunk-AD3ZOVWR.js → chunk-FNPEZIX4.js} +3332 -3322
- package/dist/chunk-FNPEZIX4.js.map +1 -0
- package/dist/editor/index.js +98 -7
- package/dist/editor/index.js.map +1 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.js +1 -1
- package/package.json +7 -3
- package/src/editor/styles.css +41 -0
- package/src/styles/themes.css +245 -0
- package/dist/chunk-AD3ZOVWR.js.map +0 -1
package/README.md
CHANGED
|
@@ -166,6 +166,40 @@ Key tokens: **base palette** — `--background`, `--foreground`, `--card`, `--mu
|
|
|
166
166
|
|
|
167
167
|
> Runtime light/dark toggle: import `themes/dark` is a hard swap. For a toggle, copy `dark.css` and re-scope its `:root` to e.g. `[data-slides-theme="dark"]`, then set that attribute on a wrapper.
|
|
168
168
|
|
|
169
|
+
### GUI theme picker and `theme:` frontmatter
|
|
170
|
+
|
|
171
|
+
The `DeckEditor` / `DeckSurface` editor chrome includes a **Theme picker** (Edit → Theme). Selecting a theme writes a `theme:` line into the deck frontmatter; selecting "Default" removes it. The field accepts any of the five built-in names:
|
|
172
|
+
|
|
173
|
+
```mdx
|
|
174
|
+
---
|
|
175
|
+
title: "My Talk"
|
|
176
|
+
theme: terminal
|
|
177
|
+
---
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Load the runtime presets once, with a CSS **`@import`** in your Tailwind entry (the same place you import `theme-defaults` and `styles` — a JS import will **not** deliver it):
|
|
181
|
+
|
|
182
|
+
```css
|
|
183
|
+
@import "tailwindcss";
|
|
184
|
+
@import "@atom63/slides/theme-defaults";
|
|
185
|
+
@import "@atom63/slides/themes"; /* all presets, switched at runtime */
|
|
186
|
+
@import "@atom63/slides/styles";
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
`DeckSurface` then reads `meta.theme` at runtime and sets `data-slides-theme="<name>"` on the surface wrapper, so the matching `[data-slides-theme]` rule activates — **no build step required**; the deck restyles live as you pick themes in the editor.
|
|
190
|
+
|
|
191
|
+
**Present-only consumer path** — if you embed a bare `<SlidesPlayer>` without `DeckSurface`, keep the same `@import "@atom63/slides/themes"` above and set the attribute on a wrapper around the player yourself:
|
|
192
|
+
|
|
193
|
+
```tsx
|
|
194
|
+
import { resolveTheme } from "@atom63/slides"
|
|
195
|
+
|
|
196
|
+
<div data-slides-theme={resolveTheme(deck.meta)}>
|
|
197
|
+
<SlidesPlayer deck={deck} onBack={onBack} />
|
|
198
|
+
</div>
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
The per-theme `:root` imports (`@atom63/slides/themes/dark`, etc.) remain available for a static **build-time hard-swap** where you want a single theme locked in at compile time, without the runtime bundle.
|
|
202
|
+
|
|
169
203
|
## Authoring
|
|
170
204
|
|
|
171
205
|
See the reference deck for the full template catalog and slot APIs, and inspect templates programmatically:
|