-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with Tailwind style complex class names? #1113
Comments
Still facing this issue. Is there any way to configure things so that class is just treated like a regular string attribute? Thanks |
I've worked around this. The problem was partially related to my use of toVNode. I've worked around this with a fork of toVNode that removes the hash from the vnode's As far as I can tell the The fix would be in this code in createElm (init.ts)
In searches for '.' only later in the string than '#' (if present). I think it needs to be the other way around. It should only consider a '#' to be the hashIdx if it is before the first '.' But not tested |
I guess this bug is very old, but no one has encountered it since using The bug about the selector parsing definitely needs fixing. If you're interested in making a PR for that you're very welcome to do so. Another question is whether it is appropriate for |
#1116 should address the selector parsing issue. Would be useful if you can confirm that this solves your original problem 😊 |
Is |
Good point. According to MDN the id can in theory contain anything but whitespace. But they also note:
So for a selector |
I recently switched to using snabbdom to efficiently update the page preview in a web builder I'm working on.
The HTML contains Tailwind classes, e.g.
class='block my-2 rounded bg-[#A31F24] text-white px-3 py-1'
I sometimes get an error from my call to
patch(oldVnode, newVnode)
:DOMException: Failed to execute 'createElement' on 'Document': The tag name provided ('a.block.my-2.rounded.bg-[') is not a valid name.
My patch function looks like this
Is this expected? Is there a workaround?
p.s. as a newbie, I'm not sure if I've got the right modules there -- all I want is "make this dom exactly like this other dom" (and the dom does include data attributes and style attributes, and does have event listeners on it)
Thanks!
The text was updated successfully, but these errors were encountered: