XF 2.3 Switch button icon on switch switch-overlay

Kirby

Well-known member
In XF 2.1 and 2.2 I could do
Code:
<xf:button href="..." class="button--link button--icon button--icon--show"
        data-xf-click="switch-overlay"
        data-sk-watch="addClass:button--icon--show,removeClass:button--icon--hide"
        data-sk-unwatch="removeClass:button--icon--show,addClass:button--icon--hide">
        <span class="u-hideNarrow">Some Text</span>
</xf:button>

but this does not work any longer in XenForo 2.3

How can the same effect be achieved easily & efficiently with XenForo 2.3?

So far I've only got somewhat inefficient ideas:
  1. Add additional CSS to hide the <svg> and display the icon via CSS
    This is quite easy, but loads indivdual icon files (instead of using the icons from the sprite)
  2. Use a custom handler
    This requires quite a bit of code and loads an additional JS

@Jeremy P
 
Last edited:
This is quite easy, but loads indivdual icon files (instead of using the icons from the sprite)
I think that’s pretty ok for now. We’re likely to switch the CSS icons to use the sprites eventually.

Not against improving icon support for switch handlers more broadly though.
 
Back
Top Bottom