Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin in dark mode = trash/delete/remove icon invisible #299

Closed
dmwyatt opened this issue Jun 7, 2023 · 6 comments
Closed

Admin in dark mode = trash/delete/remove icon invisible #299

dmwyatt opened this issue Jun 7, 2023 · 6 comments

Comments

@dmwyatt
Copy link

dmwyatt commented Jun 7, 2023

Dark mode:

image

Light mode:

image

@dmwyatt
Copy link
Author

dmwyatt commented Jun 7, 2023

I guess these icons come from jQuery? If so, it looks like there's not a way to change the icon color easily. I guess we'd have to bundle an icon for this and save it in a dark and light color.

@crucialfelix
Copy link
Owner

Yeah, jQuery UI is pre-dark mode.

In general it makes the most sense to build a separate package that solves this problem using modern tooling and libraries. There isn't much point trying to drag jQuery UI into the future for ever.

You may be able to do a CSS image transform. It may not look perfect, but it could look okay.

@dmwyatt
Copy link
Author

dmwyatt commented Jun 12, 2023

I ended up overriding base_site.html by placing the following in templates/admin (assuming you have templates look up setup correctly).

{% extends "admin/base_site.html" %}

{% block extrahead %}
  <style>
      @media (prefers-color-scheme: dark) {
          .ui-icon {
              filter: invert(.8);
          }
      }
  </style>
{% endblock %}

So I end up with:

image

@crucialfelix
Copy link
Owner

That's not bad at all. Better than nothing. If you can, make a PR. Otherwise I'm overdue (and over busy) to do another fix and a new release.

@gidantribal
Copy link

Hello,
In the official docs it's stated that you can change the icon and the CSS if needed, overriding the default one. It may be another workaround...

https://django-ajax-selects.readthedocs.io/en/latest/Media-assets.html

@crucialfelix
Copy link
Owner

Fixed. Thanks for the css!

Screenshot 2023-12-06 at 4 21 17 PM

crucialfelix added a commit that referenced this issue Dec 6, 2023
fix #299 : trash icon is invisible in dark mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants