Jump to content

Need help fixing custom social icon to make it match the site styles

Recommended Posts

I used custom CSS injection to change the icon of a social link in my header. I am trying to now make this custom icon match the colour theme and follow the style settings I have for my header. I have attached screenshots so you can see what is going on and the following code is the code I have used for adding a custom icon for a social link in my header:

@media only screen and (min-width:640px) { 
  .header-actions-action--social .icon--fill:nth-of-type(2) {
    svg {
      display:none; 
    }    
    background-image: url(https://static1.squarespace.com/static/646c19ab135dd855c8022b8a/t/6578d70b2daae851a3f880a9/1702418187251/clouds_6563658.png);    
    background-size: 100%;    
    background-repeat: no-repeat;  
  } 
}  
.header-menu-actions-action:nth-of-type(2) {    
  svg { 
    display:none;
  }    
  background-image: url(https://static1.squarespace.com/static/646c19ab135dd855c8022b8a/t/6578d29bd0e5a30c450a750d/1702417051923/clouds_6563658.png);    
  background-size: 100%;    
  background-repeat: no-repeat;  
}

 

Thank you in advance for anyone able to help!

Screenshot 2023-12-12 171651.png

Screenshot 2023-12-12 171706.png

Screenshot 2023-12-12 171729.png

Screenshot 2023-12-12 171755.png

Screenshot 2023-12-12 171809.png

Link to comment
  • Replies 3
  • Views 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Hi,

You want

Change icon color on each page?

To do this, you will need to use different icon url on each page

for example, Contact Page, add this code to Contact Page Header Code Injection, replace Pixabay with new icon url

<style>
  header#header a.icon[href*="bsky.app"] {
    background-image: url(https://cdn.pixabay.com/photo/2023/06/01/05/58/ocean-8032698_1280.jpg);
}
</style>

image.thumb.png.d27e8cedf85592af5cd0d688f7cecc95.png

 

I use this code because it targets both mobile + desktop

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.