Add color theme customization support
This commit is contained in:
parent
5d6ededd57
commit
152a9bc950
3
kanken_online/static/dark_theme.css
Normal file
3
kanken_online/static/dark_theme.css
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
body {
|
||||||
|
background: green;
|
||||||
|
}
|
3
kanken_online/static/light_theme.css
Normal file
3
kanken_online/static/light_theme.css
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
body {
|
||||||
|
background-color: white;
|
||||||
|
}
|
3
kanken_online/static/theme_select.css
Normal file
3
kanken_online/static/theme_select.css
Normal file
@ -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);
|
@ -4,6 +4,11 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>{% block title %}{% endblock %} - {{ localize("kanken_online") }}</title>
|
<title>{% block title %}{% endblock %} - {{ localize("kanken_online") }}</title>
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
||||||
|
{% if session %}
|
||||||
|
<link rel="stylesheet" href="{{ url_for('static', filename='dark_theme.css') if session['theme'] == 'dark' else url_for('static', filename='light_theme.css')}}">
|
||||||
|
{% else %}
|
||||||
|
<link rel="stylesheet" href="{{ url_for('static', filename='theme_select.css') }}"> <!-- Use CSS-based theme detection if no user login supplied -->
|
||||||
|
{% endif %}
|
||||||
{% block styles %}{% endblock %}
|
{% block styles %}{% endblock %}
|
||||||
{% block scripts %}{% endblock %}
|
{% block scripts %}{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
|
Loading…
Reference in New Issue
Block a user