@obosbbl/grunnmuren-tailwind 2.4.11 → 2.4.12

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 (2) hide show
  1. package/package.json +1 -1
  2. package/tailwind-base.css +95 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obosbbl/grunnmuren-tailwind",
3
- "version": "2.4.11",
3
+ "version": "2.4.12",
4
4
  "description": "Grunnmuren Tailwind preset",
5
5
  "license": "MIT",
6
6
  "repository": {
package/tailwind-base.css CHANGED
@@ -367,6 +367,101 @@
367
367
  }
368
368
  }
369
369
 
370
+ /*** Toggletip component styles
371
+ *
372
+ * Like Pagination, these sit in the utilities layer because the close button is
373
+ * a Button whose cva-generated focus utility (outline-offset) we override — and
374
+ * rules in the components layer always lose the cascade to utilities. */
375
+ @utility gm-toggletip-trigger {
376
+ @apply cursor-pointer;
377
+
378
+ &[data-focus-visible] {
379
+ @apply outline-focus-offset;
380
+ }
381
+
382
+ /* Info variant — a 44×44 icon button with an inset focus ring. */
383
+ &[data-variant='info'] {
384
+ @apply text-blue-dark inline-grid size-11 place-content-center rounded-full;
385
+
386
+ &[data-focus-visible] {
387
+ @apply outline-focus-inset;
388
+ }
389
+
390
+ & > svg {
391
+ @apply size-6;
392
+ }
393
+ }
394
+
395
+ /* Definition variant — an inline term with a dashed underline, highlighted
396
+ yellow while the toggletip is open. */
397
+ &[data-variant='definition'] {
398
+ @apply rounded-xs underline decoration-dashed decoration-1 underline-offset-4;
399
+
400
+ &[aria-expanded='true'] {
401
+ @apply bg-yellow;
402
+ }
403
+ }
404
+ }
405
+
406
+ @utility gm-toggletip {
407
+ /* Cap at the 288px design max, but never wider than the viewport (minus
408
+ 12px each side) on narrow screens — RAC keeps the popover on-screen but
409
+ doesn't shrink its width. */
410
+ max-width: min(18rem, 100vw - 1.5rem);
411
+ @apply motion-reduce:animate-none;
412
+
413
+ &[data-entering] {
414
+ @apply fade-in animate-in;
415
+ }
416
+
417
+ &[data-exiting] {
418
+ @apply fade-out animate-out;
419
+ }
420
+
421
+ /* Arrow drawn in CSS (no inline SVG). The element is sized per orientation
422
+ and the ::before is clipped to a triangle pointing at the trigger. Default
423
+ is placement=bottom (popover below the trigger, arrow points up). */
424
+ & [data-slot='toggletip-arrow'] {
425
+ @apply h-2 w-4;
426
+
427
+ &::before {
428
+ content: '';
429
+ @apply bg-blue-dark block size-full;
430
+ clip-path: polygon(0 100%, 50% 0, 100% 100%); /* points up */
431
+ }
432
+ }
433
+ & [data-slot='toggletip-arrow'][data-placement='top']::before {
434
+ clip-path: polygon(0 0, 50% 100%, 100% 0); /* points down */
435
+ }
436
+ /* Side placements: swap the box to 8x16 so the triangle base sits flush
437
+ against the popover edge (no gap). */
438
+ & [data-slot='toggletip-arrow'][data-placement='left'],
439
+ & [data-slot='toggletip-arrow'][data-placement='right'] {
440
+ @apply h-4 w-2;
441
+ }
442
+ & [data-slot='toggletip-arrow'][data-placement='left']::before {
443
+ clip-path: polygon(0 0, 100% 50%, 0 100%); /* points right */
444
+ }
445
+ & [data-slot='toggletip-arrow'][data-placement='right']::before {
446
+ clip-path: polygon(100% 0, 0 50%, 100% 100%); /* points left */
447
+ }
448
+
449
+ /* Dialog body. */
450
+ & [data-slot='toggletip-dialog'] {
451
+ @apply bg-blue-dark relative rounded-lg p-4 pr-12 text-white outline-none;
452
+ }
453
+
454
+ /* Close button — positioned top-right with an inset white focus ring (white
455
+ from color="white") so it sits inside the button, clear of the popover edge. */
456
+ & [data-slot='toggletip-dialog'] > [data-slot='button'] {
457
+ @apply absolute top-1 right-1;
458
+
459
+ &:focus-visible {
460
+ @apply -outline-offset-4;
461
+ }
462
+ }
463
+ }
464
+
370
465
  /** Hides the scrollbar visually */
371
466
  @utility scrollbar-hidden {
372
467
  /* For IE, Edge and Firefox */