So I just learned that my example above is doing it the hard way, when I learned about the unique length units available to container queries (CSS container queries - CSS | MDN). I updated that project I made for you yesterday to demonstrate:
TEST_2025-06-19_0914.zip (46.5 KB)
The CSS is much simpler:
.psc-LabelContainer {
container-type: size;
container-name: card;
font-family: Arial;
}
@container card (width >= 0px) and (height >= 0px) {
.psc-Label { font-size: min(15cqw, 22cqh); }
}