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:
.class-name-a .class-name-b > span
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 for span
.
:root {
--css-token-right-statement-border-left: 100px dashed;
--css-token-right-statement-spacing: 100px;
}
.class-name-a .class-name-b > span {
margin-left: var(--css-token-right-statement-spacing);
padding-left: var(--css-token-right-statement-spacing);
color: darkorange;
background-color: aliceblue;
border-left: var(--css-token-right-statement-border-left);
}
.class-name-a .class-name-b > span {
margin-left: 1em;
padding-left: 1em;
color: red;
background-color: yellow;
border-left: 1em double;
}
span {
margin-left: 500px;
padding-left: 500px;
color: blue;
background-color: black;
border: 2px solid;
border-left: 500px solid;
}
<div class="class-name-a">
<p class="class-name-b">
<span>StackOverflow</span>
</p>
</div>