django-cms / djangocms-admin-style

django CMS Admin Style is a Django Theme tailored to the needs of django CMS.
http://www.django-cms.org/
Other
418 stars 118 forks source link

feat: Configurable dark mode (color scheme) #460

Closed fsbraun closed 2 years ago

fsbraun commented 2 years ago

This PR lets the dark mode css be configured by django CMS settings and as proposed in PR https://github.com/django-cms/django-cms/pull/7329.

It also overrides the dark mode settings of Django's admin styling to allow consistent light mode even with OS preferences set to dark mode.

Dark mode settings of django CMS are communicated through the data-color-scheme attribute of the <html> element. If unset the os sets the color scheme. If set data-color-scheme="light" the color scheme is light independently of the OS settings. Same is true for "dark".

Know issue:

codecov[bot] commented 2 years ago

Codecov Report

Merging #460 (0e527fa) into master (845a736) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #460   +/-   ##
=======================================
  Coverage   36.11%   36.11%           
=======================================
  Files           2        2           
  Lines          36       36           
  Branches        1        1           
=======================================
  Hits           13       13           
  Misses         23       23           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 845a736...0e527fa. Read the comment docs.