@doenet/doenetml-iframe 0.7.20 → 0.7.21

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@doenet/doenetml-iframe",
3
3
  "type": "module",
4
4
  "description": "A renderer for DoenetML contained in an iframe",
5
- "version": "0.7.20",
5
+ "version": "0.7.21",
6
6
  "license": "AGPL-3.0-or-later",
7
7
  "homepage": "https://github.com/Doenet/DoenetML#readme",
8
8
  "repository": {
package/style.css CHANGED
@@ -7,6 +7,10 @@
7
7
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
8
8
  }
9
9
 
10
+ .filter {
11
+ filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
12
+ }
13
+
10
14
  .keyboard-button {
11
15
  display: inline-flex;
12
16
  height: 2.5rem;
@@ -147,7 +151,7 @@
147
151
  }
148
152
 
149
153
  .virtual-keyboard button {
150
- background-color: #fff;
154
+ background-color: var(--kb-key-bg, #fff);
151
155
  display: inline-flex;
152
156
  height: 2.5rem;
153
157
  max-width: 4em;
@@ -272,6 +276,14 @@
272
276
  }
273
277
  }
274
278
 
279
+ .virtual-keyboard-tab-list button {
280
+ /* Non-selected tabs: slate-200 underline so only the selected tab's
281
+ blue indicator stands out. Without an explicit color this falls
282
+ back to currentColor (black), drawing a harsh line under every tab. */
283
+ --tw-border-opacity: 1;
284
+ border-color: rgb(226 232 240 / var(--tw-border-opacity, 1));
285
+ }
286
+
275
287
  .virtual-keyboard-tab-list button[aria-selected="true"] {
276
288
  --tw-border-opacity: 1;
277
289
  border-color: rgb(96 165 250 / var(--tw-border-opacity, 1));
@@ -289,6 +301,9 @@ Tailwind base is purposely not included because we want all styles to be prefixe
289
301
  --tw-blur: blur(8px);
290
302
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
291
303
  }
304
+ .filter {
305
+ filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
306
+ }
292
307
 
293
308
  /*
294
309
  * Some styles from tailwind preflight need to be included here
@@ -317,7 +332,7 @@ Tailwind base is purposely not included because we want all styles to be prefixe
317
332
  --tw-scale-y: 1;
318
333
  --tw-scroll-snap-strictness: proximity;
319
334
  --tw-ring-offset-width: 0px;
320
- --tw-ring-offset-color: #fff;
335
+ --tw-ring-offset-color: var(--kb-ring-offset, #fff);
321
336
  --tw-ring-color: rgb(59 130 246 / 0.5);
322
337
  --tw-ring-offset-shadow: 0 0 #0000;
323
338
  --tw-ring-shadow: 0 0 #0000;
@@ -325,9 +340,15 @@ Tailwind base is purposely not included because we want all styles to be prefixe
325
340
  --tw-shadow-colored: 0 0 #0000;
326
341
  --tw-border-opacity: 1;
327
342
 
343
+ /* Theme tokens — light-mode defaults */
344
+ --kb-tray-bg: white;
345
+ --kb-tray-border-top: black;
346
+ --kb-ring-offset: #fff;
347
+ --kb-key-bg: #fff;
348
+
328
349
  --keyboard-tray-height: 280px;
329
350
 
330
- border-top: 1px solid black;
351
+ border-top: 1px solid var(--kb-tray-border-top);
331
352
 
332
353
  position: fixed;
333
354
 
@@ -355,7 +376,7 @@ Tailwind base is purposely not included because we want all styles to be prefixe
355
376
  min-height: var(--keyboard-tray-height);
356
377
  max-height: calc(100vh - 1.5rem);
357
378
  z-index: 10000;
358
- background-color: white;
379
+ background-color: var(--kb-tray-bg);
359
380
  }
360
381
 
361
382
  #virtual-keyboard-tray .close-keyboard-button {
@@ -444,6 +465,111 @@ Tailwind base is purposely not included because we want all styles to be prefixe
444
465
  margin-right: auto;
445
466
  }
446
467
 
468
+ /* Dark-mode overrides — applied when data-theme="dark" is written to #virtual-keyboard-tray */
469
+ #virtual-keyboard-tray[data-theme="dark"] {
470
+ --kb-tray-bg: #1e1e1e;
471
+ --kb-tray-border-top: #555;
472
+ --kb-ring-offset: #1e1e1e;
473
+ --kb-key-bg: #2d2d2d;
474
+
475
+ color: white;
476
+ }
477
+ /*
478
+ * Browsers have a UA stylesheet rule `button { color: ButtonText }` which
479
+ * is an explicit UA-level declaration and beats an *inherited* `color:
480
+ * white` from a parent. We must set color explicitly on button elements
481
+ * so the author rule overrides UA. This also makes MathJax SVG paths
482
+ * (which use fill:currentColor) render white rather than the UA button
483
+ * color.
484
+ */
485
+ #virtual-keyboard-tray[data-theme="dark"] button {
486
+ color: white;
487
+ }
488
+ /* Close (×) button */
489
+ #virtual-keyboard-tray[data-theme="dark"] .close-keyboard-button:hover {
490
+ background-color: #3a3a3a;
491
+ }
492
+ #virtual-keyboard-tray[data-theme="dark"] .close-keyboard-button:active {
493
+ background-color: #4a4a4a;
494
+ }
495
+ /* Open-keyboard tab that peeks above the tray */
496
+ #virtual-keyboard-tray[data-theme="dark"] .open-keyboard-button {
497
+ background-color: #2d2d2d;
498
+ border-color: #555;
499
+ border-bottom-color: transparent;
500
+ }
501
+ #virtual-keyboard-tray[data-theme="dark"] .open-keyboard-button:hover {
502
+ background-color: #3a3a3a;
503
+ }
504
+ #virtual-keyboard-tray[data-theme="dark"] .open-keyboard-button:active {
505
+ background-color: #4a4a4a;
506
+ }
507
+ /*
508
+ * Key faces — target via .virtual-keyboard button because @apply in
509
+ * keyboard.css inlines styles without adding the class to the HTML element.
510
+ * These override the light-mode .virtual-keyboard button:hover / :active
511
+ * rules (light grey slate-100/slate-300) that become invisible with white text.
512
+ */
513
+ #virtual-keyboard-tray[data-theme="dark"] .virtual-keyboard button {
514
+ background-color: #2d2d2d;
515
+ border-color: #4a4a4a;
516
+ }
517
+ #virtual-keyboard-tray[data-theme="dark"] .virtual-keyboard button:hover {
518
+ background-color: #3a3a3a;
519
+ }
520
+ #virtual-keyboard-tray[data-theme="dark"] .virtual-keyboard button:active {
521
+ background-color: #4a4a4a;
522
+ }
523
+ /*
524
+ * Special keys (backspace, shift, space, arrows, enter).
525
+ * These use @apply special-button in keyboard.css which compiles to
526
+ * .virtual-keyboard .key-space, .virtual-keyboard .key-backspace etc.
527
+ * — the HTML elements have .key-space/.key-backspace class, not .special-button.
528
+ * Specificity must beat .virtual-keyboard .key-* at (0, 2, 0).
529
+ */
530
+ #virtual-keyboard-tray[data-theme="dark"] .virtual-keyboard .key-space,
531
+ #virtual-keyboard-tray[data-theme="dark"] .virtual-keyboard .key-backspace,
532
+ #virtual-keyboard-tray[data-theme="dark"] .virtual-keyboard .key-left,
533
+ #virtual-keyboard-tray[data-theme="dark"] .virtual-keyboard .key-right,
534
+ #virtual-keyboard-tray[data-theme="dark"] .virtual-keyboard .key-shift,
535
+ #virtual-keyboard-tray[data-theme="dark"] .virtual-keyboard .key-enter {
536
+ background-color: #383838;
537
+ border-color: #383838;
538
+ }
539
+ #virtual-keyboard-tray[data-theme="dark"] .virtual-keyboard .key-space:hover,
540
+ #virtual-keyboard-tray[data-theme="dark"] .virtual-keyboard .key-backspace:hover,
541
+ #virtual-keyboard-tray[data-theme="dark"] .virtual-keyboard .key-left:hover,
542
+ #virtual-keyboard-tray[data-theme="dark"] .virtual-keyboard .key-right:hover,
543
+ #virtual-keyboard-tray[data-theme="dark"] .virtual-keyboard .key-shift:hover,
544
+ #virtual-keyboard-tray[data-theme="dark"] .virtual-keyboard .key-enter:hover {
545
+ background-color: #454545;
546
+ border-color: #454545;
547
+ }
548
+ #virtual-keyboard-tray[data-theme="dark"] .virtual-keyboard .key-space:active,
549
+ #virtual-keyboard-tray[data-theme="dark"] .virtual-keyboard .key-backspace:active,
550
+ #virtual-keyboard-tray[data-theme="dark"] .virtual-keyboard .key-left:active,
551
+ #virtual-keyboard-tray[data-theme="dark"] .virtual-keyboard .key-right:active,
552
+ #virtual-keyboard-tray[data-theme="dark"] .virtual-keyboard .key-shift:active,
553
+ #virtual-keyboard-tray[data-theme="dark"] .virtual-keyboard .key-enter:active {
554
+ background-color: #555555;
555
+ border-color: #555555;
556
+ color: white;
557
+ }
558
+ /*
559
+ * Selected tab indicator.
560
+ * blue-400 (#60a5fa) on #1e1e1e ≈ 6.9:1 — WCAG AA ✓
561
+ * blue-300 (#93c5fd) on #1e1e1e ≈ 8.6:1 — WCAG AA ✓
562
+ */
563
+ #virtual-keyboard-tray[data-theme="dark"] .virtual-keyboard-tab-list button[aria-selected="true"] {
564
+ border-color: #60a5fa;
565
+ color: #93c5fd;
566
+ }
567
+ /* Non-selected tab borders: use a dim separator instead of transparent
568
+ so the tab strip has a subtle anchor line in dark mode. */
569
+ #virtual-keyboard-tray[data-theme="dark"] .virtual-keyboard-tab-list button:not([aria-selected="true"]) {
570
+ border-color: #444;
571
+ }
572
+
447
573
  #virtual-keyboard-tray.open {
448
574
  --tw-translate-y: 0px;
449
575
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));