Skip to content

Help needed with light/dark mode setup #261

Answered by dcastil
princemuel asked this question in Help
Discussion options

You must be logged in to vote

Thanks for the repro! I see the class text-700 which tailwind-merge interprets as a color and therefore removes the preceding class text-brand-900. I don't know what type of class that is, but if it isn't a color, you'll need to configure tailwind-merge to know what type of class it is. Here is a guide on how to do it: https://github.com/dcastil/tailwind-merge/blob/v1.13.2/docs/recipes.md#adding-custom-scale-from-tailwind-config-to-tailwind-merge-config

E.g. if it's a font-size class, you need this code:

const twMerge = extendTailwindMerge({
    classGroups: {
        'font-size': [{ text: ['100', '200', ] }]
    }
})

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@princemuel
Comment options

@dcastil
Comment options

Answer selected by princemuel
@princemuel
Comment options

@princemuel
Comment options

@dcastil
Comment options

@princemuel
Comment options

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