I'm not sure if your comment above was mistyped,
"At first, I was trying to to just use a LESS variable for the sizing,
and then set it as the HTML content using the CSS content tag, but it
was working."
You state "but" after which I expected "it was [not] working" (otherwise, I would have expected you to say "and"). That was actually a solution I thought of, but if I am correct, and it was not working for you, then my guess is you were using content incorrectly (directly on the span itself?). The content property is only valid on the ::before and ::after pseudo elements.
So this works like you originally intended (and no need for the span element at all):
LESS
@width: 80%;
.bar {
background: red;
width: @width;
}
.bar:before {
content: '@{width}';
}
CSS Output
.bar {
background: red;
width: 80%;
}
.bar:before {
content: '80%';
}
This will work fine for IE8 (you note supporting that in another comment). Assuming the 80% is not a necessary "content" value (that you want search engines picking up because it is critical data on the page), then using a pseudo element is perfectly fine for such visual user feedback. If you desire, it can be aligned just as regular text and some padding added to space it from the surrounding text, just like it were a span element.
Blah hahahah? Then you end up withwidth: Blah hahaha(i.ewidth: auto).