Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

The calculation of the rem to px is bugged #27

Merged
merged 2 commits into from
Aug 30, 2013
Merged

The calculation of the rem to px is bugged #27

merged 2 commits into from
Aug 30, 2013

Conversation

asakurayoh
Copy link
Contributor

The parseInt was around all the calculation, not only around the rem string. That was causing bad calculation and the Math.round was pointless...

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...
@chuckcarpenter
Copy link
Owner

@asakurayoh, thanks for this fix! We appreciate the help.

chuckcarpenter added a commit that referenced this pull request Aug 30, 2013
The calculation of the rem to px is bugged
@chuckcarpenter chuckcarpenter merged commit a958efc into chuckcarpenter:master Aug 30, 2013
@retlehs
Copy link

retlehs commented Sep 10, 2013

updating to this commit breaks things for me. anyone else having issues?

@chuckcarpenter
Copy link
Owner

@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.

@retlehs
Copy link

retlehs commented Sep 10, 2013

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

rem issues

@lsvx
Copy link
Collaborator

lsvx commented Sep 10, 2013

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 font-size: 16px for the body? This may help us debug the situation.

Thanks,
Lucas

@retlehs
Copy link

retlehs commented Sep 10, 2013

i'm setting the font-size on html and body has font-size: inherit - tried applying the font-size to body as well and it had no affect

(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)

@asakurayoh
Copy link
Contributor Author

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).

@lsvx
Copy link
Collaborator

lsvx commented Sep 10, 2013

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.

@lsvx
Copy link
Collaborator

lsvx commented Sep 10, 2013

@retlehs,
Thanks for giving that body font-size change a shot. Given that you are not getting any errors in the console, if you have time it would help us figure out what is going on if you could post some of the affected CSS, both before and after processing, to this thread.

Thank you,
Lucas

@ajb
Copy link
Contributor

ajb commented Oct 20, 2013

This commit breaks rem sizes that are floats.

@lsvx
Copy link
Collaborator

lsvx commented Oct 20, 2013

@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

@ajb
Copy link
Contributor

ajb commented Oct 20, 2013

Certainly was the source of mine.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants