What I can do for you

Having worked with the web for a number of years, I am well versed in modern web standards and development techniques. With the multitude of devices available to consumers these days, it is important that web sites and web applications not only look great on the desktop, but also on mobile devices such as smart phones and tablets. I specialise in making web sites not only deliver a great experience, but also ensure that they work on every type of device as if they were made to do so.

What you can expect

Intentionally working with one client at a time, you can expect full dedication to your project when we are working together. I am friendly, professional, and am always able to answer any queries within 24 hours.

Read more about working with me

The latest from my blog

  1. A mixin and SASS structure for simple media query support

    Comments Off

    It started with a bit of inspiration…

    Following both attendance of the excellant RWD summit and reading about the SASS media query mixin by Always Twisted, I decided to re-think my project SASS structure going forward. Check this baby out:


    @mixin media-query-bp($unit, $query1: min, $query2: width, $target: "") {
    // Check if breakpoints are in use
    $mqtarget: "";
    @if $media-queries-supported == true {
    @if $target != "" {
    @media #{$target} and (#{$query1}-#{$query2}: #{$unit}) {
    @content;
    }
    }
    @else {
    @media (#{$query1}-#{$query2}: #{$unit}) {
    @content;
    }
    }
    }
    @else {
    .no-mq {
    @content;
    }
    }
    }

    This modified version of the aforementioned media query mixin allows for an optional “target” to be set (screen, tv, handheld, etc). Default is assumed to be no target (same as writing “all”). This media query mixin can be called in the following way:


    @include media-query-bp(30em) {
    body {
    background-color: #fff;
    }
    }

    This results in the following:

    @media (min-width: 30em) {
    body {
    background-color: #fff;
    }
    }

    OR the following:

    .no-mq
    {
    body {
    background-color: #fff;
    }
    }

    What is $media-queries-supported all about?

    Put simply, it is a variable set before the mixins are imported to denote whether media queries should be output or not. By using this simple variable defined once in each of “mq.scss” and “no-mq.scss”, whenever the mixin is called, differing output can be generated to each of the resulting “mq.css” and “no-mq.css”, meaning we can target browsers that do not support media queries effectively, without all of the media query CSS being loaded first (which won’t even be used. What a waste of bandwidth, time and most likely, someones data allowance!)

    Additional arguments to the mixin

    The media query mixin may be called with additional (although totally optional) arguments. These are:

    • $query1 : First part of a parameter declaration (as in the “min” part of min-width). “min” is assumed to be the default and will be used should no value be specified.
    • $query2 : Second part of a parameter (as in the “width” part of min-width). “min” is assumed to be the default and will be used should no value be specified.
    • $target : Device to target, such as “handheld”. “All” is assumed should nothing be specified (this results in no output, as “all” and no device are assumed to be the same thing according to the spec).

    Additional usage example


    @include media-query-bp(420px, max, height, screen) {
    body {
    background-color: #fff;
    }
    }

    This results in the following:


    @media screen and (max-height: 420px) {
    body {
    background-color: #fff;
    }
    }

    Organising your SASS files for minimal maintenance

     

    Next up is a way to arrange SASS project files to minimise the amount of maintenance needed as time moves on. By importing all of your SASS using an “_import.scss partial”, we can create two top-level SASS project files, namely “mq.scss” and “no-mq.scss”. Both files contain two lines, as per the examples below:

    mq.scss:


    $media-queries-supported: true;
    @import "imports";

    no-mq.scss:


    $media-queries-supported: true;
    @import "imports";

    _imports.scss looks like so:


    // Import variables
    @import "variables";
    // Import mixins
    @import "partials/mixins";
    // Import reset:
    @import "partials/reset";
    // Import everything else
    @import "partials/typography";
    @import "partials/colour";
    @import "partials/layout";

    Lastly, using IE conditional comments, we can add a “no-mq” class on our html element like so:


    <!--[if lt IE 9]><!--><html class="no-mq" lang="en"><!--<![endif]-->

    Additional tip to save bandwidth

    Using a slightly different conditional comment hack as above, we can ensure that we only serve one stylesheet depending on the version of IE, again utilising IE conditional comments:


    <!--[if lt IE 9]> <link rel="stylesheet" href="css/no-mq.css"><![endif]-->
    <!--[if gte IE 9]><!--><link rel="stylesheet" href="css/mq.css" /><!--<![endif]-->

    The first line will only ever be interpreted by IE 8 and below. The second line will be interpreted by IE9 and every other browser. Sure, it’s a conditional comment hack, but surely one less HTTP request in today’s device-agnostic web can only be a good thing?

  2. Automation with Grunt

    Comments Off

    This week I’ve been getting into a fantastic automation tool called Grunt. As a front-end developer, I often have to perform a number of tasks around my normal workflow, usually falling in to the areas of code quality and performance. Using grunt to automate these tasks has been fantastic.

    What is Grunt?

    Put simply, Grunt is a JavaScript task runner. It uses JavaScript for task configuration, and once a task is written, it can simply be called on the command-line or automated as part of a continuous integration system such as Jenkins for build and test automation.

    How to get started with Grunt

    Grunt uses node.js, with all packages available via npm. Therefore the first task is to install node.js, available from http://www.nodejs.org

    Next up, open a command window, navigate to where you’d like to run Grunt from (typically a project directory) and type the following to install Grunt:
    npm install grunt
    Next up, we need to configure two files: package.json and Gruntfile.js

    Open your preferred text editor and type the following:
    {
    "name": "wluk-ui",
    "version": "0.1.0"
    }

    Save this file as “package.json” in the directory from which you ran the Grunt install command earlier. Next up, we have to create the Grunt configuration file. Create a new file in your preferred text editor and put in the following contents:
    module.exports = function(grunt) {
    grunt.initConfig({
    // Project settings
    pkg: grunt.file.readJSON("package.json"),
    });
    };

    Save this file as “Gruntfile.js” in the same directory as package.json created earlier. Once that’s done, we’re ready to configure our first Grunt task. For the purposes of this example, we’ll set up CSS linting.

    Install the CSS Lint Grunt package using your command window from earlier. Type the following to install the csslint package:
    npm install grunt-contrib-csslint --save-dev
    This installs the CSS Lint Grunt plugin and also updates the package.json file to account for this dependency. The final part of Grunt task configuration is to put an entry for this task in to the Grunt file. Open “Gruntfile.js” in your preferred text editor, and insert the following code after the line containing “readJSON”:
    // CSSLint. Tests CSS code quality
    // https://github.com/gruntjs/grunt-contrib-csslint
    csslint: {
    // define the files to lint
    files: ["css\\**\\*.css"],
    strict: {
    options: {
    "import": 2
    }
    }
    }

    Next, we have to instruct Grunt to load the plugin, which involves adding the following line of code to the end fo the file, just before the closing brace (i.e. add this to the second from last line of Gruntfile.js):
    grunt.loadNpmTasks("grunt-contrib-csslint");
    Gruntfile.js should now look like so:
    module.exports = function(grunt) {
    grunt.initConfig({
    // Project settings
    pkg: grunt.file.readJSON("package.json"),
    // CSSLint. Tests CSS code quality
    // https://github.com/gruntjs/grunt-contrib-csslint
    csslint: {
    // define the files to lint
    files: ["css\\**\\*.css"],
    strict: {
    options: {
    "import": 2
    }
    }
    }
    });
    grunt.loadNpmTasks("grunt-contrib-csslint");
    };

    Finally, we can run our Grunt task to lint our CSS files, like so in a command window:
    grunt csslint
    This will lint all CSS files within the “css” and all sub-directories of the “css” directory. More information can be found on the CSS Lint plugin at https://github.com/gruntjs/grunt-contrib-csslint

    With CSS Linting sorted, I encourage you to explore the Grunt plugins directory and get cracking with your own automated workflow and enhance your productivity!

  3. Presenting the new aaronallport.com

    Comments Off

    After a few weeks of development, I present the new aaronallport.com

    Developed as a mobile-first, responsive WordPress theme, I have tried to put more on an emphasis on content, deliberately opting for a stripped-back, useable look. The end result means few menu items, and less clicks to get to each part of the site.

    I’ve been able to use SASS in anger, along with coding native JavaScript again (no jQuery to be found here). This has been awesome as the JavaScript is actually the smallest site artefact to load!

    I intend on putting the theme (with a basic SCSS and JavaScript library on top) up on GitHub in order to give back to the community a little. More on that in a couple of weeks.

    If there any teething issues found with the site then please drop me an email or send me a message on twitter.

About me

I am a friendly, approachable web developer specialising in the front-end aspects of web sites and applications. HTML, CSS and JavaScript are the tools of my trade. I am familiar with responsive design techniques, approaching all projects with a mobile-first view, ensuring that what I produce will look great regardless of the type of device it is being viewed on. I keep up-to-date on the latest developments within HTML, CSS and JavaScript, taking new ways of working and the use of frameworks into my development repotoire.

Read more about about me

Get in touch

Whether it is to enquire about my services or just to say "hello", I would love to hear from you. I can be contacted by emailing me.

Alternatively, I can be found on these other services: