More complex toggling example ? #597
Unanswered
unoexperto
asked this question in
General
Replies: 1 comment
-
Maintainers - please enable discussions in the repository |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello ! I'm new to hyperscript and after trying for couple hours I couldn't implement toggling in the following snippet
What I want to happen on click is
bg-neutral-300
andtext-indigo-600
removed from currently active element;text-gray-700
added to currently active element;bg-neutral-300
andtext-indigo-600
added to clicked on element;hover:text-indigo-600
andhover:bg-neutral-300
removed from clicked on element.I tried using take and toggle commands and expressions like
event.target.closest('<a/>')
and couldn't achieve the result. I also struggled to understand how to add/remove several classes at once.Could you please help me ?
Beta Was this translation helpful? Give feedback.
All reactions