Replies: 1 comment 1 reply
-
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.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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