WIP: Scale generator does not respect 100% root size

The scale generator does not seem to be respecting a 100% root size default:

--text-m: clamp(1.6rem, calc(0.003703703703703703 * (100vw - 36rem) + 1.6rem), 2rem);

Hi Jamie,
Thanks so much for your report!

Unfortunately, I cannot reproduce the problem. Whenever you change the root font size, it’s currently required to regenerate the typography and spacing scales manually (by clicking generate variables in typography/spacing).

Best regards,
timmse

Hi @timmse

I hadn’t changed the sizes, I just upgraded from 2.1.4 and went to create a new scale and noticed that although my root font size was set to 100% and the “default” value in the scale settings appeared to be 100% also, that the resulting clamp scale had 1.6rem instead of 1rem for the base 16px size. If I manually change the scale settings and select 100% explicitly, it seems to work.

@timmse

Aaah, you’re coming from 2.1.4 :light_bulb: Unfortunately, that wasn’t clear from your report.

However, I can reproduce the problem. Apparently, it is necessary to set the root font size deliberately in the style manager, even though the placeholder shows the value from the theme styles (100%).

We will update this thread as soon as it is fixed.

Edit: After some trial and error, I can reproduce the problem even without updating – all in all, it’s confusing that the theme style HTML font size value is displayed as a placeholder in the style manager settings but is not used for calculations, unless explicitly set.

1 Like