Johani
(Joe)
25.Июль.2022 12:04:33
21
Да, но мы упустили случай, когда пользователь устанавливает только обычную цветовую схему как тёмную. Ранее мы полагались на настройки операционной системы для выбора между светлым и тёмным режимом в загрузочном экране, предполагая, что пользователи настраивают оба режима и используют переключатель ОС.
Я внес несколько исправлений:
main ← hnb-ku:splash-background-flicker
merged 09:53AM - 23 Jul 22 UTC
Context: https://meta.discourse.org/t/introducing-discourse-splash-a-visual-prel… oader-displayed-while-site-assets-load/232003/17
We currently set the theme `secondary` color as the background for the splash, and this works and respects light/dark modes.
The issue is that we set it on the `#d-splash` div. That div doesn't have a specified height and only gets its height when the splash image loads.
This can cause a flicker effect where the `<HTML>` background shows for a fraction of a second while the splash image loads.
This PR sets the theme color on the `<HTML>` tag to alleviate this. This allows us to set the theme color a little bit sooner and should hopefully prevent the flicker effect from happening.
This PR also adds the `theme-color` `<meta>` tag for dark mode. Browsers that don't support multiple `theme-color` tags will ignore the second tag and fall back to the first one.
main ← hnb-ku:splash-flicker-take-2
merged 10:02AM - 25 Jul 22 UTC
Follow up to: https://github.com/discourse/discourse/pull/17619
Context: https:… //meta.discourse.org/t/introducing-discourse-splash-a-visual-preloader-displayed-while-site-assets-load/232003/17
We previously relied on the user's browser when deciding when to show the splash in light/dark mode. This worked well but can fail if the user manually selects a theme with a default "dark" scheme.
This PR will now factor that in. If the user selects a theme with a default dark scheme, use that. If a user selects a theme with a "light" default scheme and also picks a secondary "dark" scheme, use the `media` detection we had before.
This PR also removes the dark mode `theme-color` that was added in the previous PR. That will now go in a separate PR
Если обычная схема тёмная, используем её. Если светлая — используем светлую схему для светлого режима ОС и тёмную схему для тёмного режима ОС (если она установлена).
Проблема, а также эта:
теперь должны быть исправлены. Спасибо за сообщения
11 лайков