#20597: Replace admin icons images by inline SVG
-------------------------------------+-------------------------------------
     Reporter:  loic84               |                    Owner:  anonymous
         Type:                       |                   Status:  assigned
  Cleanup/optimization               |
    Component:  contrib.admin        |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  1
-------------------------------------+-------------------------------------

Comment (by elky):

 Despite all advantages of inline SVG it is pretty complex solution to
 implement and support in Django admin.
 1. SVG is pretty big to insert in markup (include tag for each icon as a
 solution?)
 2. We can use simple <img> with SVG as a source but this approach is weak
 - we can't change SVG color in this case. So we'll have to serve already
 colorized SVG files (not flexible solution). There is
 [[http://stackoverflow.com/questions/11978995/how-to-change-color-of-svg-
 image-using-css-jquery-svg-image-replacement|JS solution]] to replace img
 with inline SVG  but I'm not really sure that it's good practice.
 3. There are many places where icons render in JS (widgets) - I don't see
 any not ugly solution to add inline SVG into it. Using div element with
 SVG as a background is a weak solution too - no way to colorize it (CSS3
 mask has [[http://caniuse.com/#search=mask-image|poor browser support]])
 4. 20+ additional server requests
 5. Support. Contributors will have to add (and draw?) new icons manually
 which brakes development process.

 I vote for font icons (like Font Awesome).
 [[https://groups.google.com/d/msg/django-
 developers/HJAikaEBqJ4/UsvIjs_QCgAJ|See discussion]] in django-developers.

--
Ticket URL: <https://code.djangoproject.com/ticket/20597#comment:12>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.a480a49dac3cccaa1b9fcfcc89f64a87%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to