@astl/editor-tiptap 0.2.3 → 0.3.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/src/styles.ts CHANGED
@@ -203,7 +203,8 @@ const baseSurfaceStyles: CSSResult = css`
203
203
  .astl-page-remove-title,
204
204
  .astl-page-check,
205
205
  .astl-help-remove,
206
- .astl-help-free
206
+ .astl-help-free,
207
+ .astl-check-make
207
208
  ) {
208
209
  box-sizing: border-box;
209
210
  display: inline-flex;
@@ -242,7 +243,8 @@ const baseSurfaceStyles: CSSResult = css`
242
243
  .astl-page-remove-title,
243
244
  .astl-page-check,
244
245
  .astl-help-remove,
245
- .astl-help-free
246
+ .astl-help-free,
247
+ .astl-check-make
246
248
  ):hover {
247
249
  background: var(--astl-accent-soft);
248
250
  color: var(--astl-ink);
@@ -323,6 +325,102 @@ const baseSurfaceStyles: CSSResult = css`
323
325
  color: var(--astl-danger);
324
326
  }
325
327
 
328
+ /* A Check element (astl-check): the compact button it puts in the player, the accent's outline, then a tag saying how
329
+ many questions it checks; without any, the tag says so, dashed in the warning colour: never by colour alone. While
330
+ it is selected, the questions it checks have a dashed accent outline (astl-check-target), apart from the solid
331
+ focus ring. */
332
+ .astl-surface .astl-check {
333
+ box-sizing: border-box;
334
+ display: flex;
335
+ flex-wrap: wrap;
336
+ align-items: center;
337
+ gap: var(--astl-space-2);
338
+ inline-size: fit-content;
339
+ max-inline-size: 100%;
340
+ margin-block: var(--astl-space-2);
341
+ border-radius: var(--astl-radius-s);
342
+ font-family: var(--astl-font-body);
343
+ cursor: pointer;
344
+ }
345
+ .astl-surface .astl-check-button {
346
+ box-sizing: border-box;
347
+ display: inline-flex;
348
+ align-items: center;
349
+ gap: 0.25rem;
350
+ min-block-size: max(24px, var(--astl-editor-control-size, 1.75rem));
351
+ max-inline-size: 100%;
352
+ padding-inline: var(--astl-space-3);
353
+ border: var(--astl-outline-width) solid var(--astl-accent);
354
+ border-radius: var(--astl-radius-s);
355
+ background: var(--astl-surface);
356
+ color: var(--astl-ink);
357
+ font-size: var(--astl-editor-control-font-size, 0.8125rem);
358
+ font-weight: 600;
359
+ line-height: 1.2;
360
+ overflow-wrap: anywhere;
361
+ }
362
+ .astl-surface .astl-check-button .astl-icon {
363
+ flex: none;
364
+ inline-size: var(--astl-editor-control-icon-size, 0.875rem);
365
+ block-size: var(--astl-editor-control-icon-size, 0.875rem);
366
+ fill: none;
367
+ stroke: var(--astl-accent);
368
+ stroke-width: 2.2;
369
+ stroke-linecap: round;
370
+ stroke-linejoin: round;
371
+ }
372
+ .astl-surface .astl-check-tag {
373
+ padding-inline: 0.5em;
374
+ border: 1px solid transparent;
375
+ border-radius: var(--astl-radius-pill);
376
+ background: var(--astl-accent-soft);
377
+ color: var(--astl-ink);
378
+ font-size: var(--astl-size-small);
379
+ font-weight: 600;
380
+ line-height: 1.4;
381
+ }
382
+ .astl-surface .astl-check-tag:empty {
383
+ display: none;
384
+ }
385
+ .astl-surface .astl-check[data-empty] .astl-check-tag {
386
+ border-style: dashed;
387
+ border-color: var(--astl-warning);
388
+ background: var(--astl-warning-soft);
389
+ }
390
+ .astl-surface .astl-check-target {
391
+ outline: var(--astl-editor-focus-width, 2px) dashed var(--astl-accent);
392
+ outline-offset: 2px;
393
+ }
394
+ /* A chip sits in running text: its outline hugs it, never over the words beside it. */
395
+ .astl-surface .astl-chip.astl-check-target {
396
+ outline-offset: 0;
397
+ }
398
+ /* An automatic Check is the player's, not the exercise's: in a dashed box, its button dashed and muted, with "Make it
399
+ a button" after its tag. */
400
+ .astl-surface .astl-check-auto {
401
+ padding-block: var(--astl-space-1);
402
+ padding-inline: var(--astl-space-2);
403
+ border: 1px dashed var(--astl-outline);
404
+ cursor: default;
405
+ }
406
+ .astl-surface .astl-check-auto .astl-check-button {
407
+ border-style: dashed;
408
+ border-color: var(--astl-outline);
409
+ color: var(--astl-ink-muted);
410
+ }
411
+ .astl-surface .astl-check-make:focus-visible {
412
+ outline: var(--astl-editor-focus-width, 2px) solid var(--astl-focus);
413
+ outline-offset: var(--astl-editor-focus-offset, 1px);
414
+ }
415
+ @media (forced-colors: active) {
416
+ .astl-surface .astl-check-target {
417
+ outline-color: Highlight;
418
+ }
419
+ .astl-surface .astl-check-button .astl-icon {
420
+ stroke: CanvasText;
421
+ }
422
+ }
423
+
326
424
  /* The page is one flowing text; a block component on it is framed, with a label tab at the frame's top start (its
327
425
  type's icon, its label, a summary). The tab sits on the frame's top border, covering it. The frame with the cursor
328
426
  is the accent, its tab filled; one with an error or a warning is dashed in that colour and says its issues under