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

Calculation can be based on fontSize or capHeight #3

Closed
wants to merge 1 commit into from

Conversation

jesstelford
Copy link

Screen Shot 2020-07-08 at 8 33 56 pm

Using the default settings, with capHeight set to 32 produces:

{
  "fontSize": "45.010989010989015px",
  "lineHeight": "56px",
  "transform": "translateY(0.28027343749999994em)",
  "paddingTop": "0.05px",
  "marginTop": "-0.5332031249999999em"
}

Then changing to "Font Size" and setting it to 45 produces:

{
  "fontSize": "45px",
  "lineHeight": "55.9921875px",
  "transform": "translateY(0.28033854166666666em)",
  "paddingTop": "0.05px",
  "marginTop": "-0.5333333333333333em"
}

Motivation

I have a design I need to match the font size to, so need the calculation to be derived from those pixel sizes as a basis.

@jesstelford
Copy link
Author

Closing this for now - the experiment worked, but has some rough edges and quickly fell out of date with the main branch.

See #4 for keeping track of this idea.

@jesstelford jesstelford closed this Jul 9, 2020
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

1 participant