Skip to content

Commit abe0be5

Browse files
Add QTI DaisyUI theme runtime
Introduce package-owned QTI theme tokens, a DaisyUI bridge, and a stable web-component runtime loader/CSS entrypoint for default player hosts. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 09abf2e commit abe0be5

53 files changed

Lines changed: 1223 additions & 361 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/config.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
"@pie-qti/source-profiles",
2222
"@pie-qti/storage",
2323
"@pie-qti/test-utils",
24+
"@pie-qti/theme",
25+
"@pie-qti/theme-daisyui",
2426
"@pie-qti/to-pie",
2527
"@pie-qti/transform-cli",
2628
"@pie-qti/transform-core",

.changeset/quiet-owls-theme.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"@pie-qti/default-components": minor
3+
"@pie-qti/item-player": minor
4+
"@pie-qti/theme": minor
5+
"@pie-qti/theme-daisyui": minor
6+
"@pie-qti/web-component-loaders": minor
7+
---
8+
9+
Add package-owned QTI theme tokens and a DaisyUI bridge so host applications can cascade their active theme into QTI players through stable `--pie-qti-*` variables.
10+
11+
`loadPieQtiPlayerElements()` now also loads the bundled default interaction web components, giving browser hosts a single stable loader for the default player runtime.
12+
13+
`@pie-qti/web-component-loaders/default-runtime.css` now exposes the default browser runtime CSS, including the DaisyUI theme bridge and QTI shared vocabulary classes.

apps/demo/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"@pie-qti/pie-to-qti2": "workspace:*",
3030
"@pie-qti/player-elements": "workspace:*",
3131
"@pie-qti/qti-common": "workspace:*",
32+
"@pie-qti/theme-daisyui": "workspace:*",
3233
"@pie-qti/typeset-katex": "workspace:*",
3334
"@pie-qti/web-component-loaders": "workspace:*",
3435
"@tiptap/core": "^3.18.0",

apps/demo/src/app.css

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@
33
/* Import DaisyUI v5 styles and themes */
44
@import 'daisyui/daisyui.css';
55
@import 'daisyui/themes.css';
6-
7-
/* QTI 3.0 Shared Vocabulary CSS classes (I20) */
8-
@import '@pie-qti/default-components/shared/styles/qti-shared-vocabulary.css';
6+
@import '@pie-qti/web-component-loaders/default-runtime.css';

bun.lock

Lines changed: 54 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/ARCHITECTURE.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,17 +199,20 @@ The theming system balances three goals:
199199

200200
#### CSS variables (theme tokens)
201201

202-
Components consume DaisyUI-compatible variables:
202+
Components consume package-owned PIE QTI theme variables. DaisyUI hosts can import
203+
`@pie-qti/theme-daisyui/bridge.css` to map their active `--color-*` theme into
204+
these variables.
203205

204206
| Variable | Purpose |
205207
|----------|---------|
206-
| `--p` | Primary color |
207-
| `--a` | Accent color |
208-
| `--b1`, `--b2`, `--b3` | Base surface colors |
209-
| `--bc` | Base content (text) color |
210-
| `--su` | Success color |
211-
212-
Usage in components: `hsl(var(--p))`, `hsl(var(--bc))`, etc.
208+
| `--pie-qti-primary` | Primary color |
209+
| `--pie-qti-accent` | Accent color |
210+
| `--pie-qti-base-100`, `--pie-qti-base-200`, `--pie-qti-base-300` | Base surface colors |
211+
| `--pie-qti-base-content` | Base content (text) color |
212+
| `--pie-qti-success` | Success color |
213+
214+
Usage in components: `var(--pie-qti-primary, <fallback>)`,
215+
`var(--pie-qti-base-content, <fallback>)`, etc.
213216

214217
If the host doesn't provide these variables, components fall back to safe defaults via `var(--token, fallback)`.
215218

0 commit comments

Comments
 (0)