Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#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 RUDRANSH-hub, 3 years ago

Owner: changed from nobody to RUDRANSH-hub
Status: newassigned

comment:2 by Jacob Walls, 3 years ago

Owner: changed from RUDRANSH-hub to Matteo Vitali

Appreciate the interest, but we have a patch prepared already by the ticket author. We should evaluate that one first.
PR

comment:3 by Paolo Melchiorre, 3 years ago

Cc: Paolo Melchiorre added
Keywords: css ui ux added
Version: 3.2dev

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 Mariusz Felisiak, 3 years ago

Needs documentation: set
Needs tests: set
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

comment:5 by Mariusz Felisiak, 3 years ago

Cc: Carlton Gibson added

comment:6 by Carlton Gibson, 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 Carlton Gibson, 3 years ago

Summary: Enable dark mode in a easy wayImprove control of Admin's dark mode CSS.

comment:8 by Carlton Gibson, 3 years ago

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:9 by Carlton Gibson <carlton.gibson@…>, 3 years ago

Resolution: fixed
Status: assignedclosed

In 3f1f8b93:

Fixed #33182 -- Moved admin dark mode vars to separate stylesheet and template block.

comment:10 by Carlton Gibson <carlton.gibson@…>, 3 years ago

In a754b82d:

Refs #33182 -- Adjusted custom admin theming example to use correct template block.

comment:11 by Carlton Gibson <carlton.gibson@…>, 3 years ago

In afe09048:

[4.0.x] Refs #33182 -- Adjusted custom admin theming example to use correct template block.

Backport of a754b82dac511475b6276039471ccd17cc64aeb8 from main

comment:12 by Carlton Gibson <carlton.gibson@…>, 3 years ago

In 128179c0:

[3.2.x] Refs #33182 -- Adjusted custom admin theming example to use correct template block.

Backport of a754b82dac511475b6276039471ccd17cc64aeb8 from main

Note: See TracTickets for help on using tickets.
Back to Top