#33182 closed Cleanup/optimization (fixed)
Improve control of Admin's dark mode CSS.
Reported by: | Matteo Vitali | Owned by: | Matteo Vitali |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Normal | Keywords: | admin dark schema css ui ux |
Cc: | Paolo Melchiorre, Carlton Gibson | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | yes |
Description
I would suggest improving dark schema enablement in a simple way through a SiteAdmin attribute
Change History (12)
comment:1 by , 3 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 3 years ago
Owner: | changed from | to
---|
comment:3 by , 3 years ago
Cc: | added |
---|---|
Keywords: | css ui ux added |
Version: | 3.2 → dev |
Great addition Matteo. I think the correct target version is current dev and the pathc nedd some improvements like release note additions.
comment:4 by , 3 years ago
Needs documentation: | set |
---|---|
Needs tests: | set |
Patch needs improvement: | set |
Triage Stage: | Unreviewed → Accepted |
comment:5 by , 3 years ago
Cc: | added |
---|
comment:6 by , 3 years ago
So this is a follow-up to #31259 which added the dark theme after #32018 allowed theming via CSS vars.
This Stack Overflow thread captures the issues people have.
- How to disable (whilst keeping
prefers-color-scheme
set to dark?🤔) - Where/how exactly to override.
The PR moves the dark theme variable definitions into their own file, and adds an AdminSite attribute for that.
Probably just a block
is enough.
Then in the Theming Support docs:
- Link
template override
in the first paragraph to the Overriding Admin Templates docs. - Move the "A dark theme..." paragraph to a new subsection below "The list of CSS variables..."]
- Then add the file the vars are defined in, and mention the block that can be overridden to replace these, or skip the stylesheet entirely.
- Add a
versionchanged
for the variables being move to a separate stylesheet.
That should cover it.
I'm not sure we have automated tests for this. Manual testing will have to do.
comment:7 by , 3 years ago
Summary: | Enable dark mode in a easy way → Improve control of Admin's dark mode CSS. |
---|
comment:8 by , 3 years ago
Needs documentation: | unset |
---|---|
Needs tests: | unset |
Patch needs improvement: | unset |
Triage Stage: | Accepted → Ready for checkin |
Appreciate the interest, but we have a patch prepared already by the ticket author. We should evaluate that one first.
PR