Cover is built on top of the Underscores starter theme. When I first created it, I had yet to get into Sass or any of that pre- or post-processor nonsense. Everything was inside style.css. If you check out _s on Github, you’ll find that they, too, have made the switch to Sass. Well, that was then, and this is now.
I first created Cover and made its first commit back in January 2014. When I did so, Underscores was still using a CSS reset at its base (as opposed to a normalize, which is more in line with industry standard now), and, among other things, used the famous 62.5% font size on html.
The purpose of this was to correct a text resizing bug in IE7/8 (which we no longer care about, especially since Windows XP support is no more) when em units are used. (Well la-dee-da, I use rem with a fallback to px anyway.)
It’s an antipattern, though: going from a problem to a bad solution. It changes the default font size to 10px instead of the default 16px, and as I would find, that can cause problems.
In December 2014, a commit to Underscores removed the antipattern. In the back of my mind, I had meant to fix it in Cover, too, but it seemed like it worked fine leaving it alone, so I let it be.
Fast forward to now: Cover has been released to the Internet, and while I have no delusions of popularity, it is used in the wild. One user wrote to me, informing me that it occasionally conflicted with plugins, and the result was a larger (much larger) font size than was appropriate.
It was easy enough to deduce the cause, and it gave me a reason to finally fix it. The solution, as it turned out, was actually pretty easy. It was certainly easier since I’m using Sass to build the final stylesheet.
After removing that one line from the html declaration in the reset, I only had one place to change: the rem() mixin.
When I converted Cover’s CSS to Sass, I converted all font-size properties to mixin calls. The mixin, as it existed, took the base font size (10 pixels, per the 62.5% reset), and output a rem value with a fallback to px.
The resulting CSS is vastly different, as you can see:
That doesn’t look so bad, though… but what about a little more custom font sizes? Let’s take a look at the post title font size declaration:
Yeah, there we go. There’s nothing that tells the human eye that those two declarations are the same size, but they are. But that’s okay, because the line in Sass that generates the CSS is still perfectly readable: