Category: Code

  • Com.Google

    I made a dumb bookmarklet on April 1 and forgot to publish it.

    drag this to your bookmarks

    Better late than never, he lied.

  • Intuition is ?

    Complaining about WordPress 4.2’s inline Emoji script is to complain about the biggest front end performance gain of the feature.

    You see, that tiny script does two things:

    • check if your visitors browser supports Emoji, and,
    • asynchronously load the JavaScript to polyfill Emoji if the visitor’s browser requires it.

    (more…)

  • Body Class Control in WordPress

    I like a much reduced set of body classes when coding up a WordPress theme. Two template types, two main classes.

    Oh, and I put it on the HTML element too. To call my coding opinionated is somewhat of an understatement. (more…)

  • Media queries and calc

    calc isn’t a new feature, but at the time of writing MDN describes it as experimental:

    this technology’s specification has not stabilized, check the compatibility table for the proper prefixes to use in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers

    MDN

    According to caniuse.com, it’s a little safer than MDN suggests.

    (more…)

  • IE friendly console.log

    Internet Explorer makes me sad every time I open it to cross-browser test during development and it crashes on console.log. A simple check OR define option can kill console in the IE developer toolbar, so I decided to write a more robust cross-browser compatible console.log.

    (more…)

  • Vendor prefixes, polyfills and former clients

    Jeremy Keith’s recent post Polyfills and products asked an interesting question about handing polyfilled code to clients:

    [Short term client projects] makes it very tricky to include a polyfill in our deliverables. We’d need to figure out a way of also including a timeline for revisiting that polyfill and evaluating when it’s time to drop it.

    (more…)

  • Sass Media Query Mixins

    There are a few Sass media query mixins going around for dealing with old versions of IE. Often they include predefined break points, whereas I like the simplicity of passing a numeric value.

    Capable browsers wrap the content in a media query, incapable browsers get the unwrapped content. (more…)

  • Open site redesign using a pattern library

    As I’ve mentioned previously, I’m in the process of redesigning this web site. It’s very much a work in progress.

    Pattern Library

    As a first step I’m building a pattern library and I’ve decided to open source the repo during the build process. I’m using Pattern Lab for the purpose.

    (more…)