Ran
|
Files
2294
|
Run time
59s
|
Badge
Embed ▾
README BADGES
|
push
github
Fix font size in email post-bodies The underlying issue is that some (but not all) font-sizes are specified in `rem`, which is a unit which is a multiplier of the root-element's font size. On-site, that's theme.baseFontSize, which 13px and is the same across all site themes, so a size of 1.4rem, which is used for most post text, is 1.4*13px=18.2px. In email contexts, however, the root element isn't under our control, can vary between email clients, and in the case of gmail, is 16px, resulting in a post font size of 22.4px. This is too big, especially when juxtaposed with font sizes for post metadata that are specified in px. Until recently, most site styles weren't being used in emails, which prevented this from coming up. However commit d2b9840b1 made `NewPostEmail` use `ContentStyles`, introducing a bunch of theme styles that use `rem`. (This was done because posts can contain a lot of different sorts of elements that need styling, and this is the only way to reliably get all those styles). Change the units in all theme files to not use `rem`, using `px` instead. Since the base font size doesn't vary between site themes, this will only affect font sizes in emails, not on-site. It will make the font size consistent between email clients, and (where styles are shared) between email and web. This changes the effective post font size in gmail from 22.4px to 18.2px
3415 of 40344 branches covered (8.46%)
Branch coverage included in aggregate %.
15276 of 65007 relevant lines covered (23.5%)
165.26 hits per line
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
---|