Currently developing a custom theme for a website and faced with the restriction of not being able to use Javascript. My goal is to translate certain numbers into Roman numerals.
I attempted the following:
.score:before {
counter-reset: mycounter attr(score number, 0);
content: counter(mycounter, upper-roman) " ";
}
<p><span class="score" score="11">points</span></p>
Unfortunately, it appears that "attr(score number, 0)" always evaluates to 0. This issue persists even when I change the fallback number to 42 - the result remains at 0. The problem doesn't seem to be elsewhere in the code, as it functions correctly when I replace attr(...)
with a hardcoded number like 42.
Why does this code fail to display the expected outcome?