-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
Unitless Line-height Issues #81
Comments
@yulianglukhenko check out the strip units function in bourbon: https://github.com/thoughtbot/bourbon/blob/master/app/assets/stylesheets/functions/_strip-units.scss and more importantly this thread in stack overflow: http://stackoverflow.com/questions/12328259/how-do-you-strip-the-unit-from-any-number-in-sass
So
|
I've tested this numerous times and it works for me; however, you can strip the units however is best for you. That's not the real issue here. The real issue is the fact that the math is wrong. This: |
@yulianglukhenko Except the |
Damn.. that's my issue. Completely forgot that base-font-size is 1em out of the box. Thanks for the explanation and sorry for the hassle. |
@yulianglukhenko No problem. You've pointed out an issue with some of those variables which is a good thing. There is a long discussion on It is probably going to change. Is there a reason that you aren't using ems? Or event the |
I usually do for simple websites. However, the web app I'm currently working on was designed by a print designer and has a lot of weirdly positioned elements that need to have strict font-sizes. Since this will be a responsive app, the decision was made to go with |
Good day!
It's been a long day, so please excuse me if I'm spacing out on this one.
Use this snippet as reference:
There are a couple issues that I'm seeing with this line:
$unitless-line-height: $base-line-height / ($base-line-height * 0 + 1);
Wouldn't
($base-line-height * 0 + 1)
, just equal1
? You're basically, just stripping$base-line-height
of its units and setting that, which introduces the next issue:According to the Mozilla line-height summary, the "number value" is:
So, if we calculate
$unitless-line-height
, we would get28
. If28
is used as a line-height value without units, the resulting line-height would be roughly448px
. This is wrong.I think this is what you guys were looking for:
This will result in
1.75
and strip the units while at it - which is what you want to use for unitless line-height.The text was updated successfully, but these errors were encountered: