Skip to content

Commit

Permalink
fix: sometimes data-theme="undefined" gets added to the <html> tag (
Browse files Browse the repository at this point in the history
#498)

* Fix: avoid `<html data-theme="undefined">`

* Add bundle

* Fix broken color input

* Add Django as dependency

* Fix: `.flex-container` styling

* Update CHANGELOG.rst

* Bump to 3.2.6
  • Loading branch information
fsbraun authored Sep 18, 2023
1 parent c303359 commit 02baca3
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 11 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
Changelog
=========

3.2.6 (2023-09-18)
==================

* Fix bug which adds 'data-theme="undefined"' to admin html tag
* Fix broken styling with `.flex-container`
* Fix broken color input (#429)
* Add Django as requirement in setup.py (#423)

3.2.5 (2023-08-22)
==================

Expand Down
2 changes: 1 addition & 1 deletion djangocms_admin_style/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
10. Publish the release when ready
11. Github actions will publish the new package to pypi
"""
__version__ = '3.2.5'
__version__ = '3.2.6'
10 changes: 10 additions & 0 deletions djangocms_admin_style/sass/components/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ form {
}
}
}
input[type="color"] {
width: revert;
}
button,
input[type="text"],
input[type="email"],
Expand Down Expand Up @@ -981,3 +984,10 @@ form select[multiple] {
.related-widget-wrapper-link:link:hover {
opacity: 1;
}

form .flex-container {
display: block;
div.fieldBox {
display: inline-block;
}
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ function getTopWindow() {
function getColorSchemeFromSettings(CMS) {
var colorScheme;

if (!CMS) {
return;
}

if (CMS.settings && CMS.settings.color_scheme) {
// Use color_scheme from settings.py
colorScheme = CMS.settings.color_scheme;
Expand Down Expand Up @@ -54,16 +58,12 @@ function darkModeSettings() {
// CMS not loaded: set color scheme for admin site according to settings
colorScheme = JSON.parse(localStorage.getItem('cms_cookie') || '{}').color_scheme;
}

if (colorScheme === 'auto' || colorScheme === undefined) {
document.documentElement.dataset.theme = 'auto';
} else {
document.documentElement.dataset.theme = colorScheme;
}
}
}
}
document.documentElement.dataset.theme = colorScheme;
if (colorScheme) {
document.documentElement.dataset.theme = colorScheme;
}
}

module.exports = darkModeSettings;
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
from djangocms_admin_style import __version__


REQUIREMENTS = []
REQUIREMENTS = [
"Django",
]


CLASSIFIERS = [
Expand Down

0 comments on commit 02baca3

Please sign in to comment.