@obosbbl/grunnmuren-tailwind 2.4.5 → 2.4.6

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 CHANGED
@@ -21,7 +21,7 @@ Configure Tailwind to use the preset
21
21
  ```css
22
22
  /* globals.css */
23
23
 
24
- @import "@obosbbl/grunnmuren-tailwind";
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
- from tailwind.
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 __might__ look like after migration:
82
+ Here is an example of what your main CSS file **might** look like after migration:
83
83
 
84
- ``` CSS
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: "__OBOSText_Fallback";
4
- src: local("Arial");
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: "__OBOSDisplay_Fallback";
13
- src: local("Arial");
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.5",
3
+ "version": "2.4.6",
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.18"
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 "tailwindcss";
2
- @import "tw-animate-css";
3
- @import "./tailwind-typography";
4
- @import "./font";
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("https://www.obos.no/fonts/OBOSText-Regular.woff2") format("woff2");
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("https://www.obos.no/fonts/OBOSText-Italic.woff2") format("woff2");
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("https://www.obos.no/fonts/OBOSText-Medium.woff2") format("woff2");
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("https://www.obos.no/fonts/OBOSDisplay-SemiBold.woff2")
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
 
@@ -122,8 +121,22 @@
122
121
  @utility layout-grid-container {
123
122
  @apply layout-grid container;
124
123
  /** Make content of the grid span the mid 12 columns as a default (unless it has another explicit col-span class) */
125
- & > * {
126
- @apply sm:col-start-2 sm:col-span-12;
124
+ &
125
+ > *:not([class^='col-span-']):not([class^='col-end-']):not([class*=' col-span-']):not(
126
+ [class*=' col-end-']
127
+ ):not([class*=' sm:col-span-']):not([class*=' sm:col-end-']):not([class^='sm:col-span-']):not(
128
+ [class^='sm:col-end-']
129
+ ) {
130
+ @apply sm:col-span-12;
131
+ }
132
+
133
+ &
134
+ > *:not([class^='col-start-']):not([class^='col-span-full']):not([class*=' col-start-']):not(
135
+ [class*=' col-span-full']
136
+ ):not([class*=' sm:col-start-']):not([class*=' sm:col-span-full']):not(
137
+ [class^='sm:col-start-']
138
+ ):not([class^='sm:col-span-full']) {
139
+ @apply sm:col-start-2;
127
140
  }
128
141
  }
129
142
 
@@ -167,6 +180,15 @@
167
180
  @utility layout-subgrid-12 {
168
181
  @apply grid-cols-12;
169
182
  }
183
+ @utility layout-subgrid-13 {
184
+ @apply grid-cols-13;
185
+ }
186
+ @utility layout-subgrid-14 {
187
+ @apply grid-cols-14;
188
+ }
189
+ @utility layout-subgrid-full {
190
+ @apply layout-subgrid-14;
191
+ }
170
192
 
171
193
  @utility layout-gap-x {
172
194
  @apply gap-x-2;
@@ -262,16 +284,16 @@
262
284
 
263
285
  @layer components {
264
286
  /*** Link List component styles ***/
265
- [data-layout="grid"] {
266
- [data-slot="link-list"] {
287
+ [data-layout='grid'] {
288
+ [data-slot='link-list'] {
267
289
  @apply @sm:gap-x-4 @md:gap-x-9 @lg:gap-x-12 @xl:gap-x-16;
268
- &:has([data-slot="link-list-item"]:nth-child(6)):not(
269
- :has([data-slot="link-list-item"]:nth-child(9):last-child)
270
- ):not(:has([data-slot="link-list-item"]:nth-child(11))) {
290
+ &:has([data-slot='link-list-item']:nth-child(6)):not(
291
+ :has([data-slot='link-list-item']:nth-child(9):last-child)
292
+ ):not(:has([data-slot='link-list-item']:nth-child(11))) {
271
293
  @apply @4xl:grid-cols-2;
272
294
  }
273
- &:has([data-slot="link-list-item"]:nth-child(9):last-child),
274
- &:has([data-slot="link-list-item"]:nth-child(11)) {
295
+ &:has([data-slot='link-list-item']:nth-child(9):last-child),
296
+ &:has([data-slot='link-list-item']:nth-child(11)) {
275
297
  @apply @4xl:grid-cols-3;
276
298
  }
277
299
  }
@@ -279,18 +301,18 @@
279
301
 
280
302
  /*** Stepper component styles ***/
281
303
  .stepper-container,
282
- [data-slot="stepper-container"] {
304
+ [data-slot='stepper-container'] {
283
305
  @apply relative max-lg:overflow-hidden max-lg:min-w-full;
284
306
  /** Make room for the focus outline */
285
307
  @apply max-lg:px-1;
286
308
  }
287
309
 
288
310
  .stepper,
289
- [data-slot="stepper"] {
311
+ [data-slot='stepper'] {
290
312
  counter-reset: step-counter;
291
313
  @apply flex gap-x-2 lg:flex-col lg:gap-y-14;
292
314
 
293
- [data-slot="step"] {
315
+ [data-slot='step'] {
294
316
  counter-increment: step-counter;
295
317
  @apply flex items-center gap-x-2 relative max-lg:my-1.5 not-last:grow;
296
318
 
@@ -300,13 +322,13 @@
300
322
  }
301
323
 
302
324
  /** 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="link"]:focus-visible) {
325
+ &:has([data-slot='link']:focus-visible) {
304
326
  &::before {
305
327
  @apply outline-focus-offset;
306
328
  }
307
329
  }
308
330
 
309
- [data-slot="link"] {
331
+ [data-slot='link'] {
310
332
  @apply max-lg:absolute max-lg:opacity-0 max-lg:max-w-11 max-lg:overflow-x-hidden;
311
333
  @apply focus-visible:outline-none;
312
334
  /** Create a 44x44 px clickable area, where the step number next to each link will also be covered **/
@@ -317,14 +339,14 @@
317
339
  @apply bg-white text-blue-dark;
318
340
  }
319
341
 
320
- &[data-state="completed"] {
342
+ &[data-state='completed'] {
321
343
  &::before {
322
344
  @apply bg-blue-dark text-white;
323
345
  }
324
346
  }
325
347
 
326
348
  /* order matters here, as data-current selector needs to come after completed state selector */
327
- &[data-current="true"] {
349
+ &[data-current='true'] {
328
350
  &::before {
329
351
  @apply bg-sky-light border-4 text-blue-dark;
330
352
  }
@@ -334,7 +356,7 @@
334
356
  @apply text-white absolute border-2 border-white bg-blue-dark rounded-full left-4.5 -top-1.5 size-5;
335
357
  }
336
358
 
337
- [data-slot="progress-bar"] {
359
+ [data-slot='progress-bar'] {
338
360
  @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
361
  }
340
362
  }
@@ -85,14 +85,14 @@
85
85
  color: var(--tw-prose-body);
86
86
  max-width: 696px;
87
87
 
88
- :not(:where([class~="not-prose"], [class~="not-prose"] *)) {
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~="lead"]) {
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="A"]) {
132
+ &:where(ol[type='A']) {
133
133
  list-style-type: upper-alpha;
134
134
  }
135
135
 
136
- &:where(ol[type="a"]) {
136
+ &:where(ol[type='a']) {
137
137
  list-style-type: lower-alpha;
138
138
  }
139
139
 
140
- &:where(ol[type="A" s]) {
140
+ &:where(ol[type='A' s]) {
141
141
  list-style-type: upper-alpha;
142
142
  }
143
143
 
144
- &:where(ol[type="a" s]) {
144
+ &:where(ol[type='a' s]) {
145
145
  list-style-type: lower-alpha;
146
146
  }
147
147
 
148
- &:where(ol[type="I"]) {
148
+ &:where(ol[type='I']) {
149
149
  list-style-type: upper-roman;
150
150
  }
151
151
 
152
- &:where(ol[type="i"]) {
152
+ &:where(ol[type='i']) {
153
153
  list-style-type: lower-roman;
154
154
  }
155
155
 
156
- &:where(ol[type="I" s]) {
156
+ &:where(ol[type='I' s]) {
157
157
  list-style-type: upper-roman;
158
158
  }
159
159
 
160
- &:where(ol[type="i" s]) {
160
+ &:where(ol[type='i' s]) {
161
161
  list-style-type: lower-roman;
162
162
  }
163
163
 
164
- &:where(ol[type="1"]) {
164
+ &:where(ol[type='1']) {
165
165
  list-style-type: decimal;
166
166
  }
167
167