silentsokolov / django-admin-rangefilter

A Django app that lets you filter data by date range and numeric range in the admin UI
MIT License
721 stars 106 forks source link

Use admin CSS vars for colors #80

Closed mharju closed 2 years ago

mharju commented 2 years ago

Hi!

A simple fix to use the CSS variables to set the colors used in the buttons. Needed this for branding so if it's useful upstream, here it is.

Thanks!

silentsokolov commented 2 years ago

A good improvement, thanks you. But it doesn't work on django version 3 ((

1660132983914

mharju commented 2 years ago

You're right! Maybe I'll add a check to see if we are running Django < 3.2 and set default values for the CSS variables?

silentsokolov commented 2 years ago

You're right! Maybe I'll add a check to see if we are running Django < 3.2 and set default values for the CSS variables?

That sounds good

codecov-commenter commented 2 years ago

Codecov Report

Merging #80 (74a3ab9) into master (61ab73c) will decrease coverage by 0.11%. The diff coverage is 75.00%.

@@            Coverage Diff             @@
##           master      #80      +/-   ##
==========================================
- Coverage   88.27%   88.15%   -0.12%     
==========================================
  Files          12       12              
  Lines         452      456       +4     
==========================================
+ Hits          399      402       +3     
- Misses         53       54       +1     
Impacted Files Coverage Δ
rangefilter/templatetags/rangefilter_compat.py 85.71% <75.00%> (-4.29%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

mharju commented 2 years ago

The list filter does not expose template context so I had to make a templatetag to fill in the variables.

How does this look to you?

silentsokolov commented 2 years ago

Awesome! Thanks!