HTML:
<div class="card"></div>
Scss
.card{
&:before {
content: 'Text inserted before via CSS';
}
}
This adds content before the div. but how can i add the content from SCSS.
This was not working
.card{ content: 'Text inserted via CSS'; }

card{ content: 'Text inserted via CSS'; }this code won't work, you need to add &:before then content property:beforeand:afterworks fine. but I want to update only the content. Any work arounds in cssdata-text="custom text"then in content you can use it like thiscontent: attr(data-text). But note here also you will have to use before or after.