How to setup different rem base unit size for different frame width?

Hey, I’ve been looking for the way to change rem base unit size depending on a frame(screen) width. Currently if I change the base unit size for 1 frame, it becomes active for all the frames in the file, which breaks the point of using rem (if you design responsive interfaces)

Is there anyway to define base unit size based on breakpoints?

You can use variables for this, and create multiple modes for each base unit size, then set the correspondent mode to each frame which has different breakpoints,

By that, the variables inside that frame will respect their mode.

Sorry I can’t make it work. So I created a variable (type “number”) with modes

But when I try to select it for a text layer, it changes text content, not the font size

So “mode 2” is 14, but instead of applying it to font size, it just replaced the text of the layer