encryptic-team / encryptic

An encryption-focused open source note taking application
Mozilla Public License 2.0
347 stars 40 forks source link

Dark theme blinking #70

Closed Prune2000 closed 5 years ago

Prune2000 commented 5 years ago

This is a continuation of the issue #15 but focused on the web app.

I have noticed that the dark theme is constantly blinking every time the user switches pages or create new notes, tags and notebooks. It seems that it's due to the code loading the default theme first, and then applying the settings that the user chose, so in this case the dark theme. It creates a half a second white blink before the dark theme.

I'll investigate and try to propose a solution soon.

Prune2000 commented 5 years ago

Ok, I see now.

<link rel="stylesheet" href="styles/theme-default.css" id="lav--theme"> is directly placed in the HTML so it loads this one first before any script takes action.

Then in utils/themes.js, it will fetch the settings (in our case dark theme) and apply it with $('#lav--theme').attr('href',styles/theme-${theme || 'default'}.css);

Gotta run for now but there must be an easier way to manage the themes to avoid this I imagine.

Prune2000 commented 5 years ago

The fix by Maks-s seem to have solved it for me. Anyone else still experiencing the bug? Otherwise we can close.

daed commented 5 years ago

Closing for now. Will reopen if anyone notices an issue.