Skip to content
Discussion options

You must be logged in to vote

Hey @djpsychofogbear! 👋

Indeed, the syntax of prefixes changed to look like a modifier, so the old way won't work anymore. But you can use experimentalParseClassName to get what you want:

const twMerge = extendTailwindMerge({
    experimentalParseClassName({ className, parseClassName }) {
        return parseClassName(
            className.startsWith('ui:') ? className.substring(3) : className
        )
    }
})

That will make tailwind-merge treat classes with ui: at the beginning as if that part wasn't there while preserving the original className that was passed to tailwind-merge. Just keep in mind that the experimentalParseClassName function can have breaking changes in minor version …

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@djpsychofogbear
Comment options

@gabriel-mopereira
Comment options

Answer selected by djpsychofogbear
Comment options

You must be logged in to vote
0 replies
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
4 participants