The addVariant discussion #320
Replies: 4 comments 7 replies
-
I'm starting to plan a "hooks" project with twin that'll allow changes to the styles twin generates. |
Beta Was this translation helpful? Give feedback.
-
addVariant would really help me with a workaround for supporting focus-visible in older browsers. I'll describe what I am trying to do below Problem DescriptionI'm trying again to get some reliable browser support for tailwinds It looks like all the postcss polyfill does is convert
To
My question is if there is anyway with twin to make it so that when you use the Basically when we use the If not would it be possible to write a plugin that allows this? I find focus-visible to be a great way to define focus styles for keyboard only uses but to allow for more subtle focus states(or hidden ones) for mouse users, but the lack of support in Safari makes it so I cannot use this on a grand scale I believe I can add this with a minimal plugin in tailwind.config.js
But this doesn't seem to work with twin as twin doesn't support addVariant. |
Beta Was this translation helpful? Give feedback.
-
We need a more friendly The type definitions may be: declare function addVariant(variantName: string, variantFunction: string | string[]): void |
Beta Was this translation helpful? Give feedback.
-
Hey folks, some good news - |
Beta Was this translation helpful? Give feedback.
-
This is a discussion about implementing
addVariant
- which is the only remaining missing plugin function in twin.Update: twin v3 will include support for addVariant 🎉
Beta Was this translation helpful? Give feedback.
All reactions