Skip to content

TailwindCSS v4.0 and dynamic/autonomous extendTailwindMerge. #532

Discussion options

You must be logged in to vote

Hey @quentinjeanningros! 👋

My general recommendation is to copy over the values. Usually this isn't a problem because people don't change their Tailwind config so much. In Tailwind CSS v4 you also can use the theme for all the CSS variables and don't need to use class groups for those (more in the docs).

export const twMerge = extendTailwindMerge({
    extend: {
        theme: {
            // Added CSS variables --text-my-text-size-1 and --text-my-text-size-2
            text: ['my-text-size-1', 'my-text-size-2'],
            // Added CSS variables --spacing-my-spacing-1 and --spacing-my-spacing-2
            spacing: ['my-spacing-1', 'my-spacing-2'],
            // …
        }
    }
})

B…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@quentinjeanningros
Comment options

@dcastil
Comment options

@dcastil
Comment options

@quentinjeanningros
Comment options

Answer selected by quentinjeanningros
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
context-v3 Related to tailwind-merge v3
2 participants