iLemon Member Sep 9, 2018 #1 Hi, I have added a custom button to the navigation. How do I apply an icon to it? Would like to set @xf-uix_icon_shoppingCart for it. Regards, Alex
Hi, I have added a custom button to the navigation. How do I apply an icon to it? Would like to set @xf-uix_icon_shoppingCart for it. Regards, Alex
Ozzy47 Well-known member Sep 9, 2018 #2 Have a read here, https://xenforo.com/community/threads/add-font-awesome-icons-to-the-navigation.139192/ Upvote 0 Downvote
Have a read here, https://xenforo.com/community/threads/add-font-awesome-icons-to-the-navigation.139192/
iLemon Member Sep 9, 2018 #3 ozzy47 said: Have a read here, https://xenforo.com/community/threads/add-font-awesome-icons-to-the-navigation.139192/ Click to expand... Thanks. I set the navigation Title to: Code: <i class="fa fa-shopping-cart fa-large fa-fixed-width" style="padding-right:5px;"></i>Store It looks fine on desktop but on mobile: Spoiler: Mobile The Store icon isn't the same as the others. Upvote 0 Downvote
ozzy47 said: Have a read here, https://xenforo.com/community/threads/add-font-awesome-icons-to-the-navigation.139192/ Click to expand... Thanks. I set the navigation Title to: Code: <i class="fa fa-shopping-cart fa-large fa-fixed-width" style="padding-right:5px;"></i>Store It looks fine on desktop but on mobile: Spoiler: Mobile The Store icon isn't the same as the others.
Russ Well-known member Sep 9, 2018 #4 Maybe contact your style author as they could be approaching it different? Material icons vs font awesome. Upvote 0 Downvote
Maybe contact your style author as they could be approaching it different? Material icons vs font awesome.
iLemon Member Sep 9, 2018 #5 Managed to figure it out. For anybody with the same question, here's what I did: In uix_icons.less, I added: Code: <xf:if is="{$icon} == 'store'">content: '@xf-uix_icon_shoppingCart';</xf:if> (where the identical code is) And in uix.less, I added: Code: &[data-nav-id="store"]:before {<xf:macro name="content" template="uix_icons.less" arg-icon="store" />} (where the identical code is) 'store' being the ID of the navigation link. Upvote 0 Downvote
Managed to figure it out. For anybody with the same question, here's what I did: In uix_icons.less, I added: Code: <xf:if is="{$icon} == 'store'">content: '@xf-uix_icon_shoppingCart';</xf:if> (where the identical code is) And in uix.less, I added: Code: &[data-nav-id="store"]:before {<xf:macro name="content" template="uix_icons.less" arg-icon="store" />} (where the identical code is) 'store' being the ID of the navigation link.
Ozzy47 Well-known member Sep 9, 2018 #6 Glad you got it figured out for the custom style. Upvote 0 Downvote
A AlBundy Member May 31, 2019 #7 Hello, i use Xenforo 2.11 and i want add a SVG-Icon. But only in the mobile Style, not for Desktop-User. What do i have to change? If i edit the class in "www.mywebsite.de/icon.svg" , nothing is displayed. I want use various Icons for Underforums. Many thanks for the help edit extra.less .offCanvasMenu-linkHolder [data-nav-id="store"]:before { content: ""; display: block; height: 20px; width: 20px; background-size: 20px 20px; background-image: url("www.mywebsite.de/icon.svg"); background-repeat: no-repeat; padding-right:5px } But the icon is over the name, not left hmm Last edited: May 31, 2019 Upvote 0 Downvote
Hello, i use Xenforo 2.11 and i want add a SVG-Icon. But only in the mobile Style, not for Desktop-User. What do i have to change? If i edit the class in "www.mywebsite.de/icon.svg" , nothing is displayed. I want use various Icons for Underforums. Many thanks for the help edit extra.less .offCanvasMenu-linkHolder [data-nav-id="store"]:before { content: ""; display: block; height: 20px; width: 20px; background-size: 20px 20px; background-image: url("www.mywebsite.de/icon.svg"); background-repeat: no-repeat; padding-right:5px } But the icon is over the name, not left hmm