@obosbbl/grunnmuren-tailwind 2.4.5 → 2.4.7
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/README.md +7 -7
- package/font.css +4 -6
- package/package.json +10 -10
- package/tailwind-base.css +75 -27
- package/tailwind-typography.css +11 -11
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ Configure Tailwind to use the preset
|
|
|
21
21
|
```css
|
|
22
22
|
/* globals.css */
|
|
23
23
|
|
|
24
|
-
@import
|
|
24
|
+
@import '@obosbbl/grunnmuren-tailwind';
|
|
25
25
|
|
|
26
26
|
/** Add any auto excluded sources (typically residing in node_modules) */
|
|
27
27
|
@source "../../node_modules/@obosbbl/grunnmuren-react/dist";
|
|
@@ -51,9 +51,7 @@ To do that you need to configure the preset with `legacyV1Compatibility` option.
|
|
|
51
51
|
|
|
52
52
|
/** @type {import('tailwindcss').Config} */
|
|
53
53
|
module.exports = {
|
|
54
|
-
presets: [
|
|
55
|
-
require('@obosbbl/grunnmuren-tailwind')({ includeFontFallback: false }),
|
|
56
|
-
],
|
|
54
|
+
presets: [require('@obosbbl/grunnmuren-tailwind')({ includeFontFallback: false })],
|
|
57
55
|
// content: [ ... ]
|
|
58
56
|
};
|
|
59
57
|
```
|
|
@@ -66,6 +64,7 @@ The preset supports the following options:
|
|
|
66
64
|
| legacyV1Compatibility | `false` | Configures partial compatibility with Grunnmuren v1 |
|
|
67
65
|
|
|
68
66
|
## Migrating from v2?
|
|
67
|
+
|
|
69
68
|
Tailwind is upgraded to v4. The `grunnmuren-tailwind` package is now CSS-first configured. And the previously exposed JS config file is now replaced by a CSS config file.
|
|
70
69
|
|
|
71
70
|
The `legacyV1Compatibility` option is removed, so your project has to be fully upgraded to Grunnmuren v2.
|
|
@@ -73,15 +72,16 @@ The `legacyV1Compatibility` option is removed, so your project has to be fully u
|
|
|
73
72
|
The `includeFontFallback` option is also removed, and a font fallback will automatically be applied to the OBOS fonts by defaullt.
|
|
74
73
|
|
|
75
74
|
## Migration
|
|
75
|
+
|
|
76
76
|
1. Upgrade your project to Tailwind 4. You can try the [migration guide](https://tailwindcss.com/docs/upgrade-guide)
|
|
77
|
-
|
|
77
|
+
from tailwind.
|
|
78
78
|
2. Add `@import "@obosbbl/grunnmuren-tailwind";` to the top of the main CSS file of your project. This is the new CSS configuration file for Grunnmuren.
|
|
79
79
|
3. If you have a JS/TS `tailwind.config` in your project and would like to keep it. You can include it in the main CSS file (mentioned in step 2), by using the `@config` directive, e.g: `@config '../tailwind.config.ts';`. Read more [here](https://tailwindcss.com/docs/functions-and-directives#compatibility).
|
|
80
80
|
4. Finally, if you would like to get rid of the old `tailwind.config`. You can move all your configuration to the main CSS file of your project. Tailwind 4 has automatic content detection, but if you need to include some excluded source you can use the `@source` directive, e.g: `@source "./node_modules/@obosbbl/grunnmuren-react/dist";`. You can also extend the `@obosbbl/grunnmuren-tailwind` config by using various directives such as `@base` or `@theme`.
|
|
81
81
|
|
|
82
|
-
Here is an example of what your main CSS file
|
|
82
|
+
Here is an example of what your main CSS file **might** look like after migration:
|
|
83
83
|
|
|
84
|
-
```
|
|
84
|
+
```CSS
|
|
85
85
|
@import "@obosbbl/grunnmuren-tailwind";
|
|
86
86
|
|
|
87
87
|
@source "../../node_modules/@obosbbl/grunnmuren-react/dist";
|
package/font.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@layer base {
|
|
2
2
|
@font-face {
|
|
3
|
-
font-family:
|
|
4
|
-
src: local(
|
|
3
|
+
font-family: '__OBOSText_Fallback';
|
|
4
|
+
src: local('Arial');
|
|
5
5
|
size-adjust: 100%;
|
|
6
6
|
ascent-override: 94%;
|
|
7
7
|
descent-override: 26%;
|
|
@@ -9,13 +9,11 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
@font-face {
|
|
12
|
-
font-family:
|
|
13
|
-
src: local(
|
|
12
|
+
font-family: '__OBOSDisplay_Fallback';
|
|
13
|
+
src: local('Arial');
|
|
14
14
|
size-adjust: 100%;
|
|
15
15
|
ascent-override: 94%;
|
|
16
16
|
descent-override: 26%;
|
|
17
17
|
line-gap-override: 0%;
|
|
18
18
|
}
|
|
19
|
-
|
|
20
19
|
}
|
|
21
|
-
|
package/package.json
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@obosbbl/grunnmuren-tailwind",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.7",
|
|
4
4
|
"description": "Grunnmuren Tailwind preset",
|
|
5
|
+
"license": "MIT",
|
|
5
6
|
"repository": {
|
|
6
7
|
"url": "https://github.com/code-obos/grunnmuren"
|
|
7
8
|
},
|
|
8
|
-
"license": "MIT",
|
|
9
|
-
"type": "commonjs",
|
|
10
|
-
"exports": {
|
|
11
|
-
".": "./tailwind-base.css"
|
|
12
|
-
},
|
|
13
9
|
"files": [
|
|
14
10
|
"tailwind-base.css",
|
|
15
11
|
"tailwind-typography.css",
|
|
16
12
|
"font.css"
|
|
17
13
|
],
|
|
14
|
+
"type": "commonjs",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": "./tailwind-base.css"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"tw-animate-css": "^1.2.5"
|
|
20
|
+
},
|
|
18
21
|
"devDependencies": {
|
|
19
|
-
"tailwindcss": "4.1
|
|
22
|
+
"tailwindcss": "4.2.1"
|
|
20
23
|
},
|
|
21
24
|
"peerDependencies": {
|
|
22
25
|
"tailwindcss": "^4.0.0"
|
|
23
26
|
},
|
|
24
|
-
"dependencies": {
|
|
25
|
-
"tw-animate-css": "^1.2.5"
|
|
26
|
-
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"font-fallback": "bun --cwd=./fonts ./generate-font-fallback.ts"
|
|
29
29
|
}
|
package/tailwind-base.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
@import
|
|
2
|
-
@import
|
|
3
|
-
@import
|
|
4
|
-
@import
|
|
1
|
+
@import 'tailwindcss';
|
|
2
|
+
@import 'tw-animate-css';
|
|
3
|
+
@import './tailwind-typography';
|
|
4
|
+
@import './font';
|
|
5
5
|
|
|
6
6
|
@theme {
|
|
7
7
|
/*** Font stacks ***/
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
font-family: OBOSText;
|
|
50
50
|
font-weight: 400;
|
|
51
51
|
font-style: normal;
|
|
52
|
-
src: url(
|
|
52
|
+
src: url('https://www.obos.no/fonts/OBOSText-Regular.woff2') format('woff2');
|
|
53
53
|
font-display: swap;
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
font-family: OBOSText;
|
|
58
58
|
font-weight: 400;
|
|
59
59
|
font-style: italic;
|
|
60
|
-
src: url(
|
|
60
|
+
src: url('https://www.obos.no/fonts/OBOSText-Italic.woff2') format('woff2');
|
|
61
61
|
font-display: swap;
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
font-family: OBOSText;
|
|
66
66
|
font-weight: 500;
|
|
67
67
|
font-style: normal;
|
|
68
|
-
src: url(
|
|
68
|
+
src: url('https://www.obos.no/fonts/OBOSText-Medium.woff2') format('woff2');
|
|
69
69
|
font-display: swap;
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -73,8 +73,7 @@
|
|
|
73
73
|
font-family: OBOSDisplay;
|
|
74
74
|
font-weight: 600; /* SemiBold */
|
|
75
75
|
font-style: normal;
|
|
76
|
-
src: url(
|
|
77
|
-
format("woff2");
|
|
76
|
+
src: url('https://www.obos.no/fonts/OBOSDisplay-SemiBold.woff2') format('woff2');
|
|
78
77
|
font-display: swap;
|
|
79
78
|
}
|
|
80
79
|
|
|
@@ -121,9 +120,49 @@
|
|
|
121
120
|
/** Grid container that applies the grid columns, grid spacing and the container component class */
|
|
122
121
|
@utility layout-grid-container {
|
|
123
122
|
@apply layout-grid container;
|
|
124
|
-
/**
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
/**
|
|
124
|
+
* Make content of the grid span the mid 12 columns as a default,
|
|
125
|
+
* unless the child has an explicit col-span or col-end class.
|
|
126
|
+
*
|
|
127
|
+
* We use ^= (starts with) and *= ' ' (space-preceded) to only match classes
|
|
128
|
+
* that apply to the element itself, not descendant selectors like *:col-span-* or **:col-span-*.
|
|
129
|
+
*/
|
|
130
|
+
&
|
|
131
|
+
> *:not(
|
|
132
|
+
:where(
|
|
133
|
+
[class^='col-span'],
|
|
134
|
+
[class*=' col-span'],
|
|
135
|
+
[class^='col-end'],
|
|
136
|
+
[class*=' col-end'],
|
|
137
|
+
[class^='sm:col-span'],
|
|
138
|
+
[class*=' sm:col-span'],
|
|
139
|
+
[class^='sm:col-end'],
|
|
140
|
+
[class*=' sm:col-end'],
|
|
141
|
+
|
|
142
|
+
)
|
|
143
|
+
) {
|
|
144
|
+
@apply sm:col-span-12;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Default col-start for grid children.
|
|
149
|
+
* Apply sm:col-start-2 unless the child has an explicit col-start or col-span-full class.
|
|
150
|
+
*/
|
|
151
|
+
&
|
|
152
|
+
> *:not(
|
|
153
|
+
:where(
|
|
154
|
+
[class^='col-start'],
|
|
155
|
+
[class*=' col-start'],
|
|
156
|
+
[class^='col-span-full'],
|
|
157
|
+
[class*=' col-span-full'],
|
|
158
|
+
[class^='sm:col-start'],
|
|
159
|
+
[class*=' sm:col-start'],
|
|
160
|
+
[class^='sm:col-span-full'],
|
|
161
|
+
[class*=' sm:col-span-full'],
|
|
162
|
+
|
|
163
|
+
)
|
|
164
|
+
) {
|
|
165
|
+
@apply sm:col-start-2;
|
|
127
166
|
}
|
|
128
167
|
}
|
|
129
168
|
|
|
@@ -167,6 +206,15 @@
|
|
|
167
206
|
@utility layout-subgrid-12 {
|
|
168
207
|
@apply grid-cols-12;
|
|
169
208
|
}
|
|
209
|
+
@utility layout-subgrid-13 {
|
|
210
|
+
@apply grid-cols-13;
|
|
211
|
+
}
|
|
212
|
+
@utility layout-subgrid-14 {
|
|
213
|
+
@apply grid-cols-14;
|
|
214
|
+
}
|
|
215
|
+
@utility layout-subgrid-full {
|
|
216
|
+
@apply layout-subgrid-14;
|
|
217
|
+
}
|
|
170
218
|
|
|
171
219
|
@utility layout-gap-x {
|
|
172
220
|
@apply gap-x-2;
|
|
@@ -262,16 +310,16 @@
|
|
|
262
310
|
|
|
263
311
|
@layer components {
|
|
264
312
|
/*** Link List component styles ***/
|
|
265
|
-
[data-layout=
|
|
266
|
-
[data-slot=
|
|
313
|
+
[data-layout='grid'] {
|
|
314
|
+
[data-slot='link-list'] {
|
|
267
315
|
@apply @sm:gap-x-4 @md:gap-x-9 @lg:gap-x-12 @xl:gap-x-16;
|
|
268
|
-
&:has([data-slot=
|
|
269
|
-
:has([data-slot=
|
|
270
|
-
):not(:has([data-slot=
|
|
316
|
+
&:has([data-slot='link-list-item']:nth-child(6)):not(
|
|
317
|
+
:has([data-slot='link-list-item']:nth-child(9):last-child)
|
|
318
|
+
):not(:has([data-slot='link-list-item']:nth-child(11))) {
|
|
271
319
|
@apply @4xl:grid-cols-2;
|
|
272
320
|
}
|
|
273
|
-
&:has([data-slot=
|
|
274
|
-
&:has([data-slot=
|
|
321
|
+
&:has([data-slot='link-list-item']:nth-child(9):last-child),
|
|
322
|
+
&:has([data-slot='link-list-item']:nth-child(11)) {
|
|
275
323
|
@apply @4xl:grid-cols-3;
|
|
276
324
|
}
|
|
277
325
|
}
|
|
@@ -279,18 +327,18 @@
|
|
|
279
327
|
|
|
280
328
|
/*** Stepper component styles ***/
|
|
281
329
|
.stepper-container,
|
|
282
|
-
[data-slot=
|
|
330
|
+
[data-slot='stepper-container'] {
|
|
283
331
|
@apply relative max-lg:overflow-hidden max-lg:min-w-full;
|
|
284
332
|
/** Make room for the focus outline */
|
|
285
333
|
@apply max-lg:px-1;
|
|
286
334
|
}
|
|
287
335
|
|
|
288
336
|
.stepper,
|
|
289
|
-
[data-slot=
|
|
337
|
+
[data-slot='stepper'] {
|
|
290
338
|
counter-reset: step-counter;
|
|
291
339
|
@apply flex gap-x-2 lg:flex-col lg:gap-y-14;
|
|
292
340
|
|
|
293
|
-
[data-slot=
|
|
341
|
+
[data-slot='step'] {
|
|
294
342
|
counter-increment: step-counter;
|
|
295
343
|
@apply flex items-center gap-x-2 relative max-lg:my-1.5 not-last:grow;
|
|
296
344
|
|
|
@@ -300,13 +348,13 @@
|
|
|
300
348
|
}
|
|
301
349
|
|
|
302
350
|
/** Place the focus styles on the ::before element instead of the link, since the link text is not visible on smaller screens */
|
|
303
|
-
&:has([data-slot=
|
|
351
|
+
&:has([data-slot='link']:focus-visible) {
|
|
304
352
|
&::before {
|
|
305
353
|
@apply outline-focus-offset;
|
|
306
354
|
}
|
|
307
355
|
}
|
|
308
356
|
|
|
309
|
-
[data-slot=
|
|
357
|
+
[data-slot='link'] {
|
|
310
358
|
@apply max-lg:absolute max-lg:opacity-0 max-lg:max-w-11 max-lg:overflow-x-hidden;
|
|
311
359
|
@apply focus-visible:outline-none;
|
|
312
360
|
/** Create a 44x44 px clickable area, where the step number next to each link will also be covered **/
|
|
@@ -317,14 +365,14 @@
|
|
|
317
365
|
@apply bg-white text-blue-dark;
|
|
318
366
|
}
|
|
319
367
|
|
|
320
|
-
&[data-state=
|
|
368
|
+
&[data-state='completed'] {
|
|
321
369
|
&::before {
|
|
322
370
|
@apply bg-blue-dark text-white;
|
|
323
371
|
}
|
|
324
372
|
}
|
|
325
373
|
|
|
326
374
|
/* order matters here, as data-current selector needs to come after completed state selector */
|
|
327
|
-
&[data-current=
|
|
375
|
+
&[data-current='true'] {
|
|
328
376
|
&::before {
|
|
329
377
|
@apply bg-sky-light border-4 text-blue-dark;
|
|
330
378
|
}
|
|
@@ -334,7 +382,7 @@
|
|
|
334
382
|
@apply text-white absolute border-2 border-white bg-blue-dark rounded-full left-4.5 -top-1.5 size-5;
|
|
335
383
|
}
|
|
336
384
|
|
|
337
|
-
[data-slot=
|
|
385
|
+
[data-slot='progress-bar'] {
|
|
338
386
|
@apply w-4 max-lg:grow lg:w-14 lg:rotate-90 lg:absolute lg:-left-3 lg:px-1.5 lg:-bottom-[calc(100%-2px)];
|
|
339
387
|
}
|
|
340
388
|
}
|
package/tailwind-typography.css
CHANGED
|
@@ -85,14 +85,14 @@
|
|
|
85
85
|
color: var(--tw-prose-body);
|
|
86
86
|
max-width: 696px;
|
|
87
87
|
|
|
88
|
-
:not(:where([class~=
|
|
88
|
+
:not(:where([class~='not-prose'], [class~='not-prose'] *)) {
|
|
89
89
|
&:where(p) {
|
|
90
90
|
@apply text-[1rem]/[1.625rem];
|
|
91
91
|
margin-top: 1.25em;
|
|
92
92
|
margin-bottom: 1.25em;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
&:where([class~=
|
|
95
|
+
&:where([class~='lead']) {
|
|
96
96
|
@apply font-medium text-[1.4375rem]/[2.25rem] lg:text-[1.625rem]/[2.5625rem];
|
|
97
97
|
margin-top: 1.2em;
|
|
98
98
|
margin-bottom: 1.2em;
|
|
@@ -129,39 +129,39 @@
|
|
|
129
129
|
padding-left: 1.625em;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
&:where(ol[type=
|
|
132
|
+
&:where(ol[type='A']) {
|
|
133
133
|
list-style-type: upper-alpha;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
&:where(ol[type=
|
|
136
|
+
&:where(ol[type='a']) {
|
|
137
137
|
list-style-type: lower-alpha;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
&:where(ol[type=
|
|
140
|
+
&:where(ol[type='A' s]) {
|
|
141
141
|
list-style-type: upper-alpha;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
&:where(ol[type=
|
|
144
|
+
&:where(ol[type='a' s]) {
|
|
145
145
|
list-style-type: lower-alpha;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
&:where(ol[type=
|
|
148
|
+
&:where(ol[type='I']) {
|
|
149
149
|
list-style-type: upper-roman;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
&:where(ol[type=
|
|
152
|
+
&:where(ol[type='i']) {
|
|
153
153
|
list-style-type: lower-roman;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
&:where(ol[type=
|
|
156
|
+
&:where(ol[type='I' s]) {
|
|
157
157
|
list-style-type: upper-roman;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
&:where(ol[type=
|
|
160
|
+
&:where(ol[type='i' s]) {
|
|
161
161
|
list-style-type: lower-roman;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
&:where(ol[type=
|
|
164
|
+
&:where(ol[type='1']) {
|
|
165
165
|
list-style-type: decimal;
|
|
166
166
|
}
|
|
167
167
|
|