Event for theme #5322
-
Add events in the theme switch so we can listen for them anywhere. Right now I need to do an observer on the document.documentElement for the class 'dark' to be able to do it and it's really not the most performent. It's particularily useful when developing components that needs some reloading for theme (i.e. some rich text fields like tinymce) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Landed here because I needed the same thing. |
Beta Was this translation helpful? Give feedback.
-
You should be able to do this in Nova 5. Nova.$on('nova-theme-switched', ({ theme }) => {
// `theme` should be 'dark' or 'light'
}) |
Beta Was this translation helpful? Give feedback.
You should be able to do this in Nova 5.