• I’ve put some very simple SVG-Images right into the CSS (to reduce server-calls), these get broken when Autoptimize is running – they disappear. Otherwise, all seems to be working fine and performs very well…

    a#mobile-menu-btn{
        display: block;
        position: absolute;
        right: 0;
        width: 30px;
        height: 22px;
        margin: 0 30px 0;
        padding: 0;
        background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="9.125" height="9.137" viewBox="4.437 4.431 9.125 9.137"><path d="M9.282 8.712h4.125c.12 0 .155.047.155.168v.252c0 .12-.035.154-.155.154H9.282v4.127c0 .12-.036.155-.156.155h-.252c-.12 0-.156-.037-.156-.156V9.286H4.593c-.12 0-.156-.035-.156-.154V8.88c0-.12.036-.168.156-.168h4.125V4.585c0-.107.037-.154.156-.154h.252c.12 0 .156.05.156.156v4.126z"/></svg>') 0 0 no-repeat;
        background-size: contain;
        text-decoration: none;
        text-indent: -9999em}

    https://ww.wp.xz.cn/plugins/autoptimize/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Frank Goossens

    (@futtta)

    and do you have the option “Generate data: URIs for images” active? If so, can you disable and report back if that solves the issue (still a bug, mind you, but helps me pinpoint it).

    frank

    Thread Starter davitz

    (@davitz)

    Good Morning, Frank
    Thanks mich die the quick reply!

    No, this Option isn’t active…

    Regards

    David

    Plugin Author Frank Goossens

    (@futtta)

    Morning David;
    I’m leaving on holiday today, but I’ll look into this upon my return.

    kind regards,
    frank

    Plugin Author Frank Goossens

    (@futtta)

    Sorry this took this long David, busy times … 🙂

    After doing some tests I can confirm this is a bug in the CSS minifier component AO uses for which I created a ticket on the GitHub page of said component.

    As a temp workaround you could exclude the CSS that has the inline SVG (you could move that specific code inline in the HTML or into a seperate file, so you’d only have that excluded).

    frank

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Autoptimize breaks inline SVG’ is closed to new replies.