It is not possible to combine classes from both the tag name and the element class property.
For example h('button.px-3',{class:()=>'py-3'},'Hi'} will currently only render the class property.
This is a useful feature especially if you have a lot of static as well as dynamic classes.
I've created a modified version of the createHyperScript function that scratches my itch and if you like I can create a pull request with my changes but I first wanted to check if this is something that is in scope.
My version of h is tested to work with the following conditions, dunno if I forgot some more edge case:
It is not possible to combine classes from both the tag name and the element class property. For example
h('button.px-3',{class:()=>'py-3'},'Hi'}
will currently only render the class property. This is a useful feature especially if you have a lot of static as well as dynamic classes.I've created a modified version of the
createHyperScript
function that scratches my itch and if you like I can create a pull request with my changes but I first wanted to check if this is something that is in scope.My version of h is tested to work with the following conditions, dunno if I forgot some more edge case:
I've tried to keep my changes to a minimum, the most relevant part is in the
"object"
branch of theitem
function. Cyclomatic complexity be damned.