elm-designer
elm-designer copied to clipboard
Preserve font weight/italic styles when switching fonts
When switching fonts the weight of the new font should match, or be closer as possible, to the weight of the old one.
The typical use-case is the following:
- User sets some text using Work Sans Heavy Italic
- User later switches the font family to Helvetica
- Font weight abruptly change to Regular, which is the first available weight for Helvetica. Instead Elm Designer should land to the closer weight Helvetica has, that is bold, and keep the italicized text.
We can probably reuse the font-weight CSS mapping where Hairline is 100 and Heavy is 900 to figure out the best match we have available in the new font.
- [x] Fix weight on changing current node font family
- [x] Fix italic too
- [ ] Fix weight and italic styles on children of the changed node when their node is set to
Inherit