Skip to content

Fix FOUC issues in dark mode #7077

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
qupig opened this issue Nov 12, 2024 · 7 comments
Closed

Fix FOUC issues in dark mode #7077

qupig opened this issue Nov 12, 2024 · 7 comments

Comments

@qupig
Copy link
Contributor

qupig commented Nov 12, 2024

Currently, after selecting the dark theme, every operation such as opening/closing a folder will produce a brief full-screen white screen flicker i.e. FOUC (Flash of Unstyled Content), which is very unfriendly to the eyes.

An additional question is that when the system/browser is in dark mode, the light theme is always the default when entering code-server. I always have to choose it manually. Maybe the matching theme should also be automatically applied?

@coder-labeler coder-labeler bot added bug Something isn't working enhancement Some improvement that isn't a feature labels Nov 12, 2024
@code-asher
Copy link
Member

These are probably best solved upstream, we are just wrapping VS Code's HTML.

That said, having to select the theme multiple times sounds like a bug, and it could be a problem created by our patches. We patch the theme to be stored on the remote server, so as long as the config is not deleted from there it should keep using the same theme.

@code-asher
Copy link
Member

code-asher commented Nov 12, 2024

Actually we may need to solve it here anyway because we should also style the login page with the current theme. #3019

@code-asher
Copy link
Member

code-asher commented Nov 12, 2024

I modified #3019 to include styling the VS Code page before it loads, since it will all be the same work, and will close this one as a duplicate. Thank you for the suggestion!

@code-asher code-asher closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2024
@code-asher code-asher added duplicate and removed bug Something isn't working enhancement Some improvement that isn't a feature labels Nov 12, 2024
@qupig
Copy link
Contributor Author

qupig commented Nov 12, 2024

@code-asher Your summary is very comprehensive, thank you, look forward to improvement. ❤️

@qupig
Copy link
Contributor Author

qupig commented Nov 12, 2024

That said, having to select the theme multiple times sounds like a bug, and it could be a problem created by our patches. We patch the theme to be stored on the remote server, so as long as the config is not deleted from there it should keep using the same theme.

No, because I'm using a brand new instance every time.

@code-asher
Copy link
Member

Ahh I see. This is expected behavior, in that case. You could work around it by seeding each instance with a settings.json file that has the theme set.

@qupig
Copy link
Contributor Author

qupig commented Nov 13, 2024

You could work around it by seeding each instance with a settings.json file that has the theme set.

Yes, but:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants