From 428e00ba235ad5b8c33a7448b1c761830a574e4d Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri, 7 May 2021 10:50:08 -0700 Subject: [PATCH] Respect user dark mode setting on login page --- src/documents/static/signin.css | 55 +++++++++++++++++++ .../templates/registration/logged_out.html | 5 +- .../templates/registration/login.html | 5 +- 3 files changed, 63 insertions(+), 2 deletions(-) diff --git a/src/documents/static/signin.css b/src/documents/static/signin.css index 7441e0394..981200995 100644 --- a/src/documents/static/signin.css +++ b/src/documents/static/signin.css @@ -42,3 +42,58 @@ body { border-top-left-radius: 0; border-top-right-radius: 0; } + +@media (prefers-color-scheme: dark) { + /* + From theme_dark.scss + $primary-dark-mode: #45973a; + $danger-dark-mode: #b71631; + $bg-dark-mode: #161618; + $bg-dark-mode-accent: #21262d; + $bg-light-dark-mode: #1c1c1f; + $text-color-dark-mode: #abb2bf; + $border-color-dark-mode: #47494f; + */ + body { + background-color: #161618 !important; + color: #abb2bf; + } + + svg.logo .text { + fill: #abb2bf!important; + } + + .form-control:not(.is-invalid):not(.btn) { + border-color: #47494f; + } + + .form-control:not(.btn) { + background-color: #161618; + color: #abb2bf; + } + + .form-control:not(.btn)::placeholder { + color: #abb2bf; + } + + .form-control:not(.btn):focus { + background-color: #1c1c1f !important; + color: #8e97a9 !important; + } + + .btn-primary { + color: #fff; + background-color: #17541f; + border-color: #17541f; + } + + .btn-primary:hover, .btn-primary:focus { + background-color: #0f3614; + border-color: #0c2c10; + } + + .btn-primary:not(:disabled):not(.disabled):active { + background-color: #0c2c10; + border-color: #09220d; + } +} diff --git a/src/documents/templates/registration/logged_out.html b/src/documents/templates/registration/logged_out.html index bf21b95f8..b1446eb72 100644 --- a/src/documents/templates/registration/logged_out.html +++ b/src/documents/templates/registration/logged_out.html @@ -37,7 +37,10 @@
- +

{% translate "You have been successfully logged out. Bye!" %}

{% translate "Sign in again" %}
diff --git a/src/documents/templates/registration/login.html b/src/documents/templates/registration/login.html index ba46d3adf..0f6062eb2 100644 --- a/src/documents/templates/registration/login.html +++ b/src/documents/templates/registration/login.html @@ -38,7 +38,10 @@
{% csrf_token %} - +

{% translate "Please sign in." %}

{% if form.errors %}