[Resolved] GenerateBlocks custom SVG icons

Home Forums Support GenerateBlocks custom SVG icons

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1251229
    konceptuel

    Hey Support,

    1. How do I go about loading custom SVG icons in GenerateBlocks heading block?
    2. Do I need to download SVG Icons and use the Safe SVG plugin?
    3. Where du I get the Icon SVG HTML?

    #1251282
    David
    Staff
    Customer Support

    Hi there,

    you don’t need the Safe SVG plugin.

    You will need to open your original SVG image file in a text editor to get to its HTML or you can use this site to do that:

    https://jakearchibald.github.io/svgomg/

    Then its just a case of copying the <SVG> markup into the field provided in GenerateBlocks.

    #1252703
    konceptuel

    Hi David,

    brilliant, thank you 🙂

    #1252923
    David
    Staff
    Customer Support
    #1599268
    Rafał

    Hi Great GP Support!

    Is it possible to pass sanitizing with the USE tag inside my SVG code (as a reference to an inline SVG symbol)?

    For example:
    <svg width="1em" height="1em" class="icon"><use href="#my-icon"/></svg>

    Wipes to:
    <svg width="1em" height="1em" class="icon"></svg>

    Inline SVG:

    <svg style="display:none">
      <symbol id="my-icon" viewBox="0 0 512 512">
        <path d="…" />
      </symbol>
    </svg>
    #1601038
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    It seems like <use> should work as long as it’s a local reference (#something). I’m surprised it’s stripping that out in your tests.

    I’ll dig deeper into it 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.