aboutsummaryrefslogtreecommitdiffhomepage
path: root/http
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2019-09-21 19:10:08 -0700
committerGravatar Frédéric Guillot <fred@miniflux.net>2019-09-21 20:04:42 -0700
commitafe1faf2141ef9cd3a5564fa33646b821ae5162b (patch)
treeca3fbbea8236154aabeedd54c05775e7f4fcbf35 /http
parentd610d091fed6dbac3a7ae7e6a67e6e8455b77755 (diff)
Add theme variants
- Use CSS variables instead of inherence - Rename default theme to "Light - Serif" - Rename Black theme to "Dark - Serif" - Rename "Sans-Serif" theme to "Light - Sans Serif" - Add "System" theme that use system preferences: Dark or Light - Add Serif and Sans-Serif variants for each color theme
Diffstat (limited to 'http')
-rw-r--r--http/request/context.go2
-rw-r--r--http/request/context_test.go6
2 files changed, 4 insertions, 4 deletions
diff --git a/http/request/context.go b/http/request/context.go
index 51ee46a..5befb06 100644
--- a/http/request/context.go
+++ b/http/request/context.go
@@ -64,7 +64,7 @@ func UserLanguage(r *http.Request) string {
func UserTheme(r *http.Request) string {
theme := getContextStringValue(r, UserThemeContextKey)
if theme == "" {
- theme = "default"
+ theme = "light_serif"
}
return theme
}
diff --git a/http/request/context_test.go b/http/request/context_test.go
index e741362..e7d6560 100644
--- a/http/request/context_test.go
+++ b/http/request/context_test.go
@@ -241,18 +241,18 @@ func TestUserTheme(t *testing.T) {
r, _ := http.NewRequest("GET", "http://example.org", nil)
result := UserTheme(r)
- expected := "default"
+ expected := "light_serif"
if result != expected {
t.Errorf(`Unexpected context value, got %q instead of %q`, result, expected)
}
ctx := r.Context()
- ctx = context.WithValue(ctx, UserThemeContextKey, "black")
+ ctx = context.WithValue(ctx, UserThemeContextKey, "dark_serif")
r = r.WithContext(ctx)
result = UserTheme(r)
- expected = "black"
+ expected = "dark_serif"
if result != expected {
t.Errorf(`Unexpected context value, got %q instead of %q`, result, expected)