@kadal/theme-crayon 0.0.0-stage → 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.
Files changed (5) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +65 -2
  3. package/index.tsx +98 -0
  4. package/package.json +101 -4
  5. package/style.css +856 -0
package/README.md CHANGED
@@ -1,3 +1,66 @@
1
- # Temporary Holding Version
1
+ # @kadal/theme-crayon
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **Crayon**, a theme for [Kadal Deck](https://deck.kadal.cc). A playful pastel theme for workshops and classrooms. Fredoka for headings, Nunito for text, Fira Code for code; cream paper and plum ink, six pastels, chunky ink outlines and offset shadows that look like paper cut-outs. Callouts are stickers, a blockquote is a speech bubble, list bullets are coloured dots, a section title is a big sticker and a fact sits in a round one. The shadows are solid offsets, never blurred, so print and PDF look like the screen.
4
+
5
+ ![Crayon: the cover, a content slide, code and the theme's own layout](./screenshot.jpg)
6
+
7
+ ## Use it
8
+
9
+ ```bash
10
+ npm install @kadal/theme-crayon
11
+ ```
12
+
13
+ ```yaml
14
+ ---
15
+ theme: crayon
16
+ themeConfig: # all optional
17
+ tilt: true
18
+ accent: "#c62f6b"
19
+ accentDark: "#ff9cc2"
20
+ ---
21
+ ```
22
+
23
+ The deck plugin brings the stylesheet and the module in; nothing to import. The prebuilt shell (the hosted builder, published decks) bundles this theme already. Schemes: light and dark. Fonts: Fredoka (headings), Nunito (text), Fira Code (code), loaded through the theme's `config.fonts`. Code colours: Shiki's catppuccin-latte / catppuccin-macchiato. To show it beside other themes in the theme menu (<kbd>T</kbd>), list it: `themes: [crayon, minimal]`.
24
+
25
+ ## themeConfig
26
+
27
+ Every key arrives on the deck root as a CSS variable (`accentDark` → `--theme-accent-dark`); the theme reads them with fallbacks, so set only what you change.
28
+
29
+ | key | type | default | what it does |
30
+ | --- | --- | --- | --- |
31
+ | `tilt` | boolean | `true` | `false` straightens every sticker. |
32
+ | `accent` | colour | `#c62f6b` | The light scheme's accent (berry). |
33
+ | `accentDark` | colour | `#ff9cc2` | The dark scheme's. Without it, a set `accent` is lifted towards white. |
34
+
35
+ ## Layouts
36
+
37
+ Every built-in layout is styled (`default`, `center`, `cover`, `intro`, `section`, `end`, `fact`, `quote`, `statement`, `full`, `two-cols`, `two-cols-header`, `image`, `image-left`, `image-right`, `iframe`, `iframe-left`, `iframe-right`), and the theme adds:
38
+
39
+ | layout | what |
40
+ | --- | --- |
41
+ | `activity` | An exercise: a tag (`label:`, default "Activity"), a time chip (`time: 10 min`) and the slide's numbered list as step stickers (`columns:`, default 3). |
42
+ | `cards` | The slide's bullet list as a grid of pastel cards (`columns:`, default 3); a **bold** opening is the card's title. |
43
+
44
+ ## Components
45
+
46
+ | component | what |
47
+ | --- | --- |
48
+ | `<Sticker tone tilt>` | Words on a pastel cut-out: `tone` pink · mint · sky · butter · lilac · peach (default butter), `tilt` in degrees (default -2). |
49
+ | `<Bubble from side>` | A speech bubble; `from` names the speaker, `side="right"` answers. |
50
+
51
+ ## Preview
52
+
53
+ `preview/deck.mdx` walks through every layout and component (`theme: ../`). In this repository:
54
+
55
+ ```bash
56
+ bun run --filter @kadal/theme-crayon dev # the preview deck, live
57
+ node tools/theme-shots.mjs crayon # screenshots in light and dark, contrast and overflow checks
58
+ ```
59
+
60
+ ## Accessibility and print
61
+
62
+ Body and muted text meet WCAG AA (4.5:1) on the page and on cards in every scheme the theme draws (checked by `tools/theme-shots.mjs`). Anything that moves stands still under `prefers-reduced-motion` and on a still copy; printed pages and exports drop shadows and glows.
63
+
64
+ ## Licence
65
+
66
+ AGPL-3.0-or-later, like the engine (see LICENSE); a commercial licence is available — see [LICENSING](https://github.com/kadalcc/deck/blob/main/LICENSING.md).
package/index.tsx ADDED
@@ -0,0 +1,98 @@
1
+ import type { CSSProperties, ReactNode } from "react";
2
+
3
+ import type { LayoutProps } from "@kadal/deck";
4
+
5
+ /**
6
+ * ─────────────────────────────────────────────────────────────────────────────
7
+ * Crayon's module: two classroom layouts and two cut-outs.
8
+ *
9
+ * layout: activity an exercise: a tag (`label:`, default "Activity"), a time chip
10
+ * (`time: 10 min`), and the slide's numbered list as step stickers
11
+ * (`columns:` how many to a row, default 3)
12
+ * layout: cards the slide's bullet list as a grid of pastel cards (`columns:`, default 3);
13
+ * a **bold** opening becomes the card's title
14
+ * <Sticker tone tilt> words on a pastel cut-out: tone pink · mint · sky · butter · lilac ·
15
+ * peach (default butter), tilt in degrees (default -2)
16
+ * <Bubble from side> a speech bubble; `from` names the speaker, `side="right"` answers
17
+ * ─────────────────────────────────────────────────────────────────────────────
18
+ */
19
+
20
+ const str = (v: unknown) => (typeof v === "string" && v.trim() ? v.trim() : null);
21
+ const num = (v: unknown) =>
22
+ typeof v === "number" ? v : typeof v === "string" && /^\d+$/.test(v.trim()) ? Number(v) : null;
23
+
24
+ function Activity({ children, frontmatter }: LayoutProps) {
25
+ const time = str(frontmatter.time);
26
+ const cols = num(frontmatter.columns);
27
+ return (
28
+ <div
29
+ className="deck-layout deck-layout-activity"
30
+ style={cols ? ({ "--crayon-steps": cols } as CSSProperties) : undefined}
31
+ >
32
+ <div className="crayon-activity-head">
33
+ <span className="crayon-activity-tag">{str(frontmatter.label) ?? "Activity"}</span>
34
+ {time ? (
35
+ <span className="crayon-activity-time">
36
+ <span aria-hidden="true">{"⏱"}</span> {time}
37
+ </span>
38
+ ) : null}
39
+ </div>
40
+ {children}
41
+ </div>
42
+ );
43
+ }
44
+
45
+ function Cards({ children, frontmatter }: LayoutProps) {
46
+ const cols = num(frontmatter.columns);
47
+ return (
48
+ <div
49
+ className="deck-layout deck-layout-cards"
50
+ style={cols ? ({ "--crayon-cols": cols } as CSSProperties) : undefined}
51
+ >
52
+ {children}
53
+ </div>
54
+ );
55
+ }
56
+
57
+ const TONES = new Set(["pink", "mint", "sky", "butter", "lilac", "peach"]);
58
+
59
+ function Sticker({
60
+ tone = "butter",
61
+ tilt = -2,
62
+ children,
63
+ }: {
64
+ tone?: string;
65
+ tilt?: number;
66
+ children?: ReactNode;
67
+ }) {
68
+ return (
69
+ <span
70
+ className={`crayon-sticker tone-${TONES.has(tone) ? tone : "butter"}`}
71
+ style={{ "--crayon-turn": Number(tilt) || 0 } as CSSProperties}
72
+ >
73
+ {children}
74
+ </span>
75
+ );
76
+ }
77
+
78
+ function Bubble({
79
+ from,
80
+ side = "left",
81
+ children,
82
+ }: {
83
+ from?: string;
84
+ side?: "left" | "right";
85
+ children?: ReactNode;
86
+ }) {
87
+ return (
88
+ <div className={`crayon-bubble${side === "right" ? " is-right" : ""}`}>
89
+ {children}
90
+ {from ? <span className="crayon-bubble-from">{from}</span> : null}
91
+ </div>
92
+ );
93
+ }
94
+
95
+ export default {
96
+ layouts: { activity: Activity, cards: Cards },
97
+ components: { Sticker, Bubble },
98
+ };
package/package.json CHANGED
@@ -1,6 +1,103 @@
1
1
  {
2
2
  "name": "@kadal/theme-crayon",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.4.0",
4
+ "description": "Crayon, a theme for Kadal Deck (@kadal/deck). A playful pastel theme for workshops and classrooms: rounded shapes, a friendly display face, and sticker-like callouts.",
5
+ "keywords": [
6
+ "kadal-theme",
7
+ "kadal-deck",
8
+ "presentation",
9
+ "slides",
10
+ "theme",
11
+ "playful",
12
+ "pastel",
13
+ "workshop",
14
+ "classroom"
15
+ ],
16
+ "homepage": "https://deck.kadal.cc/docs/",
17
+ "funding": {
18
+ "type": "github",
19
+ "url": "https://github.com/sponsors/pmithunish"
20
+ },
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/kadalcc/deck.git",
24
+ "directory": "packages/theme-crayon"
25
+ },
26
+ "bugs": {
27
+ "url": "https://github.com/kadalcc/deck/issues"
28
+ },
29
+ "license": "AGPL-3.0-or-later",
30
+ "author": "Mithunish Prabhakaran <pmithunish@gmail.com>",
31
+ "type": "module",
32
+ "sideEffects": [
33
+ "*.css"
34
+ ],
35
+ "files": [
36
+ "style.css",
37
+ "index.tsx",
38
+ "README.md",
39
+ "LICENSE"
40
+ ],
41
+ "exports": {
42
+ ".": "./index.tsx",
43
+ "./style.css": "./style.css",
44
+ "./package.json": "./package.json"
45
+ },
46
+ "publishConfig": {
47
+ "access": "public",
48
+ "provenance": true
49
+ },
50
+ "kadal": {
51
+ "theme": {
52
+ "name": "crayon",
53
+ "title": "Crayon",
54
+ "description": "A playful pastel theme for workshops and classrooms: rounded shapes, a friendly display face, and sticker-like callouts.",
55
+ "colorScheme": "both",
56
+ "config": {
57
+ "transition": "slide",
58
+ "fonts": {
59
+ "heading": "Fredoka",
60
+ "sans": "Nunito",
61
+ "mono": "Fira Code",
62
+ "weights": "400,500,600,700"
63
+ }
64
+ },
65
+ "themeConfig": {
66
+ "tilt": true
67
+ },
68
+ "shiki": {
69
+ "light": "catppuccin-latte",
70
+ "dark": "catppuccin-macchiato"
71
+ },
72
+ "defaults": {},
73
+ "layouts": [
74
+ "activity",
75
+ "cards"
76
+ ],
77
+ "components": [
78
+ "Sticker",
79
+ "Bubble"
80
+ ]
81
+ }
82
+ },
83
+ "scripts": {
84
+ "dev": "kadal-deck dev -C preview",
85
+ "check": "kadal-deck check -C preview",
86
+ "typecheck": "tsc --noEmit",
87
+ "test": "bun test"
88
+ },
89
+ "peerDependencies": {
90
+ "@kadal/deck": "^0.4.0",
91
+ "react": "^19.2.0"
92
+ },
93
+ "devDependencies": {
94
+ "@kadal/deck": "workspace:*",
95
+ "@types/react": "^19.2.0",
96
+ "@types/react-dom": "^19.2.0",
97
+ "@vitejs/plugin-react": "^6.0.2",
98
+ "react": "^19.2.7",
99
+ "react-dom": "^19.2.7",
100
+ "typescript": "^6.0.3",
101
+ "vite": "^8.0.16"
102
+ }
103
+ }