You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .changeset/odd-yaks-switch.md
+4-11Lines changed: 4 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,28 +7,21 @@
7
7
8
8
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.
9
9
10
-
The `legacyV1Compatibility` option is now removed, so your project has to be fully upgraded to Grunnmuren v2.
10
+
The `legacyV1Compatibility` option is removed, so your project has to be fully upgraded to Grunnmuren v2.
11
+
12
+
The `includeFontFallback` option is also removed, and a font fallback will automatically be applied to the OBOS fonts by defaullt.
11
13
12
14
## Migration
13
15
1. Upgrade your project to Tailwind 4. You can try the [migration guide](https://tailwindcss.com/docs/upgrade-guide)
14
16
from tailwind.
15
17
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.
16
18
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).
17
-
4. 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`.
18
-
5. Finally, if you want to use the font fallback option: add `@import "@obosbbl/grunnmuren-tailwind/font-fallback";`**below**`@import "@obosbbl/grunnmuren-tailwind";`:
The order matters here, since the `@obosbbl/grunnmuren-tailwind/font-fallback` config overrides the font definitions of `"@obosbbl/grunnmuren-tailwind"`.
19
+
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`.
26
20
27
21
Here is an example of what your main CSS file __might__ look like after migration:
@@ -36,7 +34,7 @@ Fonts are automatically loaded from OBOS' CDN, so you don't have to host the fon
36
34
37
35
If you use [Content-Security-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP), you have to allow `https://www.obos.no` as a [font-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/font-src), otherwise the fonts will be blocked from loading.
38
36
39
-
The preset includes a (local) fallback font to prevent [CLS](https://web.dev/articles/cls) while the fonts are loading. This is similar to the [font optimization in Next](https://nextjs.org/docs/app/building-your-application/optimizing/fonts). This is enabled by default, but can be disabled with the `includeFontFallback` option.
37
+
The preset includes a (local) fallback font to prevent [CLS](https://web.dev/articles/cls) while the fonts are loading. This is similar to the [font optimization in Next](https://nextjs.org/docs/app/building-your-application/optimizing/fonts). This is enabled by default, and can only be disabled by a @theme override of the font variables in your own main tailwind CSS file.
40
38
41
39
The fallback font metrics is generated with a script that can be run with `pnpm font-fallback` (requires [Bun](https://bun.sh/)). If the fonts are changed, the script must be rerun and the resulting file commited.
42
40
@@ -68,25 +66,23 @@ The preset supports the following options:
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
+
71
+
The `legacyV1Compatibility` option is removed, so your project has to be fully upgraded to Grunnmuren v2.
72
+
73
+
The `includeFontFallback` option is also removed, and afont fallback will automatically be applied to the OBOS fonts by defaullt.
74
+
75
+
## Migration
71
76
1. Upgrade your project to Tailwind 4. You can try the [migration guide](https://tailwindcss.com/docs/upgrade-guide)
72
77
from tailwind.
73
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.
74
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).
75
-
4. 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`.
76
-
5. Finally, if you want to use the font fallback option: add `@import "@obosbbl/grunnmuren-tailwind/font-fallback";` **below** `@import "@obosbbl/grunnmuren-tailwind";`:
The order matters here, since the `@obosbbl/grunnmuren-tailwind/font-fallback` config overrides the font definitions of `"@obosbbl/grunnmuren-tailwind"`.
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`.
84
81
85
82
Here is an example of what your main CSS file __might__ look like after migration:
0 commit comments