[mumi] Some HTML elements don't respond to preferred color scheme when JS is disabled

  • Done
  • quality assurance status badge
Details
2 participants
  • Arun Isaac
  • Luis Felipe
Owner
unassigned
Submitted by
Luis Felipe
Severity
normal
L
L
Luis Felipe wrote on 8 Jun 21:54 +0200
(address . bug-guix@gnu.org)
4e455dd4-a68e-52ff-5325-a12f4b5466f7@zoho.com
Package: mumi
Hi,
When using a web browser with JavaScript disabled, the body element and
the text input of class ".tokenInput" don't use the correct color theme.
This doesn't affect people who use light themes, but it does affect
people who use dark themes because it introduces contrast issues (light
text on light backgrounds).
STEPS TO REPRODUCE
1. Launch IceCat web browser
2. Enable user defined color scheme preferences by disabling
Application menu → IceCat Settings → Resist Fingerprinting
3. Set your color scheme preferences to Dark in: Application menu →
Settings → Language and Appearance → Website appearance
4. Disable JavaScript in: Application menu → IceCat Settings → Disable
Javascript
6. Press Ctrl+F5 to avoid using cached resources
EXPECTED RESULT
The website uses the dark color scheme.
UNEXPECTED RESULT
The HTML body element and the text input of class ".tokenInput" don't
use the dark color scheme, while the rest of the elements do use it.
ADDITIONAL INFORMATION
There seems to be something wrong with the functionality of the
"--background-color" variable. While it seems to have appropriate values
assigned to it for every color scheme case (prefers light, prefers dark,
and no preference), the dark color value is not being used when needed.
I still don't know why.
WORKAROUND
Assigning the value of "var(--nav-background-color)" to the
"background-color" property of the affected elements solves the issue.
--
Luis Felipe López Acevedo
Attachment: OpenPGP_signature
S
S
sirgazil wrote on 9 Jun 01:19 +0200
[PATCH] assets: Make body and .tokenInput color scheme aware in non JS browsers.
(address . 71443@debbugs.gnu.org)(name . Luis Felipe)(address . sirgazil@zoho.com)
20240608231936.11810-1-sirgazil@zoho.com
From: Luis Felipe <sirgazil@zoho.com>


* assets/mumi.scss (body, .tokenInput): Set their "background-color"
property to the same color variable used by the navigation bar, which
actually responds to the preferred color scheme settings of the
browser.
---
assets/mumi.scss | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Toggle diff (25 lines)
diff --git a/assets/mumi.scss b/assets/mumi.scss
index e605630..5ac0f26 100644
--- a/assets/mumi.scss
+++ b/assets/mumi.scss
@@ -69,6 +69,7 @@ html {
}
body {
+ background-color: var(--nav-background-color);
height: auto;
}
@@ -711,7 +712,7 @@ div.line pre {
width: 100%;
padding-inline-start: calc(var(--form-element-spacing-horizontal) + 1.75rem);
border-radius: 5rem;
- background-color: var(--background-color);
+ background-color: var(--nav-background-color);
background-image: var(--icon-search);
background-position: center left 1.125rem;
background-size: 1rem auto;

base-commit: b7848b1e83b3eaa8b8aec0f734cbd04020d71b51
--
2.41.0
A
A
Arun Isaac wrote on 9 Jun 15:32 +0200
Re: [mumi] Some HTML elements don't respond to preferred color scheme when JS is disabled
(address . 71443@debbugs.gnu.org)(name . Luis Felipe)(address . sirgazil@zoho.com)
87ikyifdhw.fsf@systemreboot.net
And, thanks for the detailed steps to reproduce! It was very helpful in
reproducing the bug easily. I appreciate it!
A
A
Arun Isaac wrote on 9 Jun 15:30 +0200
[PATCH 0/1] Set --background-color variable in dark theme
(address . 71443@debbugs.gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
20240609133025.8309-1-arunisaac@systemreboot.net
Hi Luis,

Good catch! Might I suggest the following patch that fixes the
--background-color variable instead of reusing the
--nav-background-color variable? Could you confirm that this works for
you?

Thanks!
Arun

Luis Felipe (1):
assets: Set --background-color variable in dark theme.

assets/mumi.scss | 1 +
1 file changed, 1 insertion(+)

--
2.45.1
A
A
Arun Isaac wrote on 9 Jun 15:30 +0200
[PATCH 1/1] assets: Set --background-color variable in dark theme.
(address . 71443@debbugs.gnu.org)
20240609133025.8309-2-arunisaac@systemreboot.net
From: Luis Felipe <sirgazil@zoho.com>

Previously, the --background-color variable was not set in the dark
theme leading to contrast issues (light text on light backgrounds).

* assets/mumi.scss (@mixin dark): Set --background-color variable.

Signed-off-by: Arun Isaac <arunisaac@systemreboot.net>
---
assets/mumi.scss | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/assets/mumi.scss b/assets/mumi.scss
index e605630..2581b2c 100644
--- a/assets/mumi.scss
+++ b/assets/mumi.scss
@@ -36,6 +36,7 @@ $commit_header: #005cc5;
// Dark theme
@mixin dark {
+ --background-color: #{darken($grey-900, 6%)};
--nav-background-color: #{darken($grey-900, 6%)};
--nav-border-color: #{mix($grey-500, $black, 40%)};
--nav-logo-color: #{darken($grey-200, 6%)};
--
2.45.1
L
L
Luis Felipe wrote on 10 Jun 00:35 +0200
Re: [mumi] Some HTML elements don't respond to preferred color scheme when JS is disabled
9aa25c87-e6c2-20e4-bb1c-40742df0395b@zoho.com
Hi Arun,
I can confirm that your updated patch works. Problem solved :)
Have a nice day,
Attachment: OpenPGP_signature
A
A
Arun Isaac wrote on 10 Jun 13:44 +0200
(address . 71443-done@debbugs.gnu.org)(name . Luis Felipe)(address . sirgazil@zoho.com)
87le3ddnta.fsf@systemreboot.net
Pushed as 858c2cd544084316f9df19b2e536059ff3070c35. Thanks! You should
see the change in https://issues.guix.gnu.orgthe next time it is
reconfigured.

Before pushing, I also updated the CSS timestamp. We do this to
invalidate browser caches.
Closed
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 71443@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 71443
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch