You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Todays solution is a bit brittle since Figma needs to mimic "em/rem" functionality which means its formula for typography based sizing needs to support this.
This does not translate 1:1 to code which means we need to mutate the formula during build for it to work as a CSS variable and media-query.
For example;
The formula must start with floor(, we replace variable size.mode-font-size and interpolate em unit support.
The outputted formula is also a bit more complex than it needs to be if we wrote it by hand.
We only pick the medium size design-token, and ignore the other sizing modes needed in Figma.
A side-effect of this is that if end users want to change the formula, the build might break or translate wrong.
Figure out if there is a better way to handle this or if we should solve this in a different way.
Notes
One option would be to ignore the size formula from design-tokens and use a predefined value format in our build script. The sizing design-tokens are just used as a schema for variables.
Better warnings or/and document that this can not or should not be changed
The text was updated successfully, but these errors were encountered:
mimarz
added
$ tokens
Everything related to tokens and Work related to @digdir/designsystemet-theme
cli
@digdir/designsystemet
labels
Dec 20, 2024
Todays solution is a bit brittle since Figma needs to mimic "em/rem" functionality which means its formula for typography based sizing needs to support this.
This does not translate 1:1 to code which means we need to mutate the formula during build for it to work as a CSS variable and media-query.
For example;
floor(
, we replace variablesize.mode-font-size
and interpolateem
unit support.medium
size design-token, and ignore the other sizing modes needed in Figma.A side-effect of this is that if end users want to change the formula, the build might break or translate wrong.
Given design-token
is transformed into
ideally we would want it to be
Figure out if there is a better way to handle this or if we should solve this in a different way.
Notes
The text was updated successfully, but these errors were encountered: