-
Notifications
You must be signed in to change notification settings - Fork 8
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
Suggestion: wouldn't be better for line-height to be proportional of font-size? #14
Comments
Hi Yanina, that's a good point! What do you suggest? Instead we could do something like
This way, we keep a relative line-height of 1.2 * fontSize ? |
@Syridiana Thanks for opening the topic! I think it will be an excellent example to contribute to the temple. I hope to see the PR soon! 👀 |
I think we can have a default value, like and then
And being able to pass an argument to override it. BUT looking at the signature of fitText function I noticed that is required to include the rest parameter at the end I don't know if there is an easier workaround. |
I think we shouldn't be setting the line-height in javascript. This should be grabbed from the parent element in the CSS what the default is and where it needs to play with. So, if in a project a lineheight of an element is 0.8, it should stay 0.8 since that is belonging to the style, the ratio should by default stay the same as defined in your css since that is part of the looks of it. If some fonts are getting to crippled up together when they are getting smaller, with small lineheights, maybe we should be able to set a minimal line-height for each fitText element instead. With that, you have control on when it needs to stop making the line-height smaller, but still making the font size smaller. This would be element specific, and therefore requires a breaking change for fittext as far as I can see. We can do something like: |
display-temple/src/util/fitText.js
Lines 76 to 79 in 9cf05ee
As it is now the smaller the font-size the relation between font-size and line-height changes.
As far as I know, is usually a proportional value, like 1.2 of font-size (I believe that is the "auto" value in Photoshop).
Also, it would be nice being able to change that ratio through a parameter passed at the call of the function.
The text was updated successfully, but these errors were encountered: