0
I need to change the color of a pseudo element, according to some conditions. To simplify, I did first without any condition, just want to change the color through the v-bind
I have a pseudo CSS element:
.status span:before {
content: '';
width: 25px;
height: 25px;
border-radius: 25px;
border: 4px solid #3e70ff;
position: absolute;
top: -15px;
background-color: #c1c1c1;
left: 42%;
transition: all 200ms ease-in;
}
In HTML I’m doing like this:
div v-bind:class="'span:before'" v-bind:style="{ color: 'red' }"></div>
However, I could not change the color of the pseudo element. How can I do?
I don’t understand Vue, but I assume that pseudo-elements are only changeable in the CSS itself. That’s because they don’t exist in the DOM, so they are pseudo-elements.
– Sam