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