From f8af2cab50fc93db4cc607a66ec8a029d47e74fe Mon Sep 17 00:00:00 2001 From: florent giraud Date: Wed, 25 Sep 2024 10:32:32 -0400 Subject: [PATCH 1/2] feat(twmerge): inject function like tailwind merge possible --- packages/core/src/tailwind-buddy.ts | 9 ++-- .../.vitepress/cache/deps/@theme_index.js | 50 +++++++++---------- .../.vitepress/cache/deps/_metadata.json | 22 ++++---- packages/documentation/pages/setup.md | 14 ++++++ packages/sandbox/src/App.tsx | 2 +- packages/ui/src/components/Label/Label.tsx | 21 ++++---- packages/ui/src/tailwind-buddy-interface.ts | 3 +- 7 files changed, 68 insertions(+), 53 deletions(-) diff --git a/packages/core/src/tailwind-buddy.ts b/packages/core/src/tailwind-buddy.ts index d7829df..cfeeb52 100644 --- a/packages/core/src/tailwind-buddy.ts +++ b/packages/core/src/tailwind-buddy.ts @@ -10,7 +10,7 @@ import { import { cleanString } from "./utils/strings"; // Utility functions -const mergeClasses = (classes: string[]): string => { +const uniquifyClasses = (classes: string[]): string => { return [...new Set(classes.filter(Boolean))].join(" "); }; @@ -29,7 +29,10 @@ const flattenVariant = ( }; // Main function -export const setupCompose = (screens: Sc[]) => { +export const setupCompose = ( + screens: Sc[], + mergeClasses: (str: string) => string = (str) => str +) => { return < V extends Variants, CV extends CompoundVariant, @@ -200,7 +203,7 @@ export const setupCompose = (screens: Sc[]) => { .forEach((cls) => classSet.add(cls)); } - const result = mergeClasses(Array.from(classSet)); + const result = mergeClasses(uniquifyClasses(Array.from(classSet))); variantCache.set(cacheKey, result); return result; }; diff --git a/packages/documentation/.vitepress/cache/deps/@theme_index.js b/packages/documentation/.vitepress/cache/deps/@theme_index.js index 832d83f..7e3e6e1 100644 --- a/packages/documentation/.vitepress/cache/deps/@theme_index.js +++ b/packages/documentation/.vitepress/cache/deps/@theme_index.js @@ -9,33 +9,33 @@ import { } from "./chunk-56R7HN57.js"; // node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/index.js -import "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/styles/fonts.css"; +import "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/styles/fonts.css"; // node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/without-fonts.js -import "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/styles/vars.css"; -import "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/styles/base.css"; -import "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/styles/icons.css"; -import "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/styles/utils.css"; -import "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/styles/components/custom-block.css"; -import "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/styles/components/vp-code.css"; -import "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/styles/components/vp-code-group.css"; -import "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/styles/components/vp-doc.css"; -import "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/styles/components/vp-sponsor.css"; -import VPBadge from "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPBadge.vue"; -import Layout from "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/Layout.vue"; -import { default as default2 } from "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPBadge.vue"; -import { default as default3 } from "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPImage.vue"; -import { default as default4 } from "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPButton.vue"; -import { default as default5 } from "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPHomeContent.vue"; -import { default as default6 } from "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPHomeHero.vue"; -import { default as default7 } from "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPHomeFeatures.vue"; -import { default as default8 } from "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPHomeSponsors.vue"; -import { default as default9 } from "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPDocAsideSponsors.vue"; -import { default as default10 } from "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPSponsors.vue"; -import { default as default11 } from "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPTeamPage.vue"; -import { default as default12 } from "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPTeamPageTitle.vue"; -import { default as default13 } from "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPTeamPageSection.vue"; -import { default as default14 } from "/Users/florent/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPTeamMembers.vue"; +import "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/styles/vars.css"; +import "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/styles/base.css"; +import "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/styles/icons.css"; +import "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/styles/utils.css"; +import "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/styles/components/custom-block.css"; +import "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/styles/components/vp-code.css"; +import "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/styles/components/vp-code-group.css"; +import "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/styles/components/vp-doc.css"; +import "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/styles/components/vp-sponsor.css"; +import VPBadge from "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPBadge.vue"; +import Layout from "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/Layout.vue"; +import { default as default2 } from "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPBadge.vue"; +import { default as default3 } from "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPImage.vue"; +import { default as default4 } from "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPButton.vue"; +import { default as default5 } from "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPHomeContent.vue"; +import { default as default6 } from "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPHomeHero.vue"; +import { default as default7 } from "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPHomeFeatures.vue"; +import { default as default8 } from "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPHomeSponsors.vue"; +import { default as default9 } from "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPDocAsideSponsors.vue"; +import { default as default10 } from "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPSponsors.vue"; +import { default as default11 } from "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPTeamPage.vue"; +import { default as default12 } from "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPTeamPageTitle.vue"; +import { default as default13 } from "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPTeamPageSection.vue"; +import { default as default14 } from "/Users/florentgiraud/dev/busbud/tailwind-buddy/node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/components/VPTeamMembers.vue"; // node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/support/utils.js import { withBase } from "vitepress"; diff --git a/packages/documentation/.vitepress/cache/deps/_metadata.json b/packages/documentation/.vitepress/cache/deps/_metadata.json index b20ab26..a4971e1 100644 --- a/packages/documentation/.vitepress/cache/deps/_metadata.json +++ b/packages/documentation/.vitepress/cache/deps/_metadata.json @@ -1,49 +1,49 @@ { - "hash": "19b9179e", - "configHash": "f43f310e", - "lockfileHash": "a8ccead4", - "browserHash": "4bff83ef", + "hash": "3bc5aab3", + "configHash": "2763b157", + "lockfileHash": "8d748f00", + "browserHash": "9cdcabca", "optimized": { "vue": { "src": "../../../../../node_modules/.pnpm/vue@3.4.38_typescript@5.5.4/node_modules/vue/dist/vue.runtime.esm-bundler.js", "file": "vue.js", - "fileHash": "f982f54e", + "fileHash": "a578c79e", "needsInterop": false }, "vitepress > @vue/devtools-api": { "src": "../../../../../node_modules/.pnpm/@vue+devtools-api@7.3.9/node_modules/@vue/devtools-api/dist/index.js", "file": "vitepress___@vue_devtools-api.js", - "fileHash": "fe1b5d95", + "fileHash": "a04a0f40", "needsInterop": false }, "vitepress > @vueuse/core": { "src": "../../../../../node_modules/.pnpm/@vueuse+core@11.0.3_vue@3.4.38_typescript@5.5.4_/node_modules/@vueuse/core/index.mjs", "file": "vitepress___@vueuse_core.js", - "fileHash": "28238cb9", + "fileHash": "a4a2525c", "needsInterop": false }, "vitepress > @vueuse/integrations/useFocusTrap": { "src": "../../../../../node_modules/.pnpm/@vueuse+integrations@11.0.3_focus-trap@7.5.4_vue@3.4.38_typescript@5.5.4_/node_modules/@vueuse/integrations/useFocusTrap.mjs", "file": "vitepress___@vueuse_integrations_useFocusTrap.js", - "fileHash": "17a4660b", + "fileHash": "5a67a617", "needsInterop": false }, "vitepress > mark.js/src/vanilla.js": { "src": "../../../../../node_modules/.pnpm/mark.js@8.11.1/node_modules/mark.js/src/vanilla.js", "file": "vitepress___mark__js_src_vanilla__js.js", - "fileHash": "edea4024", + "fileHash": "d73b5fff", "needsInterop": false }, "vitepress > minisearch": { "src": "../../../../../node_modules/.pnpm/minisearch@7.1.0/node_modules/minisearch/dist/es/index.js", "file": "vitepress___minisearch.js", - "fileHash": "970d326c", + "fileHash": "34b10db2", "needsInterop": false }, "@theme/index": { "src": "../../../../../node_modules/.pnpm/vitepress@1.3.4_@algolia+client-search@4.24.0_@types+node@22.5.0_@types+react@18.3.4_postcss@_2aekxe2sbooqp2zuwhekukj7iy/node_modules/vitepress/dist/client/theme-default/index.js", "file": "@theme_index.js", - "fileHash": "03db824f", + "fileHash": "5d12843e", "needsInterop": false } }, diff --git a/packages/documentation/pages/setup.md b/packages/documentation/pages/setup.md index 328b6fd..8ebe586 100644 --- a/packages/documentation/pages/setup.md +++ b/packages/documentation/pages/setup.md @@ -20,3 +20,17 @@ export type Screens = "sm" | "md"; export const screens: Screens[] = ["sm", "md"]; export const compose = setupCompose(screens); ``` + +## Tailwind merge or similar + +You can use any function, such as [tailwind-merge](https://www.npmjs.com/package/tailwind-merge). We recommend using tailwind-merge. + +This function takes a string of classes and returns a modified string. The main goal is to merge Tailwind classes to avoid style conflicts. + +Example: + +```ts +import { twMerge } from "tailwind-merge"; + +export const compose = setupCompose(screens, twMerge); +``` diff --git a/packages/sandbox/src/App.tsx b/packages/sandbox/src/App.tsx index 0c4d5c5..e7dc122 100644 --- a/packages/sandbox/src/App.tsx +++ b/packages/sandbox/src/App.tsx @@ -13,7 +13,7 @@ function App() {