Replies: 1 comment 2 replies
-
What you can do right now: <script setup>
import { useAttrs } from 'vue'
import { twMerge } from 'tailwind-merge'
defineOptions({ inheritAttrs: false })
const attrs = useAttrs()
</script>
<template>
<p v-bind="{ ...attrs, class: null }" :class="twMerge(attrs.class, 'text-red')">Hi!</p>
</template> Could surely be a bit better abtracted, too. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
due to for example tailwind css class names, can there be a option to specify a custom merge function for the class fallthrough attributes?
So there can be the option to use the tailwind-merge methods (https://github.com/dcastil/tailwind-merge) to merge the fallthrough class name on a component?
Use case example:
Current status:
MyComponent:
The rendered HTML is:
With the possibility to define a custom merge function:
MyComponent:
The rendered HTML is:
Beta Was this translation helpful? Give feedback.
All reactions