From 152a9bc95054bf328a58299ff4823358979fc975 Mon Sep 17 00:00:00 2001 From: Kiril Kovachev Date: Mon, 14 Oct 2024 17:10:12 +0100 Subject: [PATCH] Add color theme customization support --- kanken_online/static/dark_theme.css | 3 +++ kanken_online/static/light_theme.css | 3 +++ kanken_online/static/theme_select.css | 3 +++ kanken_online/templates/base.html | 5 +++++ 4 files changed, 14 insertions(+) create mode 100644 kanken_online/static/dark_theme.css create mode 100644 kanken_online/static/light_theme.css create mode 100644 kanken_online/static/theme_select.css diff --git a/kanken_online/static/dark_theme.css b/kanken_online/static/dark_theme.css new file mode 100644 index 0000000..e541a38 --- /dev/null +++ b/kanken_online/static/dark_theme.css @@ -0,0 +1,3 @@ +body { + background: green; +} diff --git a/kanken_online/static/light_theme.css b/kanken_online/static/light_theme.css new file mode 100644 index 0000000..4fe1d10 --- /dev/null +++ b/kanken_online/static/light_theme.css @@ -0,0 +1,3 @@ +body { + background-color: white; +} \ No newline at end of file diff --git a/kanken_online/static/theme_select.css b/kanken_online/static/theme_select.css new file mode 100644 index 0000000..5e8783a --- /dev/null +++ b/kanken_online/static/theme_select.css @@ -0,0 +1,3 @@ +@import url("/static/light_theme.css") (prefers-color-scheme: light); +@import url("/static/dark_theme.css") (prefers-color-scheme: no-preference); +@import url("/static/dark_theme.css") (prefers-color-scheme: dark); diff --git a/kanken_online/templates/base.html b/kanken_online/templates/base.html index d6b3c0b..ade4a89 100644 --- a/kanken_online/templates/base.html +++ b/kanken_online/templates/base.html @@ -4,6 +4,11 @@ {% block title %}{% endblock %} - {{ localize("kanken_online") }} + {% if session %} + + {% else %} + + {% endif %} {% block styles %}{% endblock %} {% block scripts %}{% endblock %}