Open jlarmstrongiv opened 1 year ago
Thanks for your feedback and sorry for the late reply - somehow I wasn't subscribed to notifications for my own repo 😛
CVA array syntax
I'm not entirely sure, but I think this might require some updates to some of the deeper internals of the plugin. I don't know how easily I can decouple the sorting parts from the part that splits out or parses the classname string. Can't make any promises, but I will investigate it further.
String syntax should still work though:
const button = cva("font-semibold border rounded", {
variants: {
intent: {
primary: "bg-blue-500 text-white border-transparenthover:bg-blue-600",
// ...
tw
tagged template syntaxI think you already support the tw syntax via
tailwindTaggedTemplates
. That’s already a really good escape hatch 😄 unfortunately, I couldn’t try it since I couldn’t get the fork to work locally
So far I've only implemented that feature in my PR to the upstream package - not here in the fork itself. I was optimistically hoping to be able to decommission this package in favor of moving these features upstream instead, so I hadn't prioritized it.
It's pretty easy to add though. I need to pull in the latest changes from the upstream package anyway, so I can add this feature when I do (should hopefully be soon)
windstitch
/stylemapper
syntax
Targeting method names makes sense to me, but I wonder whether or not it would be necessary to allow targeting based on the parent name too.
I'm not sure what the configuration should look like if, for example, we wanted to restrict it to methods named button
but only when the parent is named w
?
Maybe just the method name is enough though 🤔
Tagged template support is released in v0.2.1 (prettier setting tailwindCustomTaggedTemplates
)
Thank you for making this fork and upstreaming your changes 🎉
There’s a couple use cases I think would be wonderful to have:
cva
array syntaxwindstitch
/stylemapper
syntaxtw
syntaxI think you already support the
tw
syntax viatailwindTaggedTemplates
. That’s already a really good escape hatch 😄 unfortunately, I couldn’t try it since I couldn’t get the fork to work locallyThe
cva
array syntax could be an additional option named something liketailwindArrayTemplates
and looks like:The
windstitch
syntax withw.componentname
doesn’t seem to be supported withtailwindCustomFunctions
, and I was unable to get your fork withtailwindFunctionCalls
working locally. I think the same option name could be used, or another one liketailwindMethodCalls
could be added. The syntax looks like: