theme.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2017 Frédéric Guillot. All rights reserved.
  2. // Use of this source code is governed by the Apache 2.0
  3. // license that can be found in the LICENSE file.
  4. package model // import "miniflux.app/model"
  5. // Themes returns the list of available themes.
  6. func Themes() map[string]string {
  7. return map[string]string{
  8. "light_serif": "Light - Serif",
  9. "light_sans_serif": "Light - Sans Serif",
  10. "dark_serif": "Dark - Serif",
  11. "dark_sans_serif": "Dark - Sans Serif",
  12. "system_serif": "System - Serif",
  13. "system_sans_serif": "System - Sans Serif",
  14. }
  15. }
  16. // ThemeColor returns the color for the address bar or/and the browser color.
  17. // https://developer.mozilla.org/en-US/docs/Web/Manifest#theme_color
  18. // https://developers.google.com/web/tools/lighthouse/audits/address-bar
  19. // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name/theme-color
  20. func ThemeColor(theme, colorScheme string) string {
  21. switch theme {
  22. case "dark_serif", "dark_sans_serif":
  23. return "#222"
  24. case "system_serif", "system_sans_serif":
  25. if colorScheme == "dark" {
  26. return "#222"
  27. }
  28. return "#fff"
  29. default:
  30. return "#fff"
  31. }
  32. }