@obosbbl/grunnmuren-tailwind 2.3.1 → 2.4.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.3.1",
3
+ "version": "2.4.0",
4
4
  "description": "Grunnmuren Tailwind preset",
5
5
  "repository": {
6
6
  "url": "https://github.com/code-obos/grunnmuren"
@@ -16,7 +16,7 @@
16
16
  "font.css"
17
17
  ],
18
18
  "devDependencies": {
19
- "tailwindcss": "4.1.10"
19
+ "tailwindcss": "4.1.17"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "tailwindcss": "^4.0.0"
package/tailwind-base.css CHANGED
@@ -108,8 +108,13 @@
108
108
  @apply bg-white grow;
109
109
  }
110
110
 
111
+ /** Grid column spacing */
112
+ @utility layout-grid-gap-x {
113
+ @apply sm:gap-x-4 md:gap-x-9 lg:gap-x-12 xl:gap-x-16;
114
+ }
115
+
111
116
  @utility layout-gap-x {
112
- @apply gap-x-2 sm:gap-x-4 md:gap-x-9 lg:gap-x-12 xl:gap-x-16;
117
+ @apply gap-x-2 layout-grid-gap-x;
113
118
  }
114
119
 
115
120
  @utility layout-gap-y {
@@ -194,3 +199,143 @@
194
199
  display: none;
195
200
  }
196
201
  }
202
+
203
+ @layer components {
204
+ /*** Grid Layout ***/
205
+
206
+ .layout-grid,
207
+ .layout-grid-container {
208
+ /** Grid base: defines the grid columns and their spacing */
209
+ @apply layout-grid-gap-x sm:grid-cols-14 grid;
210
+
211
+ /** Grid container that applies the grid columns, grid spacing and the container component class */
212
+ &.layout-grid-container {
213
+ @apply container;
214
+ /** Make content of the grid span the mid 12 columns as a default (unless it has another explicit col-span class) */
215
+ & > * {
216
+ @apply sm:col-start-2 sm:col-span-12;
217
+ }
218
+ }
219
+ }
220
+
221
+ [class*="layout-subgrid-"] {
222
+ @apply layout-grid-gap-x grid;
223
+ }
224
+
225
+ [class*="layout-subgrid-1"] {
226
+ @apply grid-cols-1;
227
+ }
228
+ [class*="layout-subgrid-2"] {
229
+ @apply grid-cols-2;
230
+ }
231
+ [class*="layout-subgrid-3"] {
232
+ @apply grid-cols-3;
233
+ }
234
+ [class*="layout-subgrid-4"] {
235
+ @apply grid-cols-4;
236
+ }
237
+ [class*="layout-subgrid-5"] {
238
+ @apply grid-cols-5;
239
+ }
240
+ [class*="layout-subgrid-6"] {
241
+ @apply grid-cols-6;
242
+ }
243
+ [class*="layout-subgrid-7"] {
244
+ @apply grid-cols-7;
245
+ }
246
+ [class*="layout-subgrid-8"] {
247
+ @apply grid-cols-8;
248
+ }
249
+ [class*="layout-subgrid-9"] {
250
+ @apply grid-cols-9;
251
+ }
252
+ [class*="layout-subgrid-10"] {
253
+ @apply grid-cols-10;
254
+ }
255
+ [class*="layout-subgrid-11"] {
256
+ @apply grid-cols-11;
257
+ }
258
+ [class*="layout-subgrid-12"] {
259
+ @apply grid-cols-12;
260
+ }
261
+
262
+ /*** Link List component styles ***/
263
+ .link-list-container {
264
+ @apply @container;
265
+
266
+ &:has([data-slot="heading"]) {
267
+ .link-list,
268
+ [data-slot="link-list"] {
269
+ @apply overflow-visible;
270
+ }
271
+ }
272
+
273
+ [data-slot="heading"] {
274
+ @apply p-1.25;
275
+
276
+ [data-slot="link"] {
277
+ @apply py-2.25;
278
+ & > svg {
279
+ @apply text-base;
280
+ }
281
+ }
282
+
283
+ &:not(:has([data-slot="link"])) {
284
+ @apply my-2.25;
285
+ }
286
+ }
287
+
288
+ [data-slot="link-list"] {
289
+ @apply @sm:gap-x-4 @md:gap-x-9 @lg:gap-x-12 @xl:gap-x-16;
290
+
291
+ &:has([data-slot="link-list-item"]:nth-child(6)):not(
292
+ :has([data-slot="link-list-item"]:nth-child(9):last-child)
293
+ ):not(:has([data-slot="link-list-item"]:nth-child(11))) {
294
+ @apply @4xl:grid-cols-2;
295
+ }
296
+ &:has([data-slot="link-list-item"]:nth-child(9):last-child),
297
+ &:has([data-slot="link-list-item"]:nth-child(11)) {
298
+ @apply @4xl:grid-cols-3;
299
+ }
300
+ }
301
+ }
302
+
303
+ .link-list,
304
+ [data-slot="link-list"] {
305
+ /**
306
+ * Hides dividers at the top of the list (overflow-y)
307
+ * while preventing arrow icons from overflowing container when animated to the right (overflow-x)
308
+ */
309
+ @apply min-w-fit overflow-hidden grid auto-rows-max gap-y-px;
310
+ }
311
+
312
+ .link-list-item,
313
+ [data-slot="link-list-item"] {
314
+ /** Creates divider lines that works in any grid layout and with the focus ring */
315
+ @apply after:-top-px relative p-1.25 after:absolute after:right-0 after:left-0 after:h-px after:w-full after:bg-gray-light;
316
+ [data-slot="link"] {
317
+ @apply paragraph;
318
+ }
319
+ }
320
+
321
+ .link-list-container,
322
+ .link-list-item,
323
+ [data-slot="link-list-item"] {
324
+ [data-slot="link"] {
325
+ @apply flex w-full cursor-pointer justify-between gap-x-2 py-3.5 font-medium no-underline focus-visible:outline-focus;
326
+ }
327
+ }
328
+
329
+ .link-list-container [data-slot="link"],
330
+ [data-slot="link-list-item"] [data-slot="link"] {
331
+ &:hover:not([download]):not([rel~="external"]) svg {
332
+ @apply motion-safe:translate-x-1;
333
+ }
334
+ &[download]:hover svg {
335
+ @apply motion-safe:translate-y-1;
336
+ }
337
+ &[rel~="external"]:hover svg {
338
+ @apply motion-safe:-translate-y-0.5 motion-safe:translate-x-0.5;
339
+ }
340
+ }
341
+ }
@@ -3,33 +3,64 @@
3
3
  * To support the prose styles from the tailwindcss-typography plugin.
4
4
  */
5
5
 
6
- @custom-variant prose-headings (& :is(h1, h2, h3, h4, th):not(:where([class~='not-prose'], [class~='not-prose'] *)));
7
- @custom-variant prose-lead (& :is([class~="lead"]):not(:where([class~='not-prose'], [class~='not-prose'] *)));
8
- @custom-variant prose-h1 (& :is(h1):not(:where([class~='not-prose'], [class~='not-prose'] *)));
9
- @custom-variant prose-h2 (& :is(h2):not(:where([class~='not-prose'], [class~='not-prose'] *)));
10
- @custom-variant prose-h3 (& :is(h3):not(:where([class~='not-prose'], [class~='not-prose'] *)));
11
- @custom-variant prose-h4 (& :is(h4):not(:where([class~='not-prose'], [class~='not-prose'] *)));
12
- @custom-variant prose-p (& :is(p):not(:where([class~='not-prose'], [class~='not-prose'] *)));
13
- @custom-variant prose-a (& :is(a):not(:where([class~='not-prose'], [class~='not-prose'] *)));
14
- @custom-variant prose-blockquote (& :is(blockquote):not(:where([class~='not-prose'], [class~='not-prose'] *)));
15
- @custom-variant prose-figure (& :is(figure):not(:where([class~='not-prose'], [class~='not-prose'] *)));
16
- @custom-variant prose-figcaption (& :is(figcaption):not(:where([class~='not-prose'], [class~='not-prose'] *)));
17
- @custom-variant prose-strong (& :is(strong):not(:where([class~='not-prose'], [class~='not-prose'] *)));
18
- @custom-variant prose-em (& :is(em):not(:where([class~='not-prose'], [class~='not-prose'] *)));
19
- @custom-variant prose-kbd (& :is(kbd):not(:where([class~='not-prose'], [class~='not-prose'] *)));
20
- @custom-variant prose-code (& :is(code):not(:where([class~='not-prose'], [class~='not-prose'] *)));
21
- @custom-variant prose-pre (& :is(pre):not(:where([class~='not-prose'], [class~='not-prose'] *)));
22
- @custom-variant prose-ol (& :is(ol):not(:where([class~='not-prose'], [class~='not-prose'] *)));
23
- @custom-variant prose-ul (& :is(ul):not(:where([class~='not-prose'], [class~='not-prose'] *)));
24
- @custom-variant prose-li (& :is(li):not(:where([class~='not-prose'], [class~='not-prose'] *)));
25
- @custom-variant prose-table (& :is(table):not(:where([class~='not-prose'], [class~='not-prose'] *)));
26
- @custom-variant prose-thead (& :is(thead):not(:where([class~='not-prose'], [class~='not-prose'] *)));
27
- @custom-variant prose-tr (& :is(tr):not(:where([class~='not-prose'], [class~='not-prose'] *)));
28
- @custom-variant prose-th (& :is(th):not(:where([class~='not-prose'], [class~='not-prose'] *)));
29
- @custom-variant prose-td (& :is(td):not(:where([class~='not-prose'], [class~='not-prose'] *)));
30
- @custom-variant prose-img (& :is(img):not(:where([class~='not-prose'], [class~='not-prose'] *)));
31
- @custom-variant prose-video (& :is(video):not(:where([class~='not-prose'], [class~='not-prose'] *)));
32
- @custom-variant prose-hr (& :is(hr):not(:where([class~='not-prose'], [class~='not-prose'] *)));
6
+ @custom-variant prose-headings (&
7
+ :is(h1, h2, h3, h4, h5, th):not(
8
+ :where([class~="not-prose"], [class~="not-prose"] *)
9
+ ));
10
+ @custom-variant prose-lead (&
11
+ :is([class~="lead"]):not(:where([class~="not-prose"], [class~="not-prose"] *)));
12
+ @custom-variant prose-h1 (&
13
+ :is(h1):not(:where([class~="not-prose"], [class~="not-prose"] *)));
14
+ @custom-variant prose-h2 (&
15
+ :is(h2):not(:where([class~="not-prose"], [class~="not-prose"] *)));
16
+ @custom-variant prose-h3 (&
17
+ :is(h3):not(:where([class~="not-prose"], [class~="not-prose"] *)));
18
+ @custom-variant prose-h4 (&
19
+ :is(h4):not(:where([class~="not-prose"], [class~="not-prose"] *)));
20
+ @custom-variant prose-h5 (&
21
+ :is(h5):not(:where([class~="not-prose"], [class~="not-prose"] *)));
22
+ @custom-variant prose-p (&
23
+ :is(p):not(:where([class~="not-prose"], [class~="not-prose"] *)));
24
+ @custom-variant prose-a (&
25
+ :is(a):not(:where([class~="not-prose"], [class~="not-prose"] *)));
26
+ @custom-variant prose-blockquote (&
27
+ :is(blockquote):not(:where([class~="not-prose"], [class~="not-prose"] *)));
28
+ @custom-variant prose-figure (&
29
+ :is(figure):not(:where([class~="not-prose"], [class~="not-prose"] *)));
30
+ @custom-variant prose-figcaption (&
31
+ :is(figcaption):not(:where([class~="not-prose"], [class~="not-prose"] *)));
32
+ @custom-variant prose-strong (&
33
+ :is(strong):not(:where([class~="not-prose"], [class~="not-prose"] *)));
34
+ @custom-variant prose-em (&
35
+ :is(em):not(:where([class~="not-prose"], [class~="not-prose"] *)));
36
+ @custom-variant prose-kbd (&
37
+ :is(kbd):not(:where([class~="not-prose"], [class~="not-prose"] *)));
38
+ @custom-variant prose-code (&
39
+ :is(code):not(:where([class~="not-prose"], [class~="not-prose"] *)));
40
+ @custom-variant prose-pre (&
41
+ :is(pre):not(:where([class~="not-prose"], [class~="not-prose"] *)));
42
+ @custom-variant prose-ol (&
43
+ :is(ol):not(:where([class~="not-prose"], [class~="not-prose"] *)));
44
+ @custom-variant prose-ul (&
45
+ :is(ul):not(:where([class~="not-prose"], [class~="not-prose"] *)));
46
+ @custom-variant prose-li (&
47
+ :is(li):not(:where([class~="not-prose"], [class~="not-prose"] *)));
48
+ @custom-variant prose-table (&
49
+ :is(table):not(:where([class~="not-prose"], [class~="not-prose"] *)));
50
+ @custom-variant prose-thead (&
51
+ :is(thead):not(:where([class~="not-prose"], [class~="not-prose"] *)));
52
+ @custom-variant prose-tr (&
53
+ :is(tr):not(:where([class~="not-prose"], [class~="not-prose"] *)));
54
+ @custom-variant prose-th (&
55
+ :is(th):not(:where([class~="not-prose"], [class~="not-prose"] *)));
56
+ @custom-variant prose-td (&
57
+ :is(td):not(:where([class~="not-prose"], [class~="not-prose"] *)));
58
+ @custom-variant prose-img (&
59
+ :is(img):not(:where([class~="not-prose"], [class~="not-prose"] *)));
60
+ @custom-variant prose-video (&
61
+ :is(video):not(:where([class~="not-prose"], [class~="not-prose"] *)));
62
+ @custom-variant prose-hr (&
63
+ :is(hr):not(:where([class~="not-prose"], [class~="not-prose"] *)));
33
64
 
34
65
  @utility prose {
35
66
  --tw-prose-body: --theme(--color-black, initial);
@@ -164,10 +195,7 @@
164
195
  }
165
196
 
166
197
  &:where(blockquote) {
167
- @apply font-medium italic grid grid-cols-[3rem_1fr] gap-x-[0.4375rem]
168
- pt-4 text-[1.4375rem]/[2.25rem] lg:text-[1.625rem]/[2.5625rem]
169
- before:text-[4.6875rem]/[1.6875rem] before:font-display
170
- before:not-italic before:content-["“"];
198
+ @apply font-medium italic grid grid-cols-[3rem_1fr] gap-x-[0.4375rem] pt-4 text-[1.4375rem]/[2.25rem] lg:text-[1.625rem]/[2.5625rem] before:text-[4.6875rem]/[1.6875rem] before:font-display before:not-italic before:content-["“"];
171
199
  margin-top: 1.6em;
172
200
  margin-bottom: 1.6em;
173
201
  }
@@ -219,6 +247,12 @@
219
247
  margin-bottom: 0.5em;
220
248
  }
221
249
 
250
+ &:where(h5) {
251
+ @apply heading-xs;
252
+ margin-top: 1.4em;
253
+ margin-bottom: 0.4em;
254
+ }
255
+
222
256
  &:where(h4 strong) {
223
257
  font-weight: 700;
224
258
  color: inherit;
@@ -239,8 +273,9 @@
239
273
  font-weight: 500;
240
274
  font-family: inherit;
241
275
  color: var(--tw-prose-kbd);
242
- box-shadow: 0 0 0 1px --alpha(var(--tw-prose-kbd-shadows) / 10%), 0 3px 0
243
- --alpha(var(--tw-prose-kbd-shadows) / 10%);
276
+ box-shadow:
277
+ 0 0 0 1px --alpha(var(--tw-prose-kbd-shadows) / 10%),
278
+ 0 3px 0 --alpha(var(--tw-prose-kbd-shadows) / 10%);
244
279
  font-size: 0.875em;
245
280
  border-radius: 0.3125rem;
246
281
  padding-top: 0.1875em;
@@ -404,22 +439,6 @@
404
439
  margin-bottom: 0.75em;
405
440
  }
406
441
 
407
- &:where(.prose > ul > li > *:first-child) {
408
- margin-top: 1.25em;
409
- }
410
-
411
- &:where(.prose > ul > li > *:last-child) {
412
- margin-bottom: 1.25em;
413
- }
414
-
415
- &:where(.prose > ol > li > *:first-child) {
416
- margin-top: 1.25em;
417
- }
418
-
419
- &:where(.prose > ol > li > *:last-child) {
420
- margin-bottom: 1.25em;
421
- }
422
-
423
442
  &:where(ul ul, ul ol, ol ul, ol ol) {
424
443
  margin-top: 0.75em;
425
444
  margin-bottom: 0.75em;
@@ -451,6 +470,10 @@
451
470
  margin-top: 0;
452
471
  }
453
472
 
473
+ &:where(h5 + *) {
474
+ margin-top: 0;
475
+ }
476
+
454
477
  &:where(thead th:first-child) {
455
478
  padding-left: 0;
456
479
  }