~metalune/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch

[PATCH] Add automatic dark theme

Details
Message ID
<20211031101830.7790-1-bopol@e.email>
DKIM signature
pass
Download raw message
Patch: +22 -1
---
 static/css/dark.css   | 14 ++++++++++++++
 static/css/styles.css |  5 +++++
 templates/base.html   |  4 +++-
 3 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 static/css/dark.css
 create mode 100644 static/css/styles.css

diff --git a/static/css/dark.css b/static/css/dark.css
new file mode 100644
index 0000000..8dfef6a
--- /dev/null
+++ b/static/css/dark.css
@@ -0,0 +1,14 @@
body {
    background-color: #212529;
    color: #f8f9fa;
}

a:visited {
    color: #9759f6;
    text-decoration: none;
}

a {
    color: #599bf6;
    text-decoration: none;
}
diff --git a/static/css/styles.css b/static/css/styles.css
new file mode 100644
index 0000000..e28609b
--- /dev/null
+++ b/static/css/styles.css
@@ -0,0 +1,5 @@
body {
    max-width: 800px;
    margin: 0 auto;
    padding: auto 5px;
}
diff --git a/templates/base.html b/templates/base.html
index 08bbb1d..5b8b74a 100755
--- a/templates/base.html
+++ b/templates/base.html
@@ -5,9 +5,11 @@
    {% block head %}{% endblock %}
    <title>{% block title %}SimplyNews{% endblock %}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/styles.css') }}">
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/dark.css') }}" media="screen and (prefers-color-scheme: dark)">
</head>

<body style="max-width: 800px; margin: 0 auto; padding-left: 5px; padding-right: 5px">
<body>
    <div id="content">{% block content %}{% endblock %}</div>
    <footer>{% block footer %}{% endblock %}</footer>
</body>
-- 
2.31.1
Reply to thread Export thread (mbox)