Can you explain why applying styles with TailwindCSS v3 to calculations using JS variables does not work?
I'm working on a project using VueJS, and I've noticed that styling works fine when using calc as a string like this:
...
<div class="w-[calc((100%-12rem)*2/3)]">
...
However, it doesn't work when JS variables are involved, like in the following example:
...
<div :class="`w-[calc(${props.languages.length * 1.25 + 3}rem)]`">
...
Even though the console shows the correct HTML class being generated:
...
<div class="flex w-[calc(14.25rem)]"
...
... the styles are still not applied. Any suggestions? What am I missing here? It seems like a useful feature for dynamic styling based on data, but I just can't get it to work despite being so close.
Appreciate any help or insights.