@obosbbl/grunnmuren-tailwind 2.4.10 → 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.
- package/package.json +1 -1
- package/tailwind-base.css +162 -0
package/package.json
CHANGED
package/tailwind-base.css
CHANGED
|
@@ -300,6 +300,168 @@
|
|
|
300
300
|
@apply ring-focus ring-offset-2;
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
+
/*** Pagination component styles
|
|
304
|
+
*
|
|
305
|
+
* These have to sit in the utilities layer (not `@layer components`) because
|
|
306
|
+
* they override Button's cva-generated utility classes — `.transition-colors`
|
|
307
|
+
* and `.outline-white`. Rules in the components layer are emitted before
|
|
308
|
+
* utilities and always lose the cascade regardless of selector specificity. */
|
|
309
|
+
@utility gm-pagination {
|
|
310
|
+
@apply flex items-center justify-center gap-2;
|
|
311
|
+
/* The list is the container that drives the responsive hide of the
|
|
312
|
+
outermost page slots — see `[data-outer]` below. */
|
|
313
|
+
container-type: inline-size;
|
|
314
|
+
|
|
315
|
+
/* Every <li> slot is fixed 44px wide and doesn't shrink — keeps the layout
|
|
316
|
+
stable when an ellipsis is swapped in for a page number. */
|
|
317
|
+
& > li {
|
|
318
|
+
@apply w-11 shrink-0;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/* Ellipsis slot — flex-centered "…" with an sr-only label describing the
|
|
322
|
+
skipped range. */
|
|
323
|
+
& > li[data-slot='ellipsis'] {
|
|
324
|
+
@apply flex size-11 items-center justify-center;
|
|
325
|
+
|
|
326
|
+
/* The label span is the one without `aria-hidden` (the visible "…" has
|
|
327
|
+
it). Selecting via the attribute absence avoids adding another marker. */
|
|
328
|
+
& > span:not([aria-hidden]) {
|
|
329
|
+
@apply sr-only;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/* Page-number buttons hold text, not an icon — force a square 44×44
|
|
334
|
+
(the Button `isIconOnly` variant is for icons). `transition-none`
|
|
335
|
+
prevents the hover-colour transition from flickering when rapid clicks
|
|
336
|
+
change which button is active. `:not(:has(svg))` distinguishes them
|
|
337
|
+
from prev/next which contain a chevron icon. */
|
|
338
|
+
& [data-slot='button']:not(:has(svg)) {
|
|
339
|
+
@apply size-11 transition-none;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/* color="white" sets outline-white for focus — invisible on white page
|
|
343
|
+
backgrounds. Force black via this higher-specificity selector so we
|
|
344
|
+
don't fight cva ordering inside Button. */
|
|
345
|
+
& [data-slot='button']:focus-visible {
|
|
346
|
+
@apply outline-black;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/* At a boundary, prev/next is rendered as a `<button>` (no href in JSX),
|
|
350
|
+
and our manual aria-disabled passes through (RACButton's useButton
|
|
351
|
+
forwards it, unlike RACLink which strips it). */
|
|
352
|
+
& [data-slot='button'][aria-disabled='true'] {
|
|
353
|
+
@apply cursor-default opacity-30;
|
|
354
|
+
|
|
355
|
+
&:hover {
|
|
356
|
+
@apply bg-white;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/* When the list is narrower than its full 8-slot width (~408px), hide the
|
|
361
|
+
two outermost page items — `data-outer` is set in JS on the visiblePages
|
|
362
|
+
entries farthest from the current page. */
|
|
363
|
+
@container (max-width: 27rem) {
|
|
364
|
+
& [data-outer] {
|
|
365
|
+
display: none;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
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
|
+
|
|
303
465
|
/** Hides the scrollbar visually */
|
|
304
466
|
@utility scrollbar-hidden {
|
|
305
467
|
/* For IE, Edge and Firefox */
|