Is it normal practice to set CSS variables to calculations?
E.g.
:root {
--font-size-0: clamp(0px, calc(0.8*(1.0vmin+1.0vmax)), 24px);
}
?
When I do this, it seems to work in the client, but in the Designer it's extremely flakey. I'm using the variable within Perspective Styles with var(--font-size-2)
for example, and using the PStyles within component style.classes.
- If I change the PStyle to use another font size variable, the open View with the style applied will not change unless I close it and reopen it.
- If I have reponed the View and then modified the font size in the PStyle, it changes, but only the first time I change the PStyle. The second time it doesn't update.
- If I change the CSS variable, it won't update in the View at all unless I reopen the View.
@victordcq perhaps?
Is this something to do with when root variables are defined and updated?
Edit: This seems to be it. I've defined these within my adv. stylesheet for now (to later move into theme CSS files):
When I modify these and save, I notice in the dev tools in the designer, that these root variables just disappear altogether.
This seems like a bug?