Jump to content

¿Customize tiktok icon in two versions depending on the background?

Recommended Posts

Site URL: https://www.horaciomarchand.com

Hello! I found a code to change the icon of a regular link for the tiktok symbol, now I want to change it to white when the background is dark (purple). Here is the code im using. Thanks in advanced for your help! 

.icon[aria-label="URL"] svg {
  visibility:hidden;
}
.icon[aria-label="URL"] {
background-image: url(https://static1.squarespace.com/static/5e39efbd7236283156444451/t/5fab162af50c1a71c9cb7043/1605047850479/tiktok_grandeicon.png);
    background-size: cover;
    background-repeat: no-repeat;
    transform:scale(1);
}

.sqs-svg-icon--wrapper.url div {
    visibility: hidden;
}
.sqs-svg-icon--wrapper.url {
    background-image: url(https://static1.squarespace.com/static/5e39efbd7236283156444451/t/5fab162af50c1a71c9cb7043/1605047850479/tiktok_grandeicon.png);
    background-size: cover;
    background-repeat: no-repeat;
}

Link to comment

Here is example on a specfic section, footer

section[data-section-id="5ea368d4695b01524ef6dd9d"] a[href*='tiktok'].url {
	    filter: brightness(0) invert(1);
}

image.png.851ef967334ee1d827a4835193a751f9.png

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio plugin
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 7 months later...

<a href="https://www.stzgists.com/today-tv-series/">TikTok</a> really took the world by storm all of a sudden they gain popularity overnight and till now <a href="https://www.stzgists.com/loki-tv-series-release-dates/">TikTok</a> is still going strong, all my children are on TikTok they even sleep and wake on this app the owners must be making a shit ton of money.

Link to comment
On 11/11/2020 at 1:16 AM, bangank36 said:

Here is example on a specfic section, footer


section[data-section-id="5ea368d4695b01524ef6dd9d"] a[href*='tiktok'].url {
	    filter: brightness(0) invert(1);
}

 

Assuming you're using 7.1, I would make a slight adjustment to this and use

.dark,.dark-bold,.black,.black-bold{
a[href*='tiktok'].url {
filter: brightness(0) invert(1);
}
}

This will then automatically apply the colour change so that when used on any dark section on the site, the icon will become white. Rather than needing to use multiple sectionids.

If my answers have helped you, please drop a like and mark my answer as best to help other users find solutions quickly. Some links may be affiliate/referral links.

You can also thank me by buying me a coffee .

Squarespace Tips & Tricks: @squareskills (Youtube 📺 Tutorials - Resource site coming soon)

Link to comment
10 hours ago, Kwamzilla said:

Assuming you're using 7.1, I would make a slight adjustment to this and use


.dark,.dark-bold,.black,.black-bold{
a[href*='tiktok'].url {
filter: brightness(0) invert(1);
}
}

This will then automatically apply the colour change so that when used on any dark section on the site, the icon will become white. Rather than needing to use multiple sectionids.

That brilliant

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Lightbox Studio plugin
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
On 6/19/2021 at 12:33 AM, bangank36 said:

That brilliant

Nah man, you came up with the solution, I was just supporting!

If my answers have helped you, please drop a like and mark my answer as best to help other users find solutions quickly. Some links may be affiliate/referral links.

You can also thank me by buying me a coffee .

Squarespace Tips & Tricks: @squareskills (Youtube 📺 Tutorials - Resource site coming soon)

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.