Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author mlwilkerson

    (@mlwilkerson)

    I think it should work to use this technique in the last example here. It shows how you can configure Font Awesome by setting values on the global FontAwesomeConfig object prior to the loading of the Font Awesome SVG/JS framework. Here’s the core of the example:

        <script>
          <!-- The settings you provide will be merged with the default settings -->
          FontAwesomeConfig = {
            searchPseudoElements: true
          }
        </script>
        <script
          src="https://use.fontawesome.com/releases/v5.15.1/js/all.js"
        ></script>

    So my expectation is that, if you were to enqueue a script that sets the global config object like this, and it loads prior to the one that loads with resource handle FontAwesome::RESOURCE_HANDLE (which would be the kit loader script when the plugin is configured for kits), then it will work.

    Thread Starter R3dRidl3

    (@r3dridl3)

    Ok, will try, but should this not be an option in the plugin?

    Plugin Author mlwilkerson

    (@mlwilkerson)

    Well, I think that’s iffy, so we haven’t included it yet. There are some significant performance problems with SVG pseudo-elements in some scenarios, so we normally advise against using pseudo-elements with the SVG/JS technology. So it’s not an option to enable SVG pseudo-elements in a kit in the Kit Settings UI on fontawesome.com.

    The way this plugin works currently, when a kit is selected, the plugin just reads the kit’s settings; it doesn’t configure them. The kit settings are configured in the Kit Settings UI on fontawesome.com. If we were to add this feature to the plugin, it would be the one setting where the plugin overrides something about the configuration of the kit. The kit would then function differently when loading on the WordPress site than when the same kit is used on some other site.

    So it’s not obvious to me that it should be an option in the plugin, but it’s a valid question and would be a valid feature request.

    I’ve just run into this problem too…

    So @mlwilkerson, is there a way to enable searching for pseudo elements in the kit settings?

    Is this also related to special characters not being replaced?

    • This reply was modified 4 years, 4 months ago by 63N.
    Plugin Author mlwilkerson

    (@mlwilkerson)

    @63n no, at this time, there’s no user-configurable way to enable pseudo-elements search in SVG Kits. The only way to do it would be the lower-level approach as I described above where you use one of the configuration mechanisms available in the JavaScript API.

    Thanks @mlwilkerson

    Is there anything in the roadmap for using pseudo elements? (It’s pretty critical for a few of my projects!) Or do you recommend sticking with the web font option?

    The kicker is we want to use the custom icon feature in FA6 when that drops.

    Plugin Author mlwilkerson

    (@mlwilkerson)

    Actually, @63n there’s been some recent relevant conversation and R&D around this. But nothing yet as official as roadmap.

    Could you contact me at hello at fontawesome dot com? I’ve more questions for you to help with possibly drawing roadmaps.

    Apologies for the slow reply… I’ve just sent an email!

    Thread Starter R3dRidl3

    (@r3dridl3)

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘FontAwesome kit and data-search-pseudo-elements’ is closed to new replies.