mirror of
https://github.com/miniflux/v2.git
synced 2025-09-15 18:57:04 +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
|
@ -87,8 +87,8 @@ func (f *funcMap) Map() template.FuncMap {
|
|||
"isodate": func(ts time.Time) string {
|
||||
return ts.Format("2006-01-02 15:04:05")
|
||||
},
|
||||
"theme_color": func(theme string) string {
|
||||
return model.ThemeColor(theme)
|
||||
"theme_color": func(theme, colorScheme string) string {
|
||||
return model.ThemeColor(theme, colorScheme)
|
||||
},
|
||||
"icon": func(iconName string) template.HTML {
|
||||
return template.HTML(fmt.Sprintf(
|
||||
|
|
|
@ -29,7 +29,9 @@
|
|||
<link rel="apple-touch-icon" sizes="167x167" href="{{ route "appIcon" "filename" "icon-167.png" }}">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{{ route "appIcon" "filename" "icon-180.png" }}">
|
||||
|
||||
<meta name="theme-color" content="{{ theme_color .theme }}">
|
||||
<meta name="theme-color" content="{{ theme_color .theme "light" }}" media="(prefers-color-scheme: light)">
|
||||
<meta name="theme-color" content="{{ theme_color .theme "dark" }}" media="(prefers-color-scheme: dark)">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="{{ route "stylesheet" "name" .theme "checksum" .theme_checksum }}">
|
||||
|
||||
{{ if and .user .user.Stylesheet }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue