You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to implement the tippy.js tooltip and change the theme based on the local storage value darkMode as an AlpineJscustom directive.
The code below works more or less fine with the latest bit that if I toggle the dark-mode switch, which changes the local localStorage item value of darkMode, I need a page refresh to get the new value.
How can I get the value (JSON.parse(localStorage.getItem('darkMode'))) while I change it?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to implement the
tippy.js
tooltip and change the theme based on the local storage valuedarkMode
as anAlpineJs
custom directive.The code below works more or less fine with the latest bit that if I toggle the dark-mode switch, which changes the local localStorage item value of
darkMode
, I need a page refresh to get the new value.How can I get the value (
JSON.parse(localStorage.getItem('darkMode'))
) while I change it?app.js
tool-tip button
darkmode
toggle button
Beta Was this translation helpful? Give feedback.
All reactions