2023-06-19 17:42:47 -04:00
|
|
|
// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
2017-11-20 00:10:04 -05:00
|
|
|
|
2023-08-10 00:15:55 -04:00
|
|
|
package model // import "miniflux.app/v2/model"
|
2017-11-20 00:10:04 -05:00
|
|
|
|
2017-11-28 00:30:04 -05:00
|
|
|
// Themes returns the list of available themes.
|
|
|
|
func Themes() map[string]string {
|
2017-11-20 00:10:04 -05:00
|
|
|
return map[string]string{
|
2019-09-21 22:10:08 -04:00
|
|
|
"light_serif": "Light - Serif",
|
|
|
|
"light_sans_serif": "Light - Sans Serif",
|
|
|
|
"dark_serif": "Dark - Serif",
|
|
|
|
"dark_sans_serif": "Dark - Sans Serif",
|
|
|
|
"system_serif": "System - Serif",
|
|
|
|
"system_sans_serif": "System - Sans Serif",
|
2017-11-20 00:10:04 -05:00
|
|
|
}
|
|
|
|
}
|
2017-11-25 15:44:32 -05:00
|
|
|
|
2018-07-19 01:30:05 -04:00
|
|
|
// 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
|
2021-11-28 10:20:51 -05:00
|
|
|
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name/theme-color
|
|
|
|
func ThemeColor(theme, colorScheme string) string {
|
2018-07-19 01:30:05 -04:00
|
|
|
switch theme {
|
2019-09-21 22:10:08 -04:00
|
|
|
case "dark_serif", "dark_sans_serif":
|
2018-07-19 01:30:05 -04:00
|
|
|
return "#222"
|
2021-11-28 10:20:51 -05:00
|
|
|
case "system_serif", "system_sans_serif":
|
|
|
|
if colorScheme == "dark" {
|
|
|
|
return "#222"
|
|
|
|
}
|
|
|
|
|
|
|
|
return "#fff"
|
2018-07-19 01:30:05 -04:00
|
|
|
default:
|
|
|
|
return "#fff"
|
|
|
|
}
|
|
|
|
}
|