_hyperscript
_hyperscript copied to clipboard
Support negative modifiers on class names (as in TailwindCSS)
Currently, trying to pass a class name with - appended will cause an error. Per discussion on Discord this should be supported.
Example that will fail:
on change add .left-0 .-top-0
For now using the excellent example provided of modifying margin-top.
After watching the video on TW CSS 3.0 and the JIT CDN, I think it's probably best to call out the other JIT-style class syntax examples:
-
bg-gray-100/50(rgba) -
w-[50px](arbitrary values) -
md:dark:hover:bg-blue-500(stacked responsive modifiers)
Not sure how many work now/don't, but figured best to snag 'em all at once :)
I think the most sensible solution is to support escaping special characters in classnames, since this is the same way Tailwind has to do it so browsers understand the syntax correctly:
.w-\[50px\] { }
.p-0\.5 { }
.dark\:hover\:bg-gray-100 { }