theme.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
  2. // SPDX-License-Identifier: Apache-2.0
  3. package model // import "miniflux.app/v2/internal/model"
  4. // Themes returns the list of available themes.
  5. func Themes() map[string]string {
  6. return map[string]string{
  7. "light_serif": "Light - Serif",
  8. "light_sans_serif": "Light - Sans Serif",
  9. "dark_serif": "Dark - Serif",
  10. "dark_sans_serif": "Dark - Sans Serif",
  11. "system_serif": "System - Serif",
  12. "system_sans_serif": "System - Sans Serif",
  13. }
  14. }
  15. // ThemeColor returns the color for the address bar or/and the browser color.
  16. // https://developer.mozilla.org/en-US/docs/Web/Manifest#theme_color
  17. // https://developers.google.com/web/tools/lighthouse/audits/address-bar
  18. // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name/theme-color
  19. func ThemeColor(theme, colorScheme string) string {
  20. switch theme {
  21. case "dark_serif", "dark_sans_serif":
  22. return "#222"
  23. case "system_serif", "system_sans_serif":
  24. if colorScheme == "dark" {
  25. return "#222"
  26. }
  27. return "#fff"
  28. default:
  29. return "#fff"
  30. }
  31. }