Closed sdidier-dev closed 2 weeks ago
New commit changelog:
ThemeChangerAIO
and ThemeSwitchAIO
(fix #41)#theme-switch-label
/#theme-switch-label-dark
to apply label stylingclientsideCallbacks.js
, the JavaScript functions are directly used in Python code in the clientside_callback
for ThemeChangerAIO
and ThemeSwitchAIO
(fix #42)@sdidier-dev this does seem to properly apply persistent themes, but on the first theme load there's a split second flashbang (everything's white) while a theme is loading. So if you load the page, and then switch from theme_a
to theme_b
, everything will flash white for a second, then if you switch back, it'll be normal (I'm assuming this has to do with caching the themes CSS by the browser). This was not an issue in version 1.1.2
Hi @mayushii21! can you try with this last commit if that's better?
@sdidier-dev while your solution did help, it still flashed on initial load, and relying on delays isn't best practice. I don't quite understand the logic flow of everything you were doing there, so I forked your fork and fiddled around. I created a pull request to your fork with a solution that seems to work well for me, relying on onload of the new stylesheet instead of delaying to set the href attribute. Please take a look. Not having to wait an entire half second also makes it feel a lot snappier - better user experience
Thanks @mayushii21 for the improvement!
Hi there! 😁 Here is a PR modifying the
ThemeChangerAIO
component inspired by the update of theThemeSwitchAIO
.Change log:
assets_folder
andassets_url_path
)