Skip to content

Commit

Permalink
fix: Remove unused icon css (#472)
Browse files Browse the repository at this point in the history
* Remove unused icons css
* Fix: cms v4 compatibility
* Remove unused shortcuts
* Remove css for .cms-icon
* Update readme and changelog
  • Loading branch information
fsbraun authored Dec 8, 2022
1 parent de3fd93 commit 246db34
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 325 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Changelog
unreleased
==========

* Removed unused css generating conflicts for icons fonts of
djangocms-admin-style and django-cms core.

3.2.0 (2022-06-13)
==================

Expand Down
5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ The following additional settings can be set:

The update checker does not gather or record any data.

To **compile CSS** run the following commands using **node 8**:
To **compile CSS** run the following commands using **node 16**:

* ``nvm use``
* ``npm install``
* ``gulp``

Expand All @@ -99,7 +100,7 @@ then run the following command::

make test

To test other Django versions simply append `VERSION=3.1``. You can also
To test other Django versions simply append `VERSION=4.1``. You can also
run the test server through::

make run
Expand Down
306 changes: 1 addition & 305 deletions djangocms_admin_style/sass/components/_iconography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -253,312 +253,8 @@
@return $char;
}

.cms-icon {
@extend %icon;
}
@mixin icon($filename, $insert: before) {
&:#{$insert} {
content: #{"\"\\"}#{icon-char($filename) + "\""};
}
}

// #####################################################################################################################
// #ICONS:start#
// use unicode characters for accessibility reasons and use aria-hidden="true" for decorative icons
// DOCS: http://filamentgroup.com/lab/bulletproof_icon_fonts.html

.cms-icon-archive {
@include icon(archive);
}

.cms-icon-arrow-left {
@include icon(arrow-left);
}

.cms-icon-arrow-right {
@include icon(arrow-right);
}

.cms-icon-calendar {
@include icon(calendar);
}

.cms-icon-camera {
@include icon(camera);
}

.cms-icon-certificate {
@include icon(certificate);
}

.cms-icon-check-circle {
@include icon(check-circle);
}

.cms-icon-check {
@include icon(check);
}

.cms-icon-chevron-circle-down {
@include icon(chevron-circle-down);
}

.cms-icon-chevron-circle-left {
@include icon(chevron-circle-left);
}

.cms-icon-chevron-circle-right {
@include icon(chevron-circle-right);
}

.cms-icon-chevron-circle-up {
@include icon(chevron-circle-up);
}

.cms-icon-chevron-left {
@include icon(chevron-left);
}

.cms-icon-clipboard {
@include icon(clipboard);
}

.cms-icon-clock {
@include icon(clock);
}

.cms-icon-cloud-download {
@include icon(cloud-download);
}

.cms-icon-cloud-upload {
@include icon(cloud-upload);
}

.cms-icon-cloud {
@include icon(cloud);
}

.cms-icon-cog {
@include icon(cog);
}

.cms-icon-comment {
@include icon(comment);
}

.cms-icon-credit-card {
@include icon(credit-card);
}

.cms-icon-cube {
@include icon(cube);
}

.cms-icon-desktop {
@include icon(desktop);
}

.cms-icon-envelope-square {
@include icon(envelope-square);
}

.cms-icon-envelope {
@include icon(envelope);
}

.cms-icon-exclamation-triangle {
@include icon(exclamation-triangle);
}

.cms-icon-file-text {
@include icon(file-text);
}

.cms-icon-file {
@include icon(file);
}

.cms-icon-files-o {
@include icon(files-o);
}

.cms-icon-film {
@include icon(film);
}

.cms-icon-flag {
@include icon(flag);
}

.cms-icon-floppy-o {
@include icon(floppy-o);
}

.cms-icon-folder-open {
@include icon(folder-open);
}

.cms-icon-folder {
@include icon(folder);
}

.cms-icon-gamepad {
@include icon(gamepad);
}

.cms-icon-gift {
@include icon(gift);
}

.cms-icon-heart {
@include icon(heart);
}

.cms-icon-home {
@include icon(home);
}

.cms-icon-info-circle {
@include icon(info-circle);
}

.cms-icon-key {
@include icon(key);
}

.cms-icon-laptop {
@include icon(laptop);
}

.cms-icon-life-ring {
@include icon(life-ring);
}

.cms-icon-lightbulb-o {
@include icon(lightbulb-o);
}

.cms-icon-lock {
@include icon(lock);
}

.cms-icon-logo {
@include icon(logo);
}

.cms-icon-map-marker {
@include icon(map-marker);
}

.cms-icon-minus-circle {
@include icon(minus-circle);
}

.cms-icon-mobile {
@include icon(mobile);
}

.cms-icon-money {
@include icon(money);
}

.cms-icon-music {
@include icon(music);
}

.cms-icon-newspaper-o {
@include icon(newspaper-o);
}

.cms-icon-pencil {
@include icon(pencil);
}

.cms-icon-picture-o {
@include icon(picture-o);
}

.cms-icon-picture {
@include icon(picture);
}

.cms-icon-plus-circle {
@include icon(plus-circle);
}

.cms-icon-plus {
@include icon(plus);
}

.cms-icon-print {
@include icon(print);
}

.cms-icon-refresh {
@include icon(refresh);
}

.cms-icon-remove {
@include icon(remove);
}

.cms-icon-reply {
@include icon(reply);
}

.cms-icon-scissors {
@include icon(scissors);
}

.cms-icon-search-plus {
@include icon(search-plus);
}

.cms-icon-search {
@include icon(search);
}

.cms-icon-shopping-cart {
@include icon(shopping-cart);
}

.cms-icon-suitcase {
@include icon(suitcase);
}

.cms-icon-tag {
@include icon(tag);
}

.cms-icon-ticket {
@include icon(ticket);
}

.cms-icon-trash-o {
@include icon(trash-o);
}

.cms-icon-trash {
@include icon(trash);
}

.cms-icon-unlock-alt {
@include icon(unlock-alt);
}

.cms-icon-upload {
@include icon(upload);
}

.cms-icon-user {
@include icon(user);
}

.cms-icon-volume-up {
@include icon(volume-up);
}

.cms-icon-wrench {
@include icon(wrench);
}
}
2 changes: 1 addition & 1 deletion djangocms_admin_style/sass/djangocms-admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
@import "components/header";
// @import "components/filer";
@import "components/footer";
@import "components/shortcuts";
// @import "components/shortcuts";
@import "components/drag-and-drop";
@import "components/cms-update";
@import "components/django-nested-admin";
Expand Down
13 changes: 0 additions & 13 deletions djangocms_admin_style/sass/libs/_iconfont.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,8 @@
@return $char;
}

.cms-icon {
@extend %icon;
}
@mixin icon($filename, $insert: before) {
&:#{$insert} {
content: #{"\"\\"}#{icon-char($filename) + "\""};
}
}

// #####################################################################################################################
// #ICONS:start#
// use unicode characters for accessibility reasons and use aria-hidden="true" for decorative icons
// DOCS: http://filamentgroup.com/lab/bulletproof_icon_fonts.html
<% _.each(glyphs, function(glyph) { %>
.cms-icon-<%= glyph.fileName %> {
@include icon(<%= glyph.fileName %>);
}
<% }); %>

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ 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') {
if (colorScheme === 'auto' || colorScheme === undefined) {
delete document.documentElement.dataset.colorScheme;
} else {
document.documentElement.dataset.colorScheme = colorScheme;
Expand Down
Loading

0 comments on commit 246db34

Please sign in to comment.