hexlet-rus / runit

Online Editor Form Embedding
https://runit.hexlet.ru/
Other
35 stars 120 forks source link

Bug: Error handling background color in HTML snippet browser when changing theme #524

Open KseniyaKerzhner opened 3 months ago

KseniyaKerzhner commented 3 months ago

Summary

When HTML snippet is opened, when switching from light to dark theme, the browser background becomes dark and the text is not visible. By default, the text in HTML is always black if there are no styles. When the page is refreshed, the background is light again. I suggest to make it so that the browser background in HTML snippets does not change and is always white.

The error is reproduced only when opening from the light theme for the first time or after reloading from the light theme. If you just switch from dark to light theme, there is no error.

The JS snippet handles it correctly, the background in the dark theme is always dark because it's a console and the font is automatically adjusted there.

https://github.com/hexlet-rus/runit/assets/34837694/6f9198f2-bf69-40a6-92aa-171bd661e084

Reproduction steps

1. Authorize and the light theme must be enabled
2. Open an HTML snippet that contains the code
3. Switch the theme to dark
4. Click refresh page

Expected result

When switching to a dark theme, the browser background remains white

image

Actual result

When you switch to a dark theme, the browser background turns black

image

Browsers

Chrome

OS

Windows

Mehdi-Messaadi commented 2 months ago

Hello! I'd like to take this issue on, please! I'll soon create a Pull Request with my changes.