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

Fix getHeadingFontSize types #279

Merged
merged 4 commits into from
Mar 4, 2021
Merged

Fix getHeadingFontSize types #279

merged 4 commits into from
Mar 4, 2021

Conversation

sarayourfriend
Copy link
Collaborator

Allows passing size="3" OR size={3}, following the ReactText convention.

@sarayourfriend sarayourfriend requested a review from ItsJonQ March 4, 2021 17:48
@vercel
Copy link

vercel bot commented Mar 4, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/itsjonq/g2/GKWCAKRdoYp3cg9pGhGExJuwCBg2
✅ Preview: https://g2-git-fix-getheadingfontsize-itsjonq.vercel.app

@ItsJonQ
Copy link
Owner

ItsJonQ commented Mar 4, 2021

Interesting! Check out the snapshot diff:

    -   font-size: calc(1 * 13px);
    -   font-size: calc(1 * var(--wp-g2-font-size));
    +   font-size: calc((13 / 13) * 13px);
    +   font-size: calc((13 / 13) * var(--wp-g2-font-size));

Mathematically, I think it's still the same :).
It looks like we'd be relying more on the CSS calc, which is fine :D

@sarayourfriend
Copy link
Collaborator Author

sarayourfriend commented Mar 4, 2021

@ItsJonQ Yeah, they're mathematically the same (it made it easier to write unit tests for 😁) I'll update those snapshots, whoops!

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

Successfully merging this pull request may close these issues.

2 participants