Home Forums Backend Issues (wp-admin) SVG support


SVG support

  • A responsive svg image has no specific dimensions. Therefore, when it’s added via ACF image uploader, the svg preview is not being displayed properly.

    Currently the css looks like this (ACF v5.1.4 ~Line 708):

    @media screen and (-webkit-min-device-pixel-ratio: 0) {
    .acf-image-uploader img {
    width: auto;

    In Web Inspector, changing width to 100% fixed it. Please consider modifying ACF’s stylesheet.

  • Hi @spinline

    Thanks for the topic.

    I’m looking at the input.css file in the latest version (5.1.9) and the CSS looks like this:

    @media screen and (-webkit-min-device-pixel-ratio:0) {
    	.acf-image-uploader img {
    		width: auto;
    		max-width: 100%;

    Perhaps the max-width will help the .svg?

    Can you also attach a screenshot of the issue so I can better understand how to fix it?


  • This reply has been marked as private.
  • Hi @spinline

    Thanks for the info.
    I’m not sure if I want the svg to use 100% width, as this could make for huge images on the page (1200px wide). Instead, the auto width allows the svg to determine it’s normal state.

    Can you send a screenshot of what you SVG looks like so I can better understand the issue?


  • @elliot I’m not sure why my screenshot didn’t attach last time. I’ll try again…

  • @elliot First of all, shame on me, I didn’t optimize those svgs as I normally would through grunt or gulp.

    I’ve included the svg code for one of the svg images as seen in my screenshot earlier from this thread.

    <?xml version="1.0" encoding="utf-8"?>
    <!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "">
    <svg version="1.1" id="Layer_1" xmlns="" xmlns:xlink="" x="0px" y="0px"
    	 viewBox="0 0 584.8 149.9" enable-background="new 0 0 584.8 149.9" xml:space="preserve">
    	<path fill="#FFFFFF" d="M158.2,17.5c-1.2,0-2.3-0.1-3.3-0.4c-1-0.2-1.8-0.5-2.3-0.9l0.4-3.5c0.5,0.5,1.2,0.9,2.1,1.3
    <!-- a bunch of paths more… -->
  • Hi @spinline

    Thanks for the screenshot. Lastly, what browser are you using?

    Can you try another to see if the image issue is browser dependent?


  • @elliot My screenshots were from Chrome v 41.x desktop.

    In Firefox 36.x desktop, it’s setting the width to auto, as you intended, but the height is always set to 30px tall. Although, it’s not as bad as Chrome, it still looks pretty bad.

    In Safari 8.x desktop, it looks as you probably intended – perfect!

    IE11 gets it right, too.

  • This reply has been marked as private.
  • Thanks @spinline

    I’ll do some testing in different browsers, that seems to be the issue here.


  • Hi @spinline

    Thanks again for your help with this.

    I’ve changed the CSS to avoid the chrome ‘small preview’ issue.
    Now all svg’s have a min width and height.
    All browsers should now be more similar to the firefox preview.

    I’ll include this in the next version

Viewing 11 posts - 1 through 11 (of 11 total)

The topic ‘SVG support’ is closed to new replies.