Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
mb
  • Loading branch information
philipp-spiess committed Feb 17, 2025
commit b0fb97e40f32b18be7396f343dc440732da78408
4 changes: 2 additions & 2 deletions src/docs/upgrade-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ The generated CSS variables _will_ include a prefix to avoid conflicts with any

### Adding custom utilities

In v3, any custom classes you defined within `@layer utilities` would get picked up by Tailwind as a true utility class and would automatically work with variants like `hover`, `focus`, or `lg` with the difference being that `@layer components` would always come first in the generated stylesheet.
In v3, any custom classes you defined within `@layer utilities` or `@layer components` would get picked up by Tailwind as a true utility class and would automatically work with variants like `hover`, `focus`, or `lg` with the difference being that `@layer components` would always come first in the generated stylesheet.

In v4 we are using native cascade layers and no longer hijacking the `@layer` at-rule, so we've introduced the `@utility` API as a replacement:

Expand All @@ -613,7 +613,7 @@ In v4 we are using native cascade layers and no longer hijacking the `@layer` at
}
```

In v4, custom utilities are sorted based on the amount of properties they define. This means that component utilities like this `.btn` can be overwritten by other Tailwind utilities without additional configuration:
Custom utilities are now also sorted based on the amount of properties they define. This means that component utilities like this `.btn` can be overwritten by other Tailwind utilities without additional configuration:

```css
/* [!code filename:CSS] */
Expand Down