Killing the IE8 Hacks (Finally)

Killing the IE8 Hacks (Finally)

Tutorials browsers css internet explorer web development

So this week I finally did something I've been putting off for probably two years: I ripped every last IE8 hack out of my CSS. All the *zoom:1 clearfixes, the conditional comment stylesheets, the _property underscore hacks for IE6/7 that honestly should've died in like 2013. Gone. Deleted. My site.css file lost about 140 lines and I felt nothing but relief.

The reason I finally got around to it is that Microsoft officially stopped supporting IE8, IE9, and IE10 this week (January 12th, if you're keeping track, and that was also Patch Tuesday, so it lined up neatly). If you're still running one of those on Windows 7, 8, or 8.1, you're not getting security patches anymore unless you upgrade to IE11 or switch to Edge. For a lot of regular people this is a total non-event. For anyone who's been maintaining a website since the early 2010s, its a pretty big deal, because it means we finally, FINALLY have an excuse to stop coddling browsers that are half a decade old.

I want to be clear I'm not saying this to dunk on old browsers for fun (ok, maybe a little). I spent real hours of my life — hours I will never get back — making dropdown menus render correctly in IE8. Hours making PNG transparency work with that awful AlphaImageLoader filter. If you never had to write filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image.png', sizingMethod='scale') into a stylesheet with a straight face, count yourself lucky.

What I actually did today

I pulled up my analytics (just Google Analytics, nothing fancy) and looked at browser share for techpad over the last 90 days. IE8 was sitting at something like 0.4% of visits. IE9 was a bit higher, maybe 1.1%, mostly from what I'm guessing are corporate machines that some IT department hasn't gotten around to updating. Combined, old IE was under 2% of my traffic. That's a number I can live with breaking.

So the process was pretty simple:

  1. Search the CSS for any .ie8, .ie9, .lt-ie9 class hooks and just delete the rules under them.
  2. Pull the conditional comments (<!--[if lt IE 9]>) out of the header template entirely.
  3. Remove the html5shiv and respond.js polyfills I'd been loading for ancient IE, since I don't need HTML5 element or media query shims anymore.
  4. Test in whatever IE11 virtual machine I still have kicking around (thank you, Microsoft's old modern.ie VMs) just to make sure nothing exploded.

Nothing exploded. The site looks the same to basically everyone, loads a tiny bit faster because there's less CSS and fewer script requests, and my build process is simpler because I'm not maintaining a separate IE stylesheet anymore. It's a small thing but it felt disproportionately satisfying, like cleaning out a junk drawer.

The bigger picture here, if you write CSS or JS for a living or a hobby, is that this is basically your permission slip. If a client or a boss pushes back and says "well what about IE9 users," you now have an actual answer: Microsoft doesn't support it either, so from a security standpoint you shouldn't be running it, and we're not going to build workarounds for an unsupported browser. That's a much easier conversation than the one we've all had a hundred times about "well SOME of our users are still on it."

I know there's always going to be some enterprise environment stuck on ancient IE because of some internal tool that only works in it (I worked somewhere like that once, it was miserable, don't ask). Those places aren't upgrading regardless of what Microsoft says on a blog post. But for the rest of us building normal public-facing sites, this is the moment to go back through old projects and start pulling hacks out, the same way I did with techpad tonight.

Also, small aside, completely unrelated: I've been using Sublime Text 3 for about a year now instead of Sublime 2 and I still haven't paid for the license, because the "unregistered" nag popup is genuinely not annoying enough to make me do it. Sorry, Jon Skinner. Someday.

Anyway. If you've got a codebase full of old IE hacks sitting around, this week's as good an excuse as any to go clean house.