type-x icon indicating copy to clipboard operation
type-x copied to clipboard

variable fonts with weight axis shouldn't override page weights by default

Open thundernixon opened this issue 5 years ago • 2 comments

One of the big benefits of this tool is in allowing a variable font to apply to the existing font weights of a page. For instance, the GitHub UI has a nice mix of regular, semibold, and bold fonts. It's very useful to see how a variable font works with that, so that a type designer can understand whether their 700 really feels like a 700, whether their 600 feels like a 600, etc.

In the default setup, this can be achieved in a "dumb" way by adding font-weight: 100-900 to the inserted CSS in background.js:

image

(Interestingly, the actual wght range of the current Recursive betas is 300–1100, which doesn't align to the CSS, but it seems to work well enough, anyway... the published version of Recursive will be 300–900, if that's useful information).

I do realize that this feature may be contingent on setting up JS to detect a font's axes, etc. I just wanted to file an issue to say that this is more important than overall UI polish, as it's something I don't know how to approach myself but one of the most useful parts of the tool.

thundernixon avatar May 21 '19 14:05 thundernixon

The Recursive packed with the extension will work the same way as a custom font. So we could use the css field in recursive-fonts.js to add this specific line.

If the user then wants to use a font with a different font-weight declaration, they can do it and not get Recursive's CSS hardcoded.

(NOTE: the current CSS would be added to the selectors, as in the screenshot above: font.css. We should introduce font.fontfacecss specifically for this situation!)

RoelN avatar May 21 '19 15:05 RoelN

We should introduce font.fontfacecss specifically for this situation

That's a solid idea!

I've added a font-face portion to the latest UI design mockups at https://github.com/kabisa/recursive-extension/issues/25.

thundernixon avatar May 24 '19 00:05 thundernixon