-
Notifications
You must be signed in to change notification settings - Fork 211
The calculation of the rem to px is bugged #27
Conversation
ParseInt should be done only on the rem string, not on the calculation. so 0.3rem * 12px = 3.6px, not 3, then the Math.round is useful...
@asakurayoh, thanks for this fix! We appreciate the help. |
The calculation of the rem to px is bugged
updating to this commit breaks things for me. anyone else having issues? |
@retlehs, can you give more info? Browser/version and any console errors? I tested this is both the included index and on a larger site without errors. |
IE8 (8.0.7601.17514) on Win 7 from modern.ie - no errors i can't provide a URL to the site i'm working on right now, but the updated script now makes the fonts even smaller (the version before this update had the fonts smaller than they should have been, but not this small) and in a couple spots where the font should be the smallest it's now completely gone - in the screenshot below, notice that the top right text in the header is missing along with the breadcrumb |
Hmm it sounds to me like there may be a problem with your base font size. Are you declaring a font value for your body element? If not, could you try setting Thanks, |
i'm setting the font-size on (also, using the latest version isn't a big deal to me since the previous one works good enough for my needs. was mainly curious about if anyone else had similar issues.. unfortunately i don't have a lot of time to spend debugging this right now) |
This pull request fix a mathematical problem. Should not cause other problem it was not having before. Are you using the minified version? maybe it is not well done... (chuckcarpenter should re-minify it with is tool). |
In case the minified code was the problem, as @asakurayoh suggested, I just regenerated the minified js using uglify and pushed it to the master branch. |
@retlehs, Thank you, |
This commit breaks rem sizes that are floats. |
@adamjacobbecker, I just saw your pull request and will merge it in ASAP. Do you think this could have been the source of @retlehs's problems? -Lucas |
Certainly was the source of mine. |
The parseInt was around all the calculation, not only around the rem string. That was causing bad calculation and the Math.round was pointless...