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
411 stars 116 forks source link

feat: Update dark mode switch to be compatible with Django 4.2 admin dark mode #491

Closed fsbraun closed 1 year ago

fsbraun commented 1 year ago

Since version 4.2 Django's admin has its own dark mode toggle. While functionally similar, it uses a different naming convention. This PR adopts Django's naming convention

This implementation tries to be backwards compatible and take Django 4.2's theme setting - if not present it falls back to django CMS' color-scheme setting.

If Django 4.2 theme setting is present but is undesired, the user can remove it by typing localStorage.removeItem("theme").

This PR integrates with https://github.com/django-cms/django-cms/pull/7549.

codecov[bot] commented 1 year ago

Codecov Report

Merging #491 (2b8293c) into master (7dea618) will not change coverage. The diff coverage is n/a.

@@            Coverage Diff            @@
##            master      #491   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines           33        33           
  Branches         3         3           
=========================================
  Hits            33        33