Change font size for editor dynamically

I would like to change the font size for the whole editor dynamically, that is, once the editor is open.

This is because users may want to enlarge or decrease the font size depending on their screen resolution and eyes (I will put a slider control to increase / decrease the font size).

I know to change the font name, size and line height statically with the CSS :

.CodeMirror * { font-family: #{font_name} ; font-size: #{font_size}px ; line-height: #{line_height}px }```

However, my question is whether it is possible to do it **dynamically**.

Yes, use regular CSS techniques (for example the .style properties of the DOM, or dynamic style sheets), and make sure you call refresh() on the editor when you change something, so that it doesn’t use outdated layout caches.

This works fine with updating the CSS (and not need to call refresh()).

I was just wondering if there was a dedicated API for that.