• Replacing icon fonts with inline SVG icons seems to be strongly recommended by many developers these days.

    That makes sense for icons that can be hardcoded in theme files. But what about those that involve user-edited content?

    For example, perhaps you want the user to be able to add a class to a list, and it changes to use custom SVG icons as bullets.

    Or perhaps all headings of a certain level need an icon underneath them used for styling, or a custom quote for a blockquote, etc.

    Having post-processing code that parses the HTML output and inserts icons in the right places seems horrible (and wouldn’t work in a Gutenberg preview).

    Having the SVG icons inside the CSS with background-image is plausible, but makes it awful if you want multiple color variations (eg matching the text color), as you have to hardcode a different SVG icon for every color.

    Font icons make these all trivial. What are other developers doing?

    • This topic was modified 3 years, 4 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 1 replies (of 1 total)
  • Thread Starter smerriman

    (@smerriman)

    @jdembowski Why did you move this thread to fixing WordPress? This has nothing to do with fixing WordPress in the slightest; it’s about building a WordPress theme.

    If questions about.. developing with WordPress.. aren’t suited to a forum called developing with WordPress, please advise where they should go, since it’s definitely not this one.

    • This reply was modified 3 years, 4 months ago by smerriman.
Viewing 1 replies (of 1 total)
  • The topic ‘SVG icons vs icon fonts for generic content’ is closed to new replies.