Okay
  Public Ticket #3151834
Custom Icons in Salient Elements
Closed

Comments

  •  13
    mark started the conversation

    Hello All,


    I have 2 more issues to overcome for completing my site.. 

    First issue is I am trying to add custom Icons to my Flip Box Element and my Tabs elements..

    I have all the icons as a .svg file and added it to my media library

    I have also created a custom icon library set. (.zip , JSON )

    ive been trying to figure this out on my own for days. I am getting fustrated. The information I am understanding is on this process is limited.. I am either going to break my site or my computer.. Please let me know if I am able to add custom icons in salient? If there is any info I can provide for further assistance please let me know. I appreciate any guidance or direction..

    I am using wpbakery in salient. I am also working locally but have a temp live site loaded for your assistance. Thanks 


  •  8,939
    Tahir replied

    Hey Again,

    At the moment there is no such integration method or process available. However escalating this to the developer for further response on this.

    Thanks 


    ThemeNectar Support Team 

  •  13
    mark replied

    thank you much appreciated

  •  1,085
    ThemeNectar replied

    Hey Mark,

    The easiest/most straightforward way to use a custom SVG icon would be to create a CSS rule to overload an existing icon. Here's an example of overloading an icon with the Fancy box element that you can add into the custom CSS box located in the Salient options panel > General Settings > CSS/Script related tab:

    .nectar-flip-box svg {
      background-size: cover;
      background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/18515/heart.svg) no-repeat 50% 50%;
    }
    /* hide default icon */
    .nectar-flip-box svg path {
      visibility: hidden;
    }
    

    It would be possible to create as many of these rules to target different fancy boxes/tabbed items. If you'd like to provide your temporary live site so I can see the elements you're trying to add custom icons to, I could provide more example snippets.

    Thanks in advance

  •  13
    mark replied

    Hey ThemeNectar,

    I have provided the live site so you would see where the icons will be implemented in the elements. I also provided screenshots.  I would much appreciate any example snippets I could use, and I'm very grateful for the code already provided..  Thanks Tahir as well for your efforts..


    https://soulascentials.com/product/4021/

    elements - Flip Box , Tabs ("how-to" section)

    The icons would be hosted locally during development. Then on webhosted server in future. Provided example icon.

    http://localhost:10019/wp-content/uploads/2022/10/health-Benefits.svg --local file path example 


    Quick side Question... lets say this page will be duplicated multiple times with with small variations but no changes to icons etc.. Would i have to enter yours snippets or code for each page or does the code apply to multiple pages that's using same element. If that makes sense.. Sorry if thats a silly question. I am new to this.  Look forward to your response. Thanks Again.

  •  1,085
    ThemeNectar replied

    Hey Mark,

    The CSS will affect all pages that use the same structure, so you won't need to add it to each page individually. 

    You'll need to give the parent column holding each element you wish to modify a unique class name so that it can be isolated with these custom rules. For example, 

    1013241001.jpg

    Those class names can then be used in the CSS like so:

    /* hide default icon */
    .top-benefits .nectar-flip-box svg path,
    .how-to-tabs .tabbed .wpb_tabs_nav svg path {
      visibility: hidden;
    }
    .top-benefits .nectar-flip-box svg,
    .how-to-tabs .tabbed .wpb_tabs_nav svg {
      background-size: cover;
    }
    /* custom flip box icons */
    .top-benefits .nectar-flip-box svg {
      background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/18515/heart.svg) no-repeat 50% 50%;
    }
    /* custom tab icons */
    .how-to-tabs .wpb_tabs_nav li:nth-child(1) svg {
      background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/18515/heart.svg) no-repeat 50% 50%;
    }
    .how-to-tabs .wpb_tabs_nav li:nth-child(2) svg {
      background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/18515/heart.svg) no-repeat 50% 50%;
    }
    .how-to-tabs .wpb_tabs_nav li:nth-child(3) svg {
      background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/18515/heart.svg) no-repeat 50% 50%;
    }
    

    For the tabs, make sure you've selected an icon for each tab and that the icon is within the "iconsminds" family in order to have the CSS work.

    Kind regards

  •  13
    mark replied

    Tested and working perfectly thanks 

  •  13
    mark replied

    Hey ThemeNectar,

    Everything is still working fine provided screenshot for local site. Just seeing if I have the ability to change the size of the icon and text for each tab. Change font style would be a bonus but its more the sizing I am looking for help with. 

     Before replying,, I tried wrapping text in classic mode, tried making custom class name for tab element and putting some custom CSS code in (I may of done it wrong).. I tried change your code to 100% to see what that did, lots of trial and error but nothing seems to change... I wonder what I am doing wrong, curious for your solution.. Thanks for any assistance if possible.

    https://soulascentials.com/product/4021/

  •  1,085
    ThemeNectar replied

    Hey Mark, glad to hearsmile.png

    1. You can adjust the icons sizing by using the following CSS rule:

    .tabbed[data-style*="material"] .wpb_tabs_nav li svg {
        width: 50px;
    }
    

    2. The font styling/sizing will inherit from the Salient options panel > Typography > General HTML elements tab via the "Form and Category Labels" field.

    Cheers

  •  13
    mark replied

    Hi Theme Nectar..,

    Amazing!!!!. I would never of guessed this solution.. Tested and Working perfectly. Question? Are the icon sizes responsive for page resizing (tablet mobile laptop). If not then this ticket can be closed. Either way very happy with this outcome. Thanks you so much.. I really appreciate it..

  •  1,085
    ThemeNectar replied

    Hey Mark, glad I could help!

    The size should currently remain consistent regardless of the viewport. However, you can add in another rule to set a size specific to mobile like so:

    @media only screen and (max-width: 1000px) {
      .tabbed[data-style*="material"] .wpb_tabs_nav li svg {
          width: 30px;
      }
    }