We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
May 19, 2022 4:33 PM - edited May 19, 2022 4:34 PM
I have premade module where i need to change background gradient by content creator by targeting .classname__image::after element. i able to change element from " .classname__image" element but cannt target any pseduo element.
how can i creat multiple gradient color and content creator just click checkbox and color change.
.classname__image {
text-align: right;
}
.classname__image::after {
background:linear-gradient(256.1deg,rgba(56,158,60,.76) 15.56%,rgba(38,91,55,.79) 78.17%);
}
Solved! Go to Solution.
May 20, 2022 11:24 AM
Hi @SH82,
have you tried it like this
.classname__image:after { {# just one colon instead of two #}
background:linear-gradient(256.1deg,rgba(56,158,60,.76) 15.56%,rgba(38,91,55,.79) 78.17%);
}
For the second question: Are we talking about custom modules?
If so you could
- create different classes for each gradient like
.gradient1{
{# code for the first gradient #}
}
.gradient2{
{# code for the second gradient #}
}
.gradient3{
{# code for the third gradient #}
}
in a/your CSS file
- create a select option in the custom module and set the class names as the select value
- finaly place the code in the desired <div> like
<div class="some-class {{module.gradient_selector}}">
...
</div>
best,
Anton
![]() | Did my post help answer your query? Help the Community by marking it as a solution |
May 20, 2022 11:24 AM
Hi @SH82,
have you tried it like this
.classname__image:after { {# just one colon instead of two #}
background:linear-gradient(256.1deg,rgba(56,158,60,.76) 15.56%,rgba(38,91,55,.79) 78.17%);
}
For the second question: Are we talking about custom modules?
If so you could
- create different classes for each gradient like
.gradient1{
{# code for the first gradient #}
}
.gradient2{
{# code for the second gradient #}
}
.gradient3{
{# code for the third gradient #}
}
in a/your CSS file
- create a select option in the custom module and set the class names as the select value
- finaly place the code in the desired <div> like
<div class="some-class {{module.gradient_selector}}">
...
</div>
best,
Anton
![]() | Did my post help answer your query? Help the Community by marking it as a solution |
May 23, 2022 11:12 AM
Thanks for the in-depth reply and for the examples, @Anton 🙌 – Jaycee
May 20, 2022 11:17 AM