@obosbbl/grunnmuren-tailwind 2.4.10 → 2.4.11

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 +67 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obosbbl/grunnmuren-tailwind",
3
- "version": "2.4.10",
3
+ "version": "2.4.11",
4
4
  "description": "Grunnmuren Tailwind preset",
5
5
  "license": "MIT",
6
6
  "repository": {
package/tailwind-base.css CHANGED
@@ -300,6 +300,73 @@
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
+
303
370
  /** Hides the scrollbar visually */
304
371
  @utility scrollbar-hidden {
305
372
  /* For IE, Edge and Firefox */