From afe1faf2141ef9cd3a5564fa33646b821ae5162b Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sat, 21 Sep 2019 19:10:08 -0700 Subject: 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 --- http/request/context.go | 2 +- http/request/context_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'http') 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) -- cgit v1.2.3