@pie-players/pie-theme 0.1.1

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 ADDED
@@ -0,0 +1,31 @@
1
+ # @pie-players/pie-theme
2
+
3
+ Shared PIE theming primitives and the `pie-theme` custom element.
4
+
5
+ `pie-theme` now auto-detects DaisyUI color tokens (for example `--color-base-100`, `--color-primary`) and translates them to PIE `--pie-*` variables before applying explicit `variables` overrides.
6
+
7
+ ## Usage
8
+
9
+ ```ts
10
+ import "@pie-players/pie-theme";
11
+ import "@pie-players/pie-theme/tokens.css";
12
+ import "@pie-players/pie-theme/color-schemes.css";
13
+ import "@pie-players/pie-theme/font-sizes.css";
14
+ ```
15
+
16
+ ```html
17
+ <pie-theme theme="auto" scope="document">
18
+ <pie-section-player></pie-section-player>
19
+ </pie-theme>
20
+ ```
21
+
22
+ ## Custom element API
23
+
24
+ - `theme`: `light | dark | auto`
25
+ - `scope`: `self | document`
26
+ - `variables`: JSON object of CSS variable overrides
27
+
28
+ ## DaisyUI Integration
29
+
30
+ - If DaisyUI tokens are present on the target scope, `pie-theme` uses them to derive PIE theme variables.
31
+ - Override precedence is: base PIE theme -> DaisyUI-derived variables -> `variables` attribute overrides.
@@ -0,0 +1,333 @@
1
+ /* PIE Color Scheme System - Learnosity-compatible industry standards for K-12 assessments
2
+ *
3
+ * These color schemes are based on Learnosity's WCAG 2.1 Level AA audited palettes,
4
+ * widely used in educational assessment platforms.
5
+ *
6
+ * All schemes meet WCAG contrast requirements:
7
+ * - Normal text: 4.5:1 minimum
8
+ * - Large text: 3:1 minimum
9
+ * - UI components: 3:1 minimum
10
+ *
11
+ * Usage: Apply data-color-scheme attribute to document root or pie-player element
12
+ * Example: <html data-color-scheme="white-on-black">
13
+ */
14
+
15
+ /* Default color scheme */
16
+ :root {
17
+ /* Base colors */
18
+ --pie-text: black;
19
+ --pie-disabled: grey;
20
+ --pie-disabled-secondary: #ababab;
21
+
22
+ /* Feedback colors */
23
+ --pie-correct: #4caf50;
24
+ --pie-correct-secondary: #e8f5e9;
25
+ --pie-correct-tertiary: #0ea449;
26
+ --pie-correct-icon: #087d38;
27
+ --pie-incorrect: #ff9800;
28
+ --pie-incorrect-secondary: #ffebee;
29
+ --pie-incorrect-icon: #bf0d00;
30
+ --pie-missing: #d32f2f;
31
+ --pie-missing-icon: #6a78a1;
32
+
33
+ /* Primary colors */
34
+ --pie-primary: #3f51b5;
35
+ --pie-primary-light: #9fa8da;
36
+ --pie-primary-dark: #283593;
37
+ --pie-faded-primary: #dcdafb;
38
+
39
+ /* Secondary colors */
40
+ --pie-secondary: #f50057;
41
+ --pie-secondary-light: #f48fb1;
42
+ --pie-secondary-dark: #880e4f;
43
+
44
+ /* Tertiary colors */
45
+ --pie-tertiary: #146eb3;
46
+ --pie-tertiary-light: #d0e2f0;
47
+
48
+ /* Background colors */
49
+ --pie-background: rgba(255, 255, 255, 0);
50
+ --pie-background-dark: #ecedf1;
51
+ --pie-secondary-background: rgba(241, 241, 241, 1);
52
+ --pie-dropdown-background: #e0e1e6;
53
+
54
+ /* Border colors */
55
+ --pie-border: #9a9a9a;
56
+ --pie-border-light: #d1d1d1;
57
+ --pie-border-dark: #646464;
58
+ --pie-border-gray: #7e8494;
59
+
60
+ /* Absolute colors */
61
+ --pie-black: #000000;
62
+ --pie-white: #ffffff;
63
+
64
+ /* Focus colors (accessibility) */
65
+ --pie-focus-checked: #bbdefb;
66
+ --pie-focus-checked-border: #1565c0;
67
+ --pie-focus-unchecked: #e0e0e0;
68
+ --pie-focus-unchecked-border: #757575;
69
+
70
+ /* Blue grey colors (tokens) */
71
+ --pie-blue-grey-100: #f3f5f7;
72
+ --pie-blue-grey-300: #c0c3cf;
73
+ --pie-blue-grey-600: #7e8494;
74
+ --pie-blue-grey-900: #152452;
75
+ }
76
+
77
+ /* Black on White - Learnosity standard */
78
+ [data-color-scheme="black-on-white"] {
79
+ --pie-text: #000000;
80
+ --pie-disabled: #666666;
81
+ --pie-disabled-secondary: #888888;
82
+ --pie-correct: #006600;
83
+ --pie-correct-secondary: #ccffcc;
84
+ --pie-correct-tertiary: #008800;
85
+ --pie-correct-icon: #004400;
86
+ --pie-incorrect: #cc0000;
87
+ --pie-incorrect-secondary: #ffcccc;
88
+ --pie-incorrect-icon: #990000;
89
+ --pie-missing: #cc0000;
90
+ --pie-missing-icon: #000099;
91
+ --pie-primary: #0000cc;
92
+ --pie-primary-light: #6666ff;
93
+ --pie-primary-dark: #000088;
94
+ --pie-faded-primary: #ccccff;
95
+ --pie-secondary: #cc0066;
96
+ --pie-secondary-light: #ff99cc;
97
+ --pie-secondary-dark: #990044;
98
+ --pie-tertiary: #006699;
99
+ --pie-tertiary-light: #99ccff;
100
+ --pie-background: #ffffff;
101
+ --pie-background-dark: #f5f5f5;
102
+ --pie-secondary-background: #eeeeee;
103
+ --pie-dropdown-background: #e0e0e0;
104
+ --pie-border: #000000;
105
+ --pie-border-light: #666666;
106
+ --pie-border-dark: #000000;
107
+ --pie-border-gray: #555555;
108
+ --pie-black: #000000;
109
+ --pie-white: #ffffff;
110
+ --pie-focus-checked: #0066ff;
111
+ --pie-focus-checked-border: #0000cc;
112
+ --pie-focus-unchecked: #cccccc;
113
+ --pie-focus-unchecked-border: #000000;
114
+ --pie-blue-grey-100: #f5f5f5;
115
+ --pie-blue-grey-300: #cccccc;
116
+ --pie-blue-grey-600: #666666;
117
+ --pie-blue-grey-900: #000000;
118
+ }
119
+
120
+ /* White on Black - Learnosity standard */
121
+ [data-color-scheme="white-on-black"] {
122
+ --pie-text: #ffffff;
123
+ --pie-disabled: #999999;
124
+ --pie-disabled-secondary: #777777;
125
+ --pie-correct: #00ff00;
126
+ --pie-correct-secondary: #003300;
127
+ --pie-correct-tertiary: #00cc00;
128
+ --pie-correct-icon: #00ff00;
129
+ --pie-incorrect: #ff3333;
130
+ --pie-incorrect-secondary: #330000;
131
+ --pie-incorrect-icon: #ff0000;
132
+ --pie-missing: #ff6666;
133
+ --pie-missing-icon: #6666ff;
134
+ --pie-primary: #ffff00;
135
+ --pie-primary-light: #ffff99;
136
+ --pie-primary-dark: #cccc00;
137
+ --pie-faded-primary: #666600;
138
+ --pie-secondary: #ff00ff;
139
+ --pie-secondary-light: #ff99ff;
140
+ --pie-secondary-dark: #cc00cc;
141
+ --pie-tertiary: #00ffff;
142
+ --pie-tertiary-light: #99ffff;
143
+ --pie-background: #000000;
144
+ --pie-background-dark: #1a1a1a;
145
+ --pie-secondary-background: #222222;
146
+ --pie-dropdown-background: #2a2a2a;
147
+ --pie-border: #ffffff;
148
+ --pie-border-light: #cccccc;
149
+ --pie-border-dark: #ffffff;
150
+ --pie-border-gray: #aaaaaa;
151
+ --pie-black: #ffffff;
152
+ --pie-white: #000000;
153
+ --pie-focus-checked: #ffff00;
154
+ --pie-focus-checked-border: #ffff00;
155
+ --pie-focus-unchecked: #666666;
156
+ --pie-focus-unchecked-border: #ffffff;
157
+ --pie-blue-grey-100: #2a2a2a;
158
+ --pie-blue-grey-300: #555555;
159
+ --pie-blue-grey-600: #999999;
160
+ --pie-blue-grey-900: #ffffff;
161
+ }
162
+
163
+ /* Rose on Green - Learnosity standard (protanopia/deuteranopia friendly) */
164
+ [data-color-scheme="rose-on-green"] {
165
+ --pie-text: #3d0022;
166
+ --pie-disabled: #996677;
167
+ --pie-disabled-secondary: #bb8899;
168
+ --pie-correct: #004400;
169
+ --pie-correct-secondary: #aaffaa;
170
+ --pie-correct-tertiary: #006600;
171
+ --pie-correct-icon: #003300;
172
+ --pie-incorrect: #aa0044;
173
+ --pie-incorrect-secondary: #ffccdd;
174
+ --pie-incorrect-icon: #880033;
175
+ --pie-missing: #aa0044;
176
+ --pie-missing-icon: #440044;
177
+ --pie-primary: #660044;
178
+ --pie-primary-light: #cc6699;
179
+ --pie-primary-dark: #440033;
180
+ --pie-faded-primary: #ddbbcc;
181
+ --pie-secondary: #880055;
182
+ --pie-secondary-light: #dd99bb;
183
+ --pie-secondary-dark: #550033;
184
+ --pie-tertiary: #770044;
185
+ --pie-tertiary-light: #dd99bb;
186
+ --pie-background: #ccffcc;
187
+ --pie-background-dark: #aaeedd;
188
+ --pie-secondary-background: #99ddbb;
189
+ --pie-dropdown-background: #88cc99;
190
+ --pie-border: #3d0022;
191
+ --pie-border-light: #663344;
192
+ --pie-border-dark: #220011;
193
+ --pie-border-gray: #664455;
194
+ --pie-black: #000000;
195
+ --pie-white: #ccffcc;
196
+ --pie-focus-checked: #880055;
197
+ --pie-focus-checked-border: #660044;
198
+ --pie-focus-unchecked: #aaddbb;
199
+ --pie-focus-unchecked-border: #3d0022;
200
+ --pie-blue-grey-100: #ccffdd;
201
+ --pie-blue-grey-300: #99ddbb;
202
+ --pie-blue-grey-600: #668877;
203
+ --pie-blue-grey-900: #3d0022;
204
+ }
205
+
206
+ /* Yellow on Blue - Learnosity standard */
207
+ [data-color-scheme="yellow-on-blue"] {
208
+ --pie-text: #ffff00;
209
+ --pie-disabled: #9999aa;
210
+ --pie-disabled-secondary: #aaaacc;
211
+ --pie-correct: #00ff00;
212
+ --pie-correct-secondary: #003333;
213
+ --pie-correct-tertiary: #00cc00;
214
+ --pie-correct-icon: #00ff00;
215
+ --pie-incorrect: #ff6666;
216
+ --pie-incorrect-secondary: #331111;
217
+ --pie-incorrect-icon: #ff3333;
218
+ --pie-missing: #ff6666;
219
+ --pie-missing-icon: #99ff99;
220
+ --pie-primary: #ffff66;
221
+ --pie-primary-light: #ffffaa;
222
+ --pie-primary-dark: #cccc00;
223
+ --pie-faded-primary: #666633;
224
+ --pie-secondary: #ffaa00;
225
+ --pie-secondary-light: #ffcc66;
226
+ --pie-secondary-dark: #cc8800;
227
+ --pie-tertiary: #ffee00;
228
+ --pie-tertiary-light: #ffff99;
229
+ --pie-background: #000066;
230
+ --pie-background-dark: #000055;
231
+ --pie-secondary-background: #000044;
232
+ --pie-dropdown-background: #000033;
233
+ --pie-border: #ffff00;
234
+ --pie-border-light: #aaaa66;
235
+ --pie-border-dark: #cccc00;
236
+ --pie-border-gray: #8888aa;
237
+ --pie-black: #ffff00;
238
+ --pie-white: #000066;
239
+ --pie-focus-checked: #ffff00;
240
+ --pie-focus-checked-border: #cccc00;
241
+ --pie-focus-unchecked: #333366;
242
+ --pie-focus-unchecked-border: #ffff00;
243
+ --pie-blue-grey-100: #000055;
244
+ --pie-blue-grey-300: #333377;
245
+ --pie-blue-grey-600: #6666aa;
246
+ --pie-blue-grey-900: #ffff00;
247
+ }
248
+
249
+ /* Black on Rose - Learnosity standard */
250
+ [data-color-scheme="black-on-rose"] {
251
+ --pie-text: #000000;
252
+ --pie-disabled: #666666;
253
+ --pie-disabled-secondary: #888888;
254
+ --pie-correct: #006600;
255
+ --pie-correct-secondary: #ccffcc;
256
+ --pie-correct-tertiary: #008800;
257
+ --pie-correct-icon: #004400;
258
+ --pie-incorrect: #990000;
259
+ --pie-incorrect-secondary: #ffdddd;
260
+ --pie-incorrect-icon: #770000;
261
+ --pie-missing: #990000;
262
+ --pie-missing-icon: #000099;
263
+ --pie-primary: #880044;
264
+ --pie-primary-light: #dd6699;
265
+ --pie-primary-dark: #550033;
266
+ --pie-faded-primary: #ffccdd;
267
+ --pie-secondary: #aa0055;
268
+ --pie-secondary-light: #ff99cc;
269
+ --pie-secondary-dark: #770033;
270
+ --pie-tertiary: #990044;
271
+ --pie-tertiary-light: #ffaacc;
272
+ --pie-background: #ffccdd;
273
+ --pie-background-dark: #ffb3cc;
274
+ --pie-secondary-background: #ff99bb;
275
+ --pie-dropdown-background: #ff88aa;
276
+ --pie-border: #000000;
277
+ --pie-border-light: #555555;
278
+ --pie-border-dark: #000000;
279
+ --pie-border-gray: #444444;
280
+ --pie-black: #000000;
281
+ --pie-white: #ffccdd;
282
+ --pie-focus-checked: #880044;
283
+ --pie-focus-checked-border: #550033;
284
+ --pie-focus-unchecked: #ffddee;
285
+ --pie-focus-unchecked-border: #000000;
286
+ --pie-blue-grey-100: #ffeef5;
287
+ --pie-blue-grey-300: #ffccdd;
288
+ --pie-blue-grey-600: #cc6688;
289
+ --pie-blue-grey-900: #000000;
290
+ }
291
+
292
+ /* Light Gray on Dark Gray - Learnosity standard */
293
+ [data-color-scheme="light-gray-on-dark-gray"] {
294
+ --pie-text: #e0e0e0;
295
+ --pie-disabled: #999999;
296
+ --pie-disabled-secondary: #888888;
297
+ --pie-correct: #00cc00;
298
+ --pie-correct-secondary: #003300;
299
+ --pie-correct-tertiary: #00aa00;
300
+ --pie-correct-icon: #00ff00;
301
+ --pie-incorrect: #ff4444;
302
+ --pie-incorrect-secondary: #331111;
303
+ --pie-incorrect-icon: #ff0000;
304
+ --pie-missing: #ff6666;
305
+ --pie-missing-icon: #6666ff;
306
+ --pie-primary: #aaaaaa;
307
+ --pie-primary-light: #cccccc;
308
+ --pie-primary-dark: #888888;
309
+ --pie-faded-primary: #555555;
310
+ --pie-secondary: #bbbbbb;
311
+ --pie-secondary-light: #dddddd;
312
+ --pie-secondary-dark: #999999;
313
+ --pie-tertiary: #cccccc;
314
+ --pie-tertiary-light: #eeeeee;
315
+ --pie-background: #333333;
316
+ --pie-background-dark: #2a2a2a;
317
+ --pie-secondary-background: #222222;
318
+ --pie-dropdown-background: #1a1a1a;
319
+ --pie-border: #e0e0e0;
320
+ --pie-border-light: #cccccc;
321
+ --pie-border-dark: #ffffff;
322
+ --pie-border-gray: #aaaaaa;
323
+ --pie-black: #e0e0e0;
324
+ --pie-white: #333333;
325
+ --pie-focus-checked: #cccccc;
326
+ --pie-focus-checked-border: #aaaaaa;
327
+ --pie-focus-unchecked: #555555;
328
+ --pie-focus-unchecked-border: #e0e0e0;
329
+ --pie-blue-grey-100: #2a2a2a;
330
+ --pie-blue-grey-300: #555555;
331
+ --pie-blue-grey-600: #999999;
332
+ --pie-blue-grey-900: #e0e0e0;
333
+ }