Skip to content

Commit 74fedbc

Browse files
fsbraunmarksweb
andauthored
fix: django shortcuts styling (#481)
* Fix: Shortcut positioning * Add: CSS with shortcuts support * Bump version to 3.2.2 * add info to changelog and reademe.md * Update readme Co-authored-by: Mark Walker <[email protected]>
1 parent 897f535 commit 74fedbc

File tree

7 files changed

+83
-180
lines changed

7 files changed

+83
-180
lines changed

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
Changelog
33
=========
44

5+
3.2.2 (2023-01-06)
6+
==================
7+
8+
* Fix support of django-shortcuts with original icons from django-shortcuts
9+
510
3.2.1 (2022-12-15)
611
==================
712

README.rst

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ django CMS Admin Style
44

55
|pypi| |build| |coverage|
66

7-
Adds pretty CSS styles for the django CMS admin interface.
7+
Adds pretty CSS styles for the django CMS admin interface. Supports optional
8+
``django-admin-shortcuts`` package.
89

910

1011
.. note::
@@ -85,6 +86,57 @@ To **compile CSS** run the following commands using **node 16**:
8586

8687
For further options have a look at the ``gulpfile.js``.
8788

89+
Dark mode support
90+
-----------------
91+
92+
Django supports a dark mode admin since version 3.1. djangocms-admin-style
93+
introduces css variables that contain color codes and change with the selected
94+
mode:
95+
96+
+-------------------------------+-----------+---------------------------+-----------+
97+
| **CMS variable name** | **Color** | **Django admin fallback** | **Color** |
98+
+-------------------------------+-----------+---------------------------+-----------+
99+
| ``--dca-white`` | #ffffff | ``--body-bg`` | #ffffff |
100+
+-------------------------------+-----------+---------------------------+-----------+
101+
| ``--dca-black`` | #000000 | ``--body-fg`` | #303030 |
102+
+-------------------------------+-----------+---------------------------+-----------+
103+
| ``--dca-gray`` | #666 | ``--body-quiet-color`` | #666 |
104+
+-------------------------------+-----------+---------------------------+-----------+
105+
| ``--dca-gray-lightest`` | #f2f2f2 | ``--darkened-bg`` | #f8f8f8 |
106+
+-------------------------------+-----------+---------------------------+-----------+
107+
| ``--dca-gray-lighter`` | #ddd | ``--border-color`` | #ccc |
108+
+-------------------------------+-----------+---------------------------+-----------+
109+
| ``--dca-gray-light`` | #999 | ``--close-button-bg`` | #888 |
110+
+-------------------------------+-----------+---------------------------+-----------+
111+
| ``--dca-gray-darker`` | #454545 | | |
112+
+-------------------------------+-----------+---------------------------+-----------+
113+
| ``--dca-gray-darkest`` | #333 | | |
114+
+-------------------------------+-----------+---------------------------+-----------+
115+
| ``--dca-gray-super-lightest`` | #f7f7f7 | | |
116+
+-------------------------------+-----------+---------------------------+-----------+
117+
| ``--dca-primary`` | #00bbff | ``--primary`` | #79aec8 |
118+
+-------------------------------+-----------+---------------------------+-----------+
119+
120+
121+
Extending styles in your own app
122+
---------------------------------
123+
124+
If your project or app requires specific styles if djangocms-admin-style is
125+
installed (e.g., to better adjust to the django CMS style) you can add selective
126+
styling by adding the ``.djangocms-admin-style`` selector::
127+
128+
// Show widget in CMS colors if djangocms-admin-style is installed
129+
.djangocms-admin-style #my-widget {
130+
color: var(--dca-primary, black);
131+
}
132+
133+
We recommend to following rules for your app's admin css:
134+
135+
- Try avoid using ``color``, ``background`` etc. styles where possible and meaningful
136+
- If necessary use as few as possible standard django CMS colors (preferably
137+
from see above list with fallback colors)
138+
- Usage: ``var(--dca-color-var, var(--fallback-color-var, #xxxxxx))`` where
139+
``#xxxxxx`` represents the light version of the color.
88140

89141
Running Tests
90142
-------------

djangocms_admin_style/__init__.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1-
__version__ = '3.2.1'
1+
"""
2+
See PEP 440 (https://www.python.org/dev/peps/pep-0440/)
3+
4+
Release logic:
5+
1. Increase version number (change __version__ below).
6+
2. Ensure the static bundle is upto date with ``nvm use && gulp icons && gulp sass bundle``
7+
3. Assure that all changes have been documented in CHANGELOG.rst.
8+
4. In setup.py check that
9+
- versions from all third party packages are pinned in ``REQUIREMENTS``.
10+
- the list of ``CLASSIFIERS`` is up-to-date.
11+
5. git add djangocms_admin_style/__init__.py CHANGELOG.rst setup.py
12+
6. git commit -m 'Bump to {new version}'
13+
7. git push
14+
8. Assure that all tests pass on https://github.com/django-cms/djangocms-admin-style/actions
15+
9. Create a new release on https://github.com/django-cms/djangocms-admin-style/releases/new
16+
10. Publish the release when ready
17+
11. Github actions will publish the new package to pypi
18+
"""
19+
__version__ = '3.2.2'

djangocms_admin_style/sass/components/_shortcuts.scss

Lines changed: 0 additions & 175 deletions
Original file line numberDiff line numberDiff line change
@@ -55,181 +55,6 @@
5555
font-size: 30px;
5656
margin-right: 0;
5757
}
58-
// replaces shortcut link images with icon font #199
59-
.archive {
60-
@include icon(archive);
61-
}
62-
.back {
63-
@include icon(reply);
64-
}
65-
.basket {
66-
@include icon(shopping-cart);
67-
}
68-
.blog {
69-
@include icon(comment);
70-
}
71-
.camera {
72-
@include icon(camera);
73-
}
74-
.card {
75-
@include icon(credit-card);
76-
}
77-
.cash {
78-
@include icon(money);
79-
}
80-
.certificate {
81-
@include icon(certificate);
82-
}
83-
.clock {
84-
@include icon(clock);
85-
}
86-
.cloud1 {
87-
@include icon(cloud);
88-
}
89-
.cloud2 {
90-
@include icon(cloud-upload);
91-
}
92-
.cloud3 {
93-
@include icon(cloud-download);
94-
}
95-
.cloud4 {
96-
@include icon(refresh);
97-
}
98-
.config {
99-
@include icon(cog);
100-
}
101-
.config2 {
102-
@include icon(cog);
103-
}
104-
.date {
105-
@include icon(calendar);
106-
}
107-
.delivery1 {
108-
@include icon(envelope-square);
109-
}
110-
.delivery2 {
111-
@include icon(envelope);
112-
}
113-
.diskette {
114-
@include icon(floppy-o);
115-
}
116-
.file1 {
117-
@include icon(file);
118-
}
119-
.file2 {
120-
@include icon(files-o);
121-
}
122-
.film {
123-
@include icon(film);
124-
}
125-
.flag {
126-
@include icon(flag);
127-
}
128-
.folder {
129-
@include icon(folder-open);
130-
}
131-
.gamepad {
132-
@include icon(gamepad);
133-
}
134-
.garbage {
135-
@include icon(trash);
136-
}
137-
.gift {
138-
@include icon(gift);
139-
}
140-
.help {
141-
@include icon(life-ring);
142-
}
143-
.home {
144-
@include icon(home);
145-
}
146-
.key {
147-
@include icon(key);
148-
}
149-
.less {
150-
@include icon(minus-circle);
151-
}
152-
.letter {
153-
@include icon(file-text);
154-
}
155-
.letters {
156-
@include icon(newspaper-o);
157-
}
158-
.light {
159-
@include icon(lightbulb-o);
160-
}
161-
.lock {
162-
@include icon(lock);
163-
}
164-
.love {
165-
@include icon(heart);
166-
}
167-
.mail {
168-
@include icon(envelope);
169-
}
170-
.monitor {
171-
@include icon(desktop);
172-
}
173-
.music {
174-
@include icon(music);
175-
}
176-
.note {
177-
@include icon(file-text);
178-
}
179-
.notepad {
180-
@include icon(file-text);
181-
}
182-
.ok {
183-
@include icon(check);
184-
}
185-
.package {
186-
@include icon(cube);
187-
}
188-
.pencil {
189-
@include icon(pencil);
190-
}
191-
.phone {
192-
@include icon(mobile);
193-
}
194-
.picture {
195-
@include icon(picture-o);
196-
}
197-
.pin {
198-
@include icon(map-marker);
199-
}
200-
.plus {
201-
@include icon(plus-circle);
202-
}
203-
.print {
204-
@include icon(print);
205-
}
206-
.sound {
207-
@include icon(volume-up);
208-
}
209-
.suitcase {
210-
@include icon(suitcase);
211-
}
212-
.tag {
213-
@include icon(tag);
214-
}
215-
.ticket {
216-
@include icon(ticket);
217-
}
218-
.tool {
219-
@include icon(wrench);
220-
}
221-
.unlock {
222-
@include icon(unlock-alt);
223-
}
224-
.user {
225-
@include icon(user);
226-
}
227-
.warning {
228-
@include icon(exclamation-triangle);
229-
}
230-
.zoom {
231-
@include icon(search-plus);
232-
}
23358
}
23459
}
23560
}

djangocms_admin_style/sass/djangocms-admin.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
@import "components/header";
2929
// @import "components/filer";
3030
@import "components/footer";
31-
// @import "components/shortcuts";
31+
@import "components/shortcuts";
3232
@import "components/drag-and-drop";
3333
@import "components/cms-update";
3434
@import "components/django-nested-admin";

djangocms_admin_style/static/djangocms_admin_style/css/djangocms-admin.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
from setuptools import find_packages, setup
55

6+
from djangocms_admin_style import __version__
7+
68

79
REQUIREMENTS = []
810

@@ -35,6 +37,7 @@
3537
'Framework :: Django CMS :: 3.10',
3638
'Framework :: Django CMS :: 3.11',
3739
'Framework :: Django CMS :: 4.0',
40+
'Framework :: Django CMS :: 4.1',
3841
'Topic :: Internet :: WWW/HTTP',
3942
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
4043
'Topic :: Software Development',
@@ -46,7 +49,7 @@
4649

4750
setup(
4851
name='djangocms-admin-style',
49-
version='3.2.1',
52+
version=__version__,
5053
author='Divio AG',
5154
author_email='[email protected]',
5255
maintainer='Django CMS Association and contributors',

0 commit comments

Comments
 (0)