Heroku makes running tests and automated deployments very easy, and I thank them for that! However, there's been a long running issue of having to manually update your Typekit account with the domains of either pipeline stage apps or review apps to make custom fonts work.
While this isn't really a huge problem, when you're working on multiple features daily, it adds an additional overhead of logging into Typekit, whitelisting the domain, and waiting for it to propagate. Something which I'd had enough of.
I had a search around, and couldn't find anything which automatically allowed Typekit to wildcard the
*.herokuapp.com domain, only a few frustrated people, albeit a while ago now:
@typekit What's the recommendation for using Typekit with dynamic subdomains? I have a customer asking. Allow `static-*.herokuapp.com` ?— Jon McCartie (@jmccartie) November 4, 2015
So, I decided to learn a new technology, Python, and get into the depths of writing a buildpack. After an evening, I had a working buildpack, of which can be found here: https://github.com/jedkirby/heroku-buildpack-typekit.
As I know you all like videos, here's one that shows how smooth and simple it now is:
There's a full guide on the GitHub repository of what's needed to get the buildpack working, and if you run into any issues, feel free to give me a shout on Twitter.