mirror of
https://github.com/miniflux/v2.git
synced 2025-08-26 18:21:01 +00:00
Add support for theme color based on preferred color scheme of OS
This commit is contained in:
parent
ca87894ab2
commit
b21f12015e
4 changed files with 14 additions and 5 deletions
|
@ -19,10 +19,17 @@ func Themes() map[string]string {
|
|||
// ThemeColor returns the color for the address bar or/and the browser color.
|
||||
// https://developer.mozilla.org/en-US/docs/Web/Manifest#theme_color
|
||||
// https://developers.google.com/web/tools/lighthouse/audits/address-bar
|
||||
func ThemeColor(theme string) string {
|
||||
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name/theme-color
|
||||
func ThemeColor(theme, colorScheme string) string {
|
||||
switch theme {
|
||||
case "dark_serif", "dark_sans_serif":
|
||||
return "#222"
|
||||
case "system_serif", "system_sans_serif":
|
||||
if colorScheme == "dark" {
|
||||
return "#222"
|
||||
}
|
||||
|
||||
return "#fff"
|
||||
default:
|
||||
return "#fff"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue