Closed gilbert closed 3 years ago
Fixed in e0a4c74 - Liminal now additionally accepts arrays of classes. In this example:
m(Liminal, {
present: ["transition", "transform", "duration-300", "opacity-100", "scale-100"],
absent: ["transition", "transform", "opacity-0"],
entry: "scale-0",
exit: ["duration-700", "scale-75"],
}, /*💥*/)
Your example shows a different understanding of how classes ought to be applied - which makes me wonder if the configuration interface needs tweaking:
absent
& entry
in the immediate render framepresent
absent
& exit
Because the classes are designed as states arrived at and departed from, present
is somewhat redundant. In my example I've spammed it with values for the sake of a 'complete' description of the liminal states in configuration - where perhaps the distinction of an exit
duration-700
is better controlled - but in practice all these classes could (perhaps ought to?) be applied directly to the childs hyperscript expression.
Awesome, it works! Do you think you could do a string .split()
internally so I can write my css strings with spaces? I already have to think about .x.y.z
vs x y z
variants when using mithril, I prefer not to introduce a third 😁
I like present
as I would prefer to have animation-related classes in Liminal. In fact, a base
would be helpful too to put stuff like transition transform
once and without having to think about where it should go.
I use tailwind, so it's useful to add multiple classes like this:
However this throws the standard browser error:
on a
dom.classList.add
line.