I’ve run into an issue using the code snippet.
I used a template I modified for all the products. I thought by putting a CCS block in the main template would allow me to edit the individual page links. But it’s not letting me do that. Any change I make to the code ( in either the main template or itsindividual pages) changes them all. What am i doing wrong?
I found a script mod for a custom button:
{% comment %}
{% endcomment %}
{% style %}
.onhow-custom-btn {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
margin: 0;
padding: 14px 24px;
color: #ffffff; /* CHANGE: Button text color /
background: #205ec9; / CHANGE: Button background color /
font-weight: 500;
text-decoration: none;
border-radius: 4px;
transition: all 0.3s ease;
border: 2px solid #205ec9; / CHANGE: Button border color (match background) */
font-family: var(–font-body-family);
font-size: var(–font-body-size);
text-transform: uppercase;
letter-spacing: 0.5px;
}
.onhow-custom-btn:hover {
background: transparent; /* CHANGE: Hover background (transparent or new color) /
color: #205ec9; / CHANGE: Hover text color (usually matches original background) /
transform: translateY(-2px);
box-shadow: 0 8px 20px rgba(32, 94, 201, 0.3); / CHANGE: Hover shadow color (R, G, B, opacity) */
}
.onhow-custom-btn:active {
transform: translateY(0);
box-shadow: 0 4px 10px rgba(32, 94, 201, 0.2); /* CHANGE: Active shadow color (same RGB as hover, lower opacity) */
}
.onhow-custom-btn:focus {
outline: 2px solid #205ec9; /* CHANGE: Focus outline color (accessibility) */
outline-offset: 2px;
}
.product__info-container .product-form {
margin: 0;
}
@media screen and (max-width: 749px) {
.onhow-custom-btn {
padding: 12px 20px;
font-size: 14px;
}
}
{% endstyle %}
I modified the “parent” template and the button does show up but when I try to edit the individual “child” pages with a different link it changes all of them.