-
Notifications
You must be signed in to change notification settings - Fork 206
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
Why use unitless line heights? #157
Comments
Actually, you do make a strong case for using rem when sitting on a baseline grid. It's also a simpler calculation. The only issue I see is the need for a fallback for IE<9, in px (easy enough, but requires more output code) or unitless (which would mean we still need that same calculation AND more output code). Knowing this, and keeping in mind that, when we do the correct calculation and set the value consistently as we do with the |
@herzinger Good answer! Nothing to add. @nicoqh Does this answer your question? |
It seems to me that unitless line heights were added because of convention, and that IE<9 support was a side effect. If other parts of inuitcss adds IE<9 support behind a flag that can easily be removed when support is eventually dropped, I'd vote for doing this consistently. Also, rems result in the intended behavior when nesting font sizes, while line heights do not. That is my opinion, but I recognize the reluctance to add more code and/or output. It is easy to pull in another implementation that addresses the baseline. :) |
We removed the flag. Currently, every code always provides a fallback for IE<9.
Do you have an example? |
Your phrasing was a little odd, so I maybe I didn't get it right, but I think you are mixim it up. |
Think of |
I'm aware, and this behavior was the reason for my suggestion :)
With regards to my suggestion it matters because you can maintain the baseline without calculating unitless line heights for every child's font size. Illustration: http://codepen.io/anon/pen/GjYGAa However, you would need But @herzinger's point about IE8 may make it too cumbersome to implement, and it yields a bit more code. And as @csshugs pointed out, there are no IE<9 "flag" anymore, so my argument for keeping IE8 fallbacks inside the flag is mute :) |
Re-opening this issue from the old repository:
Inuit calculates unitless line heights in order to place elements on a baseline.
Unitless line heights are usually advocated so that children don't inherit a calculated value from their parent. By using a unitless value (e.g. 1.5), a child will have a line height that is relative to its own font size and is therefore potentially different from its parent.
However, this is exactly what Inuit tries to avoid by calculating unitless line heights for every possible font size, all resulting in e.g. 1.5rem or a multiple thereof.
Why doesn't the
inuit-font-size()
mixin simply return (multiples of)$inuit-base-line-height
in rems? Children would then inherit the correct calculated value and keep the vertical rhythm. Or have I missed something?@csshugs pointed me to this article which states:
As noted above, this "arbitrary value" is not arbitrary in inuitcss' case -- it's the value we actually want.
The text was updated successfully, but these errors were encountered: