This working on my actual shopify site. You are going to have to put this in your global.js file. I got the idea when I was changing the shopify forms CSS and making a javascript rule was the only way:
// Follow on Shop
document.addEventListener("DOMContentLoaded", function () {
const observer = new MutationObserver(() => {
const shopFollow = document.querySelector("shop-follow-button");
if (shopFollow && shopFollow.shadowRoot) {
const btn = shopFollow.shadowRoot.querySelector("button");
if (btn) {
// Insert
btn.style.backgroundColor = "#E72027"; //Button Color
btn.style.color = "#ffffff"; //Text Color
btn.style.borderRadius = "15px"; // Optional
// Change the inner div background to fit with button color
const innerDiv = btn.querySelector(".absolute.inset-y-0");
if (innerDiv) {
innerDiv.style.backgroundColor = "#E72027";
innerDiv.style.borderRadius = "15px";
}
observer.disconnect(); // Stop watching after change
}
}
});
observer.observe(document.body, { childList: true, subtree: true });
});