Docs: Text in code snippets is tiny in Firefox #2977

Closed
rtorr opened this Issue Jan 29, 2015 · 8 comments

Projects

None yet

4 participants

@rtorr
rtorr commented Jan 29, 2015

Tested firefox 35/37

Left is chrome, right is firefox 35

screenshot 2015-01-29 09 31 45

@sedovsek
Contributor

Computed font-size of <code> element is:

  • 12.8px in Chrome and
  • 10.4px in Firefox.

It appears to me that Chrome somehow 'ignores' font-size of <code>'s first preceding element (<pre>), which has its font-size set to 13px, which would result in <code>'s computed font-size to be 10.4px, not 12.8px (resulting from 16*0.8).

@sedovsek
Contributor

It's rather odd… here's the video recording: http://recordit.co/0AYbaF6WCa
Although computed value is 13px, it has zero effect on typography of its child elements, unless you manually set the font-size to 13px.

I wish someone could explain this.

@zpao
Member
zpao commented Jan 30, 2015

So Firefox is right and Chrome is wrong?

Feel free to fix (either way) with hacky CSS if you want!

@sedovsek
Contributor

@zpao That would be my guess, yes.
I'll take another look today, it was way past midnight last night, so I may have missed something. Either way, I'l like to get to the bottom of this issue and report a bug to Chrome if necessary.

@sedovsek
Contributor

@zpao, hey. PR is here: #2999
I found quite some interesting discrepancies on how browsers render <code>'s font-size. I wrote a short articles to summarise my findings.

@rtorr
rtorr commented Feb 1, 2015

@sedovsek interesting. I had no idea this would be a rabbit hole of information. I had no time when I reported this to dig deeper. Good work!

@zpao
Member
zpao commented Feb 2, 2015

PR is in, this will be all fine the next time we generate the website. Thanks again!

@zpao zpao closed this Feb 2, 2015
@sedovsek
Contributor
sedovsek commented Feb 2, 2015

@zpao My pleasure. I have never learned so much from a trivial bug. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment