I have some CSS for the span tag. All of these are rendered inside the shadow-root. Which looks like the following.
.class-name-a .class-name-b > span {
border-left: var(--css-token-right-statement-border-left);
font-family: GilroySemiBold;
font-size: 16px;
margin-left: var(--css-token-right-statement-spacing);
order: 3;
padding-left: var(--css-token-right-statement-spacing);}
How can we override the CSS for this span tag?
2
Answers
try using !important
example
Your question is unclear. I think you are asking how to write another declaration block that would override the declaration block that you included in your question.
In order to do so, you’ll need to match or increase the specificity of the selector. This is easily done by using the same selector:
Related info: Cascade, specificity, and inheritance
This example snippet shows the second declaration block for
span
overrides the same property values that are declared in the first and third declaration blocks forspan
.