Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: size-adjust metric calculation #181

Merged
merged 7 commits into from
Jun 8, 2023
Merged

feat!: size-adjust metric calculation #181

merged 7 commits into from
Jun 8, 2023

Conversation

GitRowin
Copy link
Contributor

@GitRowin GitRowin commented May 5, 2023

No description provided.

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic work, thank you! ❤️

@danielroe danielroe changed the title Add size-adjust metric calculation feat!: size-adjust metric calculation Jun 8, 2023
@danielroe danielroe merged commit 4913379 into unjs:main Jun 8, 2023
3 checks passed
@AleksandrHovhannisyan
Copy link
Contributor

Hi, quick question: Was it intentional to remove the ability to specify multiple fallbacks? Prior to this commit, we could pass in fallbacks as an array, and the code mapped each one under the hood:

4913379#diff-9fda4173044ba9935eb8372745516c4f87b84c993369057f66546b231e2e7f78L60

With this PR, that was replaced with a single fallback.

Copy link
Member

Yes, this is because the size-adjust calculation has to be the ratio between two fonts. I'd be happy accepting an array again, though this would increase the amount of CSS generated.

@AleksandrHovhannisyan
Copy link
Contributor

Got it. Yeah, I think it would be nice for folks who specify a font stack with multiple fallbacks (e.g., capsize has a createFontStack utility that accepts multiple font metrics). But I can also see how this would be overkill.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants