Tailwind-Styled-Component icon indicating copy to clipboard operation
Tailwind-Styled-Component copied to clipboard

Enhancement: export twMerge

Open alexjidras opened this issue 2 years ago • 1 comments

you could export twMerge function from 'tailwind-merge' as part of this package. So we don't have to install 'tailwind-merge' as a separate package when tailwind-styled-components already comes with it.

Thoughts on syntax:

import tw, { twMerge } from 'tailwind-styled-components';

or

import tw from 'tailwind-styled-components';

// usage:

tw.merge('pl-4', undefined, false, props.className)

alexjidras avatar Jul 01 '22 16:07 alexjidras

My humble opinion:

I don't see everybody that uses tailwind-styled-components with a mandatory need of tailwind-merge, so if it is a special case it should be add as dependency when needed only.

Also, libraries should be a black box, in case the author needs to chance the internal implementation it would broken whoever is using that internal dependency.

rubens-lopes avatar Sep 02 '22 20:09 rubens-lopes

@rubens-lopes Good argument. Thanks

alexjidras avatar Oct 06 '22 19:10 alexjidras