<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>simonsmith.io</title>
	<atom:link href="http://simonsmith.io/feed/" rel="self" type="application/rss+xml" />
	<link>http://simonsmith.io</link>
	<description>Portfolio and blog of a London based front-end web developer</description>
	<lastBuildDate>Wed, 27 Feb 2013 23:09:47 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Controlling CSS rems with Sass and LESS (sort of)</title>
		<link>http://simonsmith.io/controlling-css-rems-with-sass-and-less/</link>
		<comments>http://simonsmith.io/controlling-css-rems-with-sass-and-less/#comments</comments>
		<pubDate>Tue, 19 Feb 2013 20:11:05 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[LESS]]></category>
		<category><![CDATA[rems]]></category>
		<category><![CDATA[Responsive Design]]></category>
		<category><![CDATA[Sass]]></category>

		<guid isPermaLink="false">http://simonsmith.io/?p=486</guid>
		<description><![CDATA[Everyone knows that ems are great for responsive design. All that relative sizing juiciness goes hand in with flexible layouts but some of the annoyances make reaching for pixels the more favourable option. My two main gripes with ems They inherit parent em sizing and make calculating the resulting size a pain...]]></description>
				<content:encoded><![CDATA[<p>Everyone knows that <code>ems</code> are great for responsive design. All that relative sizing juiciness goes hand in with flexible layouts but some of the annoyances make reaching for pixels the more favourable option.</p>
<h2>My two main gripes with ems</h2>
<ol>
<li><span style="line-height: 13px;">They inherit parent <code>em</code> sizing and make calculating the resulting size a pain</span></li>
<li>It can be tough to work out what <code>14px</code> is equal to in <code>ems</code></li>
</ol>
<p>Fortunately, these are both easily fixed.</p>
<h2>Use rems</h2>
<p>Basically <code>rems</code> are the same as <code>ems</code> but are all calculated from the root (<code>html</code>) element. That means any level of nesting and parent <code>em</code> values won&#8217;t get in the way. Just set <code>1rem</code> (for example) on the <code>html</code> element and you&#8217;re done. <a href="http://caniuse.com/#search=rem">Browser support has been the main factor in holding back <code>rem</code> adoption</a> (Hi, IE8) but <a href="https://github.com/chuckcarpenter/REM-unit-polyfill">fortunately there are workarounds</a> if you don&#8217;t mind a minor JS hit.</p>
<h2>Converting pixels to rems</h2>
<p>Once you have an easy way to convert pixel values to <code>rems</code> then it&#8217;s a breeze to use them for paddings, margins etc and not just font sizes. In <a href="http://www.abookapart.com/products/responsive-web-design">Responsive Web Design</a>, Ethan Marcotte came up with a nice way to solve this:</p>
<blockquote><p><code>target ÷ context = result</code></p>
<p>So with our formula in hand, let’s turn back to that 24px headline. Assuming that our base font-size: 100% on the body element equates to 16px, we can plug those values directly into our formula. So if we need to express our h1’s target font size (24px) relative to its context (16px), we get:</p>
<p><code>24 ÷ 16 = 1.5</code></p>
<p>And there we are: 24px is 1.5 times greater than 16px, so our font-size is 1.5em</p></blockquote>
<p>With that in mind we can devise a simple Sass function to take care of this for us:</p>
<pre class="prettyprint linenums">@function px($num) {
    @return ($num / 16) + 0rem; // Adding 0rem here causes the output to be nrem instead of just n
}

.some-selector {
    font-size: px(26); // font-size: 1.625rem
    margin: px(18) px(18); // margin: 1.125rem 1.125rem
}</pre>
<p>The only thing we assume here is that the <code>html</code> element is set to <code>1rem</code> (equal to 16). This means if you bump your <code>html</code> to <code>1.2rem</code> then everything will scale up with it. This is great for smaller devices that need a little size boost as all your text, headings, buttons etc will remain in proportion. If you want to experiment with different base value settings then <a href="http://pxtoem.com/">I find this calculator helps</a>.</p>
<p>The other great way of controlling all your sizing via one function is that if you decide you need to switch over to pixels for some reason, then the <code>px()</code> function can simply be altered and the whole website receives an instant update. Easy.</p>
<h2>Sooo, how about LESS?</h2>
<p>As far as I know (and I&#8217;d love to be wrong) LESS does not support the kind of function syntax above. Therefore the only way I&#8217;ve managed to get it to work in the past is to list out all my variables by hand (into say <code>sizing-vars.less</code>) and use them that way. So something like:</p>
<pre class="prettyprint linenums">@unit-type: 0rem;
@base-font-size: 16;

// Rem conversions
// ---------------------------------------------------------------------------
@px1: (1 / @base-font-size) + @unit-type;
@px2: (2 / @base-font-size) + @unit-type;
@px3: (3 / @base-font-size) + @unit-type;
@px4: (4 / @base-font-size) + @unit-type;
@px5: (5 / @base-font-size) + @unit-type;
@px6: (6 / @base-font-size) + @unit-type;
// etc</pre>
<p>It&#8217;s not pretty, but it works. Being able to have a <code>px()</code> function is almost the main reason I&#8217;ve started to reach for Sass more often now.</p>
<p>Even if you don&#8217;t use <code>rems</code> right now, I&#8217;d still suggest using something like this so that when the time comes you can switch over painlessly.</p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://simonsmith.io/controlling-css-rems-with-sass-and-less/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Syncing MAMP databases with Dropbox</title>
		<link>http://simonsmith.io/syncing-mamp-databases-with-dropbox/</link>
		<comments>http://simonsmith.io/syncing-mamp-databases-with-dropbox/#comments</comments>
		<pubDate>Thu, 10 Jan 2013 16:45:08 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Dropbox]]></category>
		<category><![CDATA[MAMP]]></category>
		<category><![CDATA[Tip]]></category>

		<guid isPermaLink="false">http://simonsmith.io/?p=470</guid>
		<description><![CDATA[Just a simple tip on how to use a symlink to sync your MAMP databases into your Dropbox. This makes working on dynamic sites a breeze when moving between different computers. Move the current databases First thing to do is move your mysql folder into Dropbox. It can be found...]]></description>
				<content:encoded><![CDATA[<p>Just a simple tip on how to use a symlink to sync your MAMP databases into your Dropbox. This makes working on dynamic sites a breeze when moving between different computers.</p>
<h2>Move the current databases</h2>
<p>First thing to do is move your mysql folder into Dropbox. It can be found at <code>/Applications/MAMP/db/mysql</code> and for example&#8217;s sake we&#8217;ll move it to <code>~/Dropbox/mysql</code></p>
<h2>Create a symlink</h2>
<p>Once that&#8217;s done pop open Terminal (<a href="http://www.iterm2.com/">or iTerm 2 for extra winsauce</a>) and navigate to the db folder inside MAMP <code>/Applications/MAMP/db/</code>. From here run the following terminal command</p>
<pre class="prettyprint">ln -s ~/Dropbox/mysql mysql</pre>
<p>That will now create a symlink to your Dropbox and everytime you make a database change it will be automatically synced.</p>
<p>You can double check it was created successfully by running <code>ls -ll</code> in the same folder and you should see something like:</p>
<pre class="prettyprint">mysql -&gt; /Users/your.name/Dropbox/mysql/</pre>
<p>Simple</p>
]]></content:encoded>
			<wfw:commentRss>http://simonsmith.io/syncing-mamp-databases-with-dropbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Background Position: Shorthand Syntax</title>
		<link>http://simonsmith.io/background-position-shorthand-syntax/</link>
		<comments>http://simonsmith.io/background-position-shorthand-syntax/#comments</comments>
		<pubDate>Sun, 30 Dec 2012 01:49:21 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://simonsmith.io/?p=311</guid>
		<description><![CDATA[Whilst it&#8217;s easy to be swept up in the flashy world of animations and transitions, CSS3 also offers more subtle improvements to other parts of the specification. One of those is the background-position property, which now allows greater control over the offsets of an image. Considering the flexibility that the position...]]></description>
				<content:encoded><![CDATA[<p>Whilst it&#8217;s easy to be swept up in the flashy world of animations and transitions, CSS3 also offers more subtle improvements to other parts of the specification. One of those is the background-position property, which now allows greater control over the offsets of an image.</p>
<p>Considering the flexibility <a href="https://developer.mozilla.org/en/CSS/position">that the position property</a> affords us, it would make sense that the same rules apply to the <code>background-position</code> property. Sadly, this is not so.</p>
<h2>Top left</h2>
<p>Most developers will be familiar with setting the offsets of their background images from the <em>top left</em> of an element:</p>
<p style="text-align: center;"><img class="size-medium wp-image-312 aligncenter" title="bgp-100-50" alt="" src="http://simonsmith.io/wp-content/uploads/2012/08/bgp-100-50-300x216.png" width="300" height="216" /></p>
<pre class="prettyprint">background-position: 100% 50%;</pre>
<p style="text-align: center;"><img class="size-medium wp-image-313 aligncenter" title="bgp-10px-10px" alt="" src="http://simonsmith.io/wp-content/uploads/2012/08/bgp-10px-10px-300x216.jpg" width="300" height="216" /></p>
<pre class="prettyprint">background-position: 10px 10px;</pre>
<h2>Limitations</h2>
<p>But what happens when the design requires the image to remain 20px from the right side and 20px from the bottom? Not so simple when our positions are relative to the top left.</p>
<p>One approach requires upfront knowledge of the image dimensions and those of the element to which it is being applied:</p>
<p><img class="aligncenter size-medium wp-image-316" title="bgp-right-20px-bottom-20px" alt="" src="http://simonsmith.io/wp-content/uploads/2012/08/bgp-right-20px-bottom-20px-300x216.jpg" width="300" height="216" /></p>
<pre class="prettyprint">/*
  230px = (350px - 100px) - 20px
  130px = (250px - 100px) - 20px
*/
background-position: 230px 130px;</pre>
<p>This is a fairly hideous solution and makes assumptions that our element and image will never change width. And it requires me to do maths, which I never enjoy.</p>
<p>In today&#8217;s responsive world, this simply won&#8217;t fly. So what about percentage measurements? Again this requires more maths and more importantly, the spacing will vary on flexible elements:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-317" style="border: 0;" alt="flexible-fail" src="http://simonsmith.io/wp-content/uploads/2012/08/flexible-fail.jpg" width="500" height="459" /></p>
<pre class="prettyprint">background-position: 94% 87%;</pre>
<h2>Out with the old, in with the four</h2>
<p>The solution is also deliciously simple:</p>
<pre class="prettyprint">background-position: right 20px bottom 20px;</pre>
<p>Different values can be mixed, just as before:</p>
<pre class="prettyprint">background-position: right 1em bottom 50px;</pre>
<pre class="prettyprint">background-position: right 40% bottom 2em;</pre>
<p>Additionally three values can be used, providing the third is a keyword value:</p>
<pre class="prettyprint">background-position: right 1em center;</pre>
<h2>Browser support</h2>
<p>As you could have guessed, support for this syntax is a <em>bit</em> spotty.</p>
<p>Currently, you&#8217;ll find it in:</p>
<ul>
<li>Firefox 13+</li>
<li>Opera 10.5+</li>
<li>Internet Explorer 9.0+</li>
</ul>
<p>It&#8217;s surprising to see Webkit absent from that list, but <a href="https://bugs.webkit.org/show_bug.cgi?id=37514">a bug has been raised</a> and hopefully we can expect to see it soon.</p>
<p>However, don&#8217;t let this stop you using it now! If you make use of <a href="http://modernizr.com/">Modernizr</a> in your projects then <a href="https://github.com/Modernizr/Modernizr/blob/master/feature-detects/css-backgroundposition-shorthand.js">there is a feature detect</a> that can be easily dropped in.</p>
<p>One example is to simply provide a percentage-based fallback:</p>
<pre class="prettyprint">.element {
    background-position: right 1em center;
}

.no-bgpositionshorthand .element {
    background-position: 97% center;
}</pre>
<p>If you feel like moving the kitten background around yourself, then there is <a href="http://jsfiddle.net/Blink/jeYUK/">a demo available on jsfiddle</a>.</p>
<h2>That&#8217;s it</h2>
<p>A simple addition, I&#8217;m sure you&#8217;ll agree. But I&#8217;ve already found uses for it responsive layouts and hope you do too!</p>
<h2>Further reading</h2>
<ul>
<li><a href="https://developer.mozilla.org/en/CSS/background-position">Background position on the Mozilla Developer Network</a> - Includes a browser support table</li>
<li><a href="http://www.w3.org/TR/css3-background/#background-position">CSS3 background position specification</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://simonsmith.io/background-position-shorthand-syntax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing AMD compatible plugins for jQuery</title>
		<link>http://simonsmith.io/writing-amd-compatible-plugins-for-jquery/</link>
		<comments>http://simonsmith.io/writing-amd-compatible-plugins-for-jquery/#comments</comments>
		<pubDate>Fri, 21 Dec 2012 15:50:04 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[RequireJS]]></category>

		<guid isPermaLink="false">http://simonsmith.io/?p=375</guid>
		<description><![CDATA[I&#8217;ve been tinkering with jQuery a lot these days. My love for the Moo is still strong, but I like switching around from time to time. I also find myself using RequireJS for almost every project big or small and I decided to find a nice way to write jQuery...]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been tinkering with jQuery a lot these days. My love for <a href="http://mootools.net">the Moo</a> is still strong, but I like switching around from time to time. I also find myself using <a href="http://requirejs.org">RequireJS</a> for almost every project big or small and I decided to find a nice way to write jQuery plugins that work with AMD or without.</p>
<h2>Straight to the point</h2>
<p>The code doesn&#8217;t require a massive amount of explanation</p>
<pre class="prettyprint linenums">!function(global) {

    // Wrapper function that allows us to pass it to define later
    var wrap = function($) {

        // Standard JS object stuff
        var Foo = function(element, options) {
            this.options = options;
            this.element = element;
        };

        Foo.prototype = {

        };

        // Here is the actual jQuery plugin part. It just creates a new Foo object
        // for each matched element in the jQuery object.
        $.fn.foo = function(options) {
            options = $.extend({}, $.fn.foo.defaults, options);
            return this.each(function() {
                new Foo($(this), options);
            });
        };

        // Plugin defaults
        $.fn.foo.defaults = {
            'default': 'yeah',
            'test': 'simon'
        };
    };

    // Check for the presence of an AMD loader and if so pass 
    // the wrap function to define. We can safely assume 'jquery' 
    // is the module name as it is a named module already - http://goo.gl/PWyOV
    if (typeof define === 'function' &amp;&amp; define.amd) {
        define(['jquery'], wrap);
    } else {
        // Otherwise we assume jQuery was loaded the old 
        // fashioned way and just pass the jQuery object to wrap
        wrap(global.jQuery);
    }

}(this);</pre>
<h2> Using the plugin</h2>
<p>For non-AMD users (pah!) they can just use the plugin the same way they always have:</p>
<pre class="prettyprint linenums">$('.some-element').foo({
    test: 'option1',
    test2: 'option2'
});</pre>
<p>Hot sauce AMD users have a familiar experience:</p>
<pre class="prettyprint linenums">require(['jquery', 'Foo'], function($) {
    // No need to pass a Foo argument as it augments the jQuery prototype directly
    $('.some-element').foo({
        test: 'option1',
        test2: 'option2'
    });
});</pre>
<p>This is just something I came up with whilst fiddling around. Some <a href="https://gist.github.com/4353587">ideas for improvements are welcomed</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://simonsmith.io/writing-amd-compatible-plugins-for-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Global settings with AMD</title>
		<link>http://simonsmith.io/global-settings-with-amd/</link>
		<comments>http://simonsmith.io/global-settings-with-amd/#comments</comments>
		<pubDate>Fri, 18 May 2012 17:44:55 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[AMD]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://simonsmith.io/?p=295</guid>
		<description><![CDATA[Upon switching your app or website over to AMD the need to rely on global variables is a thing of the past, but it does raise one question, how do you maintain global settings? Prior to using AMD it would be solved by just namespacing an object with any settings...]]></description>
				<content:encoded><![CDATA[<p>Upon switching your app or website over to AMD the need to rely on global variables is a thing of the past, but it does raise one question, how do you maintain global settings?</p>
<p>Prior to using AMD it would be solved by just namespacing an object with any settings required:</p>
<pre class="prettyprint linenums">MyApp.settings = {
    siteRoot: 'http://myapp.com',
    currentPage: 'home'
}

// Later on
if (MyApp.settings.currentPage === 'home') {
    // Do some cool stuff
}</pre>
<p>With AMD you can create a settings module and just require it whenever necessary:</p>
<pre class="prettyprint linenums">    // modules/settings.js
    define({
        siteRoot: 'http://myapp.com',
        currentPage: 'home'
    });

    require(['modules/settings'], function(settings) {
        if (settings.currentPage === 'home') {
        // Cool stuff
        }
    })</pre>
<h2>Populating with server side values</h2>
<p>In the example above it&#8217;s likely that the <code>siteRoot</code> value would come from the server and it&#8217;s common to output these values into a script element directly in the HTML page. To do this AMD-style means adding an id (as the first parameter) to the module definition:</p>
<pre class="prettyprint linenums">&lt;script&gt;
    define('settings', {
        siteRoot: '&lt;?=$site_root;?&gt;',
        currentPage: '&lt;?=$current_page;?&gt;'
    });

    // require as normal
&lt;/script&gt;</pre>
<p>Simple</p>
]]></content:encoded>
			<wfw:commentRss>http://simonsmith.io/global-settings-with-amd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Poor man&#8217;s AMD &amp; Mootools</title>
		<link>http://simonsmith.io/poor-mans-amd-mootools/</link>
		<comments>http://simonsmith.io/poor-mans-amd-mootools/#comments</comments>
		<pubDate>Mon, 14 May 2012 18:32:03 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[AMD]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[RequireJS]]></category>

		<guid isPermaLink="false">http://simonsmith.io/?p=278</guid>
		<description><![CDATA[I&#8217;m a big fan of using AMD to organise my JavaScript but problems arise when certain libraries or plugins don&#8217;t support it. One of those is MooTools, which is a seemingly perfect candidate due to its modular nature. There are plans to support AMD (and CommonJS) in the 1.x version and also...]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m a big fan of <a href="http://requirejs.org/docs/whyamd.html">using AMD</a> to organise my JavaScript but problems arise when certain libraries or plugins don&#8217;t support it. One of those is MooTools, which is a seemingly perfect candidate due to its modular nature. There are <a href="https://github.com/mootools/mootools-core/issues/2102">plans to support AMD (and CommonJS)</a> in the 1.x version and also whatever MooTools 2.0 is <a href="https://github.com/mootools/prime">calling itself these days</a> but I&#8217;m all about the here and now.</p>
<p>One approach is to adopt the jQuery way of using AMD (hence poor man) and just load the whole library. The primary reason for this is to let us start writing Classes and other MooTools code AMD-style and enjoy the rock star status that proper dependency based JavaScript guarantees.</p>
<h2>Use.js</h2>
<p>If you&#8217;re at all familiar with AMD then you&#8217;ll no doubt have heard of <a href="http://requirejs.org">the wonderful RequireJS</a>. It&#8217;s my library of choice when it comes to AMD (<a href="https://github.com/cujojs/curl">other loaders are available</a>) and with it you can <a href="https://github.com/tbranyen/use.js/">make use of use.js</a>. Basically, it&#8217;s a plugin that will allows use of non-AMD code (by wrapping it in a define) with our modules and it&#8217;s such a useful feature it will be landing <a href="https://github.com/jrburke/requirejs/wiki/Requirejs-2.0-draft#wiki-shim">in RequireJS 2.0 as &#8216;shim&#8217;</a>.</p>
<h2>Load me some Moo</h2>
<p>Let&#8217;s get down to it and check out an example of configuring use.js:</p>
<pre class="prettyprint linenums">require.config({
    baseUrl: 'scripts',
    paths: {
        'use': 'lib/use',
        'mootools': 'lib/mootools-core',
        'mootools-more': 'lib/mootools-more'
    },
    use: {
        'mootools': {
            attach: 'MooTools'
        },
        'mootools-more': {
            deps: ['use!mootools'],
            attach: function(MooTools) {
                return MooTools.More
            }
        }
    }
});</pre>
<p>First thing is to ensure that the paths to MooTools are set correctly.</p>
<p>Next, within the <code>use</code> options object we merely define the files we want to pass through <code>use</code>, any dependencies and also how it behaves once returned to a <code>require</code> or <code>define</code> call. In this case I&#8217;m returning the MooTools or MooTools.More object. Neither provide any real use (as MooTools either augments existing objects or creates it own) but it&#8217;s the most semantic thing to return.</p>
<h2>Using the hot AMD sauce</h2>
<p>Once the boring stuff is out of the way you can begin having fun with your modules:</p>
<pre class="prettyprint linenums">// classes/myclass.js
define(function(require) {

    require('use!mootools');
    require('use!mootools-more');

    return new Class({

        Implements: Options,

        initialize: function(message) {
            console.log(message);
        }

    });

});

// Meanwhile...
require(['classes/myclass'], function(MyClass){
    new MyClass('yeeeeaah'); // logs 'yeeeeaah'
});</pre>
<p>That&#8217;s it, easy!</p>
<p>Once MooTools goes AMD for real, all you&#8217;ll need to do is update your dependency list for your classes and you&#8217;re done.</p>
<p>Asynchronously go forth!</p>
<p><strong>Update:</strong></p>
<p>Since posting this, RequireJS 2.0 has been released <a href="http://requirejs.org/docs/api.html#config-shim">which includes the shim configuration</a> that allows this kind of functionality by default. Use that instead!</p>
]]></content:encoded>
			<wfw:commentRss>http://simonsmith.io/poor-mans-amd-mootools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS inherit property</title>
		<link>http://simonsmith.io/css-inherit-property/</link>
		<comments>http://simonsmith.io/css-inherit-property/#comments</comments>
		<pubDate>Fri, 13 Apr 2012 13:01:04 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://simonsmith.io/?p=265</guid>
		<description><![CDATA[The CSS inherit property is one of those basic things that tends to get overlooked for some of the more glitzy CSS3 effects, but I just wanted to show a quick example of a common use that might help your day to day CSS antics. Essentially the inherit property forces...]]></description>
				<content:encoded><![CDATA[<p>The CSS <code>inherit</code> property is one of those basic things that tends to get overlooked for some of the more glitzy CSS3 effects, but I just wanted to show a quick example of a common use that might help your day to day CSS antics.</p>
<p>Essentially the inherit property forces a child element to use (or inherit) its parent properties on a specific value. You might think that this happens automatically but one common example where this isn&#8217;t applied is changing the colour of an <code>&lt;a/&gt;</code> element.</p>
<pre class="prettyprint linenums">&lt;div class="wrap"&gt;
    &lt;a href="#"&gt;Oh hai, a link&lt;/a&gt;
&lt;/div&gt;</pre>
<pre class="prettyprint linenums">.wrap {
    color: red; // My link didn't change
}</pre>
<p>The link would still be it&#8217;s original (usually ugly blue) colour and a common pattern is to now write a separate declaration to target the <code>&lt;a/&gt;</code> and repeat the colour again. A cleaner workaround is to force the <code>&lt;a/&gt;</code> to inherit the red colour applied to its parent like so:</p>
<pre class="prettyprint linenums">.wrap {
    color: red;
}
.wrap a {
    color: inherit;
}</pre>
<p>A very slight change, but it saves you repeating the same value</p>
]]></content:encoded>
			<wfw:commentRss>http://simonsmith.io/css-inherit-property/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extending CSS classes in LESS</title>
		<link>http://simonsmith.io/extending-css-classes-in-less/</link>
		<comments>http://simonsmith.io/extending-css-classes-in-less/#comments</comments>
		<pubDate>Sat, 07 Apr 2012 16:44:59 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[LESS]]></category>
		<category><![CDATA[OOCSS]]></category>
		<category><![CDATA[Twitter Bootstrap]]></category>

		<guid isPermaLink="false">http://simonsmith.io/?p=251</guid>
		<description><![CDATA[If you hadn&#8217;t noticed, CSS preprocessors are all the rage these days, and with good reason. They provide all manner of nice shortcuts and generally make your life easier. LESS is my weapon of choice and Twitter Bootstrap has helped it&#8217;s popularity grow amongst developers. Another great thing that has...]]></description>
				<content:encoded><![CDATA[<p>If you hadn&#8217;t noticed, CSS preprocessors are all the rage these days, and with good reason. They provide all manner of nice shortcuts and generally make your life easier. <a href="http://lesscss.org/">LESS</a> is my weapon of choice and <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap</a> has helped it&#8217;s popularity grow amongst developers.</p>
<p>Another great thing that has come about from Bootstrap is their use of class names to organise the styling of the framework. I&#8217;m sure the argument about exclusively using CSS classes could rage on but I&#8217;ve found on large sites with multiple developers it has been a great way to keep code modular and easy to change.</p>
<h2>LESS is more</h2>
<p>To give an example, Bootstrap tends to use a &#8216;base&#8217; class and the build from it, like this:</p>
<pre class="prettyprint linenums">&lt;ul class="nav nav-tabs nav-stacked"&gt;
&lt;/ul&gt;</pre>
<p>I&#8217;ve come to enjoy this pattern, because when combined with LESS you can create some really nice, modular blocks of CSS. I&#8217;ll demonstrate with some button classes I have been writing for a design at work:</p>
<pre class="prettyprint linenums">.btn {
    font-size: 14px;
    background-color: #a1a1a1;

    span {
        background-repeat: no-repeat;
    }

    &amp;.btn-rounded {
        .border-radius(5px);
    }

    &amp;.btn-pressed {
        .box-shadow(-1px 1px 2px 0 rgba(0, 0, 0, .1));
    }

    &amp;.btn-prev {
        text-align: left;

        span {
            background-image: url("@{imgPath}buttons/arrow-left.png");
            background-position: left center;
            padding-left: 15px;
        }
    }

    &amp;.btn-next {
        text-align: right;

        span {
            background-image: url("@{imgPath}buttons/arrow-right.png");
            background-position: right center;
            padding-right: 15px;

        }
    }
}</pre>
<p>By using the <code>&amp;</code> combinator we can keep the code nested beneath the <code>.btn</code> base class keeping the code easy to read and the resulting CSS is targeted just to the <code>.btn</code> class which is exactly what we want.</p>
<h2>Overriding</h2>
<p>In the example above I have two classes to control whether the button should have an arrow facing left or right. That&#8217;s great, but now I want to make a larger version of the button which involves overriding the current <code>.btn-prev</code> and <code>.btn-next</code> with new image paths:</p>
<pre class="prettyprint linenums">    &amp;.btn-large {
        @padding: 15px;
        font-size: 16px;
        padding-left: @padding;
        padding-right: @padding;

        &amp;.btn-prev {
           span {
               background-image: url("@{imgPath}buttons/arrow-left-large.png");
               background-position: left 1px;
               padding-left: 20px;
               padding-right: 10px;
           }
        }

        &amp;.btn-next {
           span {
               background-image: url("@{imgPath}buttons/arrow-right-large.png");
               background-position: right 1px;
               padding-left: 8px;
               padding-right: 20px;
           }
        }
    }</pre>
<p>Now when I add a class of <code>.btn-large</code> to my <code>&lt;button/&gt;</code> element the <code>.btn-prev</code> and <code>.btn-next</code> I had already defined will be overridden by the two new definitions.</p>
<p>Once you start to create a little collection of classes like this, it becomes an absolute breeze to alter your designs by just swapping out different CSS classes and modifying existing ones just by adding additional classes.</p>
<p>However, like all things it can be easy to get carried away. So keep a sharp eye on your CSS output and ensure you don&#8217;t create needless selectors just because the nesting looks nice in your LESS files!</p>
]]></content:encoded>
			<wfw:commentRss>http://simonsmith.io/extending-css-classes-in-less/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tips on writing a front-end developer CV</title>
		<link>http://simonsmith.io/tips-on-writing-a-front-end-developer-cv/</link>
		<comments>http://simonsmith.io/tips-on-writing-a-front-end-developer-cv/#comments</comments>
		<pubDate>Sun, 23 Oct 2011 21:14:03 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[CV]]></category>
		<category><![CDATA[Recruitment]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://simonsmith.io/?p=187</guid>
		<description><![CDATA[For the last month or two we&#8217;ve been searching for a decent front-end developer to join the Radio Times ranks. My involvement in the project has been coming to a close for a while (due to Radio Times no longer belonging to BBC Worldwide any more) so finding a dedicated...]]></description>
				<content:encoded><![CDATA[<p>For the last month or two we&#8217;ve been searching for a decent front-end developer to join the Radio Times ranks. My involvement in the project has been coming to a close for a while (due to <a href="http://www.guardian.co.uk/media/2011/aug/16/bbc-completes-magazines-sell-off">Radio Times no longer belonging to BBC Worldwide</a> any more) so finding a dedicated resource has been high on the &#8220;shit that needs to get done&#8221; list.</p>
<p>Luckily, I was given the fantastic task of sifting through CVs from potential candidates.</p>
<p>Now, if your sarcasm detector has just gone haywire then don&#8217;t worry, it&#8217;s with good reason. You see initially I presumed I would be swamped with all manner of fantastic developers all clamouring for some Radio Times shaped pie. Unfortunately it turned into being a frustrating trek through a vat of Word document treacle, and the bulk of that frustration stemmed from the quality of CVs that fell into my inbox.</p>
<p>I saw some good, and saw some bad. So much so in fact, that I thought I could point out a few recurring themes and hopefully inspire some developers to represent themselves more favourably.</p>
<h2>Whatever happens show me some code!</h2>
<p>I don&#8217;t care if you&#8217;ve just burst into flames whilst writing your CV. The last thing your charred fingers should be doing is providing a way to get to your code.</p>
<p>I&#8217;m not sure I can convey <em>just how</em> important this point is (admittedly, the topic of spontaneous human combustion might just do the trick).</p>
<p>The amount of developers I&#8217;ve witnessed without <em>some</em> form of portfolio is quite baffling. At some point in the recruitment process a technical person (most likely a fellow developer) is going to want to see how good you are; and there is no better way than checking out your code.</p>
<p>Linking to the home page of a site you worked on is not good enough. You may have written the whole site, or you may have altered the heading text in a sidebar. It&#8217;s impossible for the developer perusing your CV to know this. Explaining what you did specifically is a possible alternative, but you need to be sure your code won&#8217;t be re-written. Especially if someone does it badly.</p>
<p>If you don&#8217;t have a portfolio then upload some snippets to <a href="https://github.com/">GitHub</a>, <a href="http://jsfiddle.net/">jsFiddle</a> or even <a href="http://pastebin.com/">Pastebin</a> (it has syntax highlighting!). Basically, get your code in front of your potential employer as fast as possible. They&#8217;ll already be thinking &#8220;I like this guy&#8221; for making their job that bit easier.</p>
<h2>Your <em>entire</em> employment history does not interest me</h2>
<p>The web is a fast moving place and a good front end developer has to adapt to new techniques quickly. This usually means we have to drop techniques or coding practices that worked before but are no longer the best way to go.</p>
<p>Think how fast the landscape has changed already. Mobile first development, HTML5 and responsive design are just some examples of technologies and design patterns that have absolutely taken off. Showing awareness of these techniques and embracing them often reveals the difference between a &#8220;9 to 5&#8243; developer and someone who lives and breathes their craft.</p>
<p>With this mind I found myself paying less attention to job details more than a couple of years old. Candidates tend to include a huge paragraph outlining everything they did at each stage of their employment history and frankly, knowing how awesome you were at IE6 bug fixing in 2008 is not really relevant now. That&#8217;s not to say an employment history isn&#8217;t useful (if you worked at Facebook in 2008, you should damn well make it clear!) but it&#8217;s unncessary to outline everything.</p>
<p>Include a short summary of your time at older positions, and pile on the detail about all the cool stuff you&#8217;ve built in the last year or two.</p>
<h2>Keep your skills succinct</h2>
<p>Ah, the skills list. A place to spit out every single acronym and buzz word that you can think of. It&#8217;ll make you look cool right? No, it won&#8217;t.</p>
<p>Limit it to the core skills that you actually use. And for god&#8217;s sake don&#8217;t list every application you&#8217;ve ever opened. I can safely assume you are competent with an IDE and Microsoft Word.</p>
<div id="attachment_207" class="wp-caption aligncenter" style="width: 630px"><img class="size-full wp-image-207" title="Skills" alt="" src="http://simonsmith.io/wp-content/uploads/2011/10/Screen-shot-2011-10-20-at-23.55.22.png" width="620" height="360" /><p class="wp-caption-text">One of my favourite &#8216;kitchen sink&#8217; lists</p></div>
<p>&nbsp;</p>
<h2>Be prepared for agencies to interfere with your CV</h2>
<p>A few times I have seen recruitment agenices add their own front page to a candidates&#8217; CV or even go as far as editing their actual details. This can be a problem because they&#8217;ll usually just add keywords and more skills, which of course you have not authorised.</p>
<p>To combat this I recommend sending your CV as a PDF (using the <a href="http://www.doc2pdf.net/">many free services available</a> to convert from a Word document) and also making the file available for download from your portfolio.</p>
<h2>Spelling and grammar still count</h2>
<p>Don&#8217;t rely on your chosen word processor to cover your back when it comes to these two. Read your CV, re-read it and then read it again. Even better if you can get a colleague/friend to give it a vigorously strict review.</p>
<p>If basic mistakes like the difference between &#8216;there&#8217; and &#8216;their&#8217; or &#8216;you&#8217;re&#8217; and &#8216;your&#8217; are peppered all over you CV then you&#8217;re only going to create a negative impression. After all, if you don&#8217;t take care with your incredibly important CV, what are you like when it comes to code quality?</p>
<p>Oh, and definitely make sure you spell things like JavaScript and jQuery correctly (it&#8217;s not Jquery!), the little things count!</p>
<h2>Make a big deal out of personal projects</h2>
<p>Working outside of your scheduled &#8217;9 to 5&#8242; job says a lot about your attitude to front-end development. There is a lot to keep up on in the front-end world. All the new parts of HTML5/CSS3, new approaches to problems being discovered and shared on twitter and blogs, and finding the time to actually practice and learn this stuff. It&#8217;s a tricky field to remain competent in, but we do because we love it!</p>
<p>There isn&#8217;t a better way to demonstrate this than working on a project of your own choosing. It can be writing a useful JavaScript snippet, creating a new library, contributing to an open source project or even just making a website that uses a cool technology. Whatever you choose, it will give you a chance to write code that is free from the constraints of your place of work and gives you a real chance to demonstrate your prowess.</p>
<p>Personal projects speak loudly on a CV.</p>
<h2>Don&#8217;t lie</h2>
<p>This is a pretty obvious one but it needs a mention here. Your web of lies can easily be unwound by a few well placed technical questions or a test, and it just makes you look foolish.</p>
<p>A common example is candidates who boast a wealth of JavaScript experience but in reality have done little more than include a few jQuery plugins on a page and wire up some events. If you find yourself needing to bend the truth, then all you&#8217;ve done is discovered some gaps in your knowledge that you should aim to rectify with some good ol&#8217; fashioned learning!</p>
<h2>Conclusion</h2>
<p>The few tips here are from own experiences and are likely not to be hard and fast rules. I will admit that until I actually had to sit down and read through a bunch of CVs I was making a few of these mistakes myself. I simply identified what annoyed me as someone who had to read them all and transferred that experience to my own CV. Annoyingly simple in hindsight.</p>
<p>Oh yes, we found a great UI developer for the Radio Times project in the end. Success!</p>
]]></content:encoded>
			<wfw:commentRss>http://simonsmith.io/tips-on-writing-a-front-end-developer-cv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 things I learnt from building radiotimes.com</title>
		<link>http://simonsmith.io/10-things-i-learnt-from-building-radiotimes/</link>
		<comments>http://simonsmith.io/10-things-i-learnt-from-building-radiotimes/#comments</comments>
		<pubDate>Fri, 23 Sep 2011 09:00:00 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[Radio Times]]></category>

		<guid isPermaLink="false">http://simonsmith.io/?p=152</guid>
		<description><![CDATA[Unless you&#8217;re incredibly uncool then you&#8217;ll no doubt be aware of the shiny new Radio Times website that was released a couple of weeks ago. I had quite a lot to do with the front-end side of things on that site so I thought I&#8217;d write a post about various...]]></description>
				<content:encoded><![CDATA[<p>Unless you&#8217;re incredibly uncool then you&#8217;ll no doubt be aware of <a href="http://www.radiotimes.com/">the shiny new Radio Times website</a> that was released a couple of weeks ago. I had quite a lot to do with the front-end side of things on that site so I thought I&#8217;d write a post about various things I learnt, and also things I already knew that were just re-enforced.</p>
<p><em>At this stage it&#8217;s probably worth doing one of those disclaimers that we see in blog posts all the time. There are a lot of stupid people about so I&#8217;ll say now that all of these points/views/opinions are mine and nowt to do with the BBC or any of it&#8217;s affiliates.</em></p>
<p>Idiot speech done, yay!</p>
<h2>MooTools is awesome</h2>
<p>Radio Times was the first large site that I&#8217;ve built using MooTools as the main JS framework and it&#8217;s sealed itself as my preferred library. I particularly favour the way it encourages the developer to organise their code using OO concepts, something which I always longed for when writing JS with jQuery. My favourite quote comes from a site that enticed me into converting from jQuery shenanigans, the aptly named <a href="http://jqueryvsmootools.com/">jqueryvsmootools.com</a>:</p>
<blockquote><p>If jQuery makes the DOM your playground, MooTools aims to make JavaScript your playground</p></blockquote>
<p>jQuery was the first library I got involved with (I was writing it before I even knew the correct syntax for a function, ugh) and it definitely helps novices get stuff done, but if you want to embrace JS as a language then MooTools helps you achieve that. Mind you, if I need to get stuff done fast on a small site I will always consider reaching for jQuery as it comes down to what tool is best for the job.</p>
<p>It&#8217;s on my list to properly explore <a href="http://dojotoolkit.org/">Dojo</a> as well, but that&#8217;s a task for another time.</p>
<h2>Should have used responsive design. Foolish error</h2>
<p>Ah, I kick myself for not pushing this more at the beginning of the project. I remember sitting down with the product owner near the start of the project (December/January last year I believe) and explaining the benefits of this technique and why we should embrace it but unfortunately the design agency had already held us up long enough just getting desktop versions completed, so there certainly wasn&#8217;t time to start exploring layouts for different sized devices. The decision was made to &#8220;do it at the end&#8221; but as we all know, when dealing with the concept of &#8220;mobile first&#8221; that is largely impossible.</p>
<p>Responsive design is an even bigger deal now than it was when I had that discussion and I would go as far to say that there isn&#8217;t two ways to build a site anymore. Just do it responsively, end of. Now Radio Times wants to make a move into the mobile space and after seeing what <a href="http://www.bostonglobe.com/">The Boston Globe</a> achieved I really regret not pursuing this more aggressively.</p>
<h2>Stop trying to replicate PSDs in all browsers</h2>
<p>One thing I am proud of is breaking the mould a bit at the BBC when it comes to defining what &#8216;cross browser compatibility&#8217; actually means. If you have an ounce of interest in front-end development you can&#8217;t avoid being exposed to <a href="http://hardboiledwebdesign.com/">the preachings of Andy Clarke</a>. Essentially he talks about the ridiculous notion of trying to achieve pixel perfect designs in all browsers. With so many devices (all with varying levels of standards support) it is next to impossible. Instead, embrace the modern browsers and their capabilities and degrade your design for the old, wheezing versions of IE that can&#8217;t keep up.</p>
<p>With that kind of awesome advice ringing in my ears I set out the rule early on that IE users would not get the same experience as Chrome, Firefox et al, but they should never think the site looked broken. Given that a lot of people involved with the site at BBC Worldwide were using IE8 it <em>could</em> be deemed a crazy idea and I was grateful that the product owner put trust in me to make this decision.</p>
<p>With some serious reliance on <a href="http://www.modernizr.com/">Modernizr</a>, that goal has been achieved and users of modern browsers are rewarded with some quite lovely CSS3 uses. Forward thinking, yes!</p>
<h2>When it comes to HTML5, 8 is the new 6</h2>
<p>I am of course referring to the line of browsers prefixed with IE. We tried to fully embrace the use of HTML5 elements on Radio Times but by jumping ahead to this exciting new world of semantic joy, IE8 is once again holding developers back. Two tools that help us fight this sorry state of affairs are <a href="http://www.modernizr.com/">Modernizr</a> and <a href="http://selectivizr.com/">Selectivizr</a>. Both are invaluable but one area that you can become unstuck in is needing to update the DOM with new elements. The <a href="http://www.radiotimes.com/tv/tv-listings">RT listings page</a> makes use of an article element for each channel and when the user selects a new time slot, the page is updated with Ajax. This is when things get a little ugly in IE.</p>
<p>We fought this beast by making use of <a href="http://jdbartlett.com/innershiv/">a handy script called innerShiv</a> and although it&#8217;s not ideal it&#8217;s certainly a viable way to get round IE and dynamic content issues, particularly if you don&#8217;t want to start wrapping all your clean markup in div elements.</p>
<p>If you&#8217;re gonna get all futuristic up in here with HTML5 and CSS3 then you need to accept that IE8 users and below are going to have an inferior experience. If you can deal with that (or rather your clients can!) then you&#8217;re all set.</p>
<h2>Don&#8217;t outsource your site design</h2>
<p>And if you do, ensure it&#8217;s an agency that understands the limitations and strengths of a browser. Also, some User Experience erm.. experience will help as well. Not all agencies are bad, they can&#8217;t be, but unfortunately at BBC Worldwide I&#8217;ve seen a couple of projects outsourced to a poor design agency, even when there are perfectly good designers sitting around in-house.</p>
<p>The design process is and should be something that continues to iterate. The front end developers and designers need to work closely to produce the best work, especially if they plan to implement a responsive design. You simply can&#8217;t just send a list of requirements off, wait for a bit, get a bunch of PSDs back and start building them. The amount of changes and queries we had with some of the Radio Times designs were crazy, equally so were some of the user experience choices. Double clicking areas of the page? Yeah that was thrown in at one point.</p>
<p>Back-end and front-end devs work together, but in my mind it&#8217;s even more important that designers work in that group. Crucial.</p>
<h2>Universal IE6 is great</h2>
<p>Fortunately the decision to drop IE6 support was made fairly early on due to the hideous amount of dev time soaked up in fixing things (IE7 &amp; 8 were enough trouble). However, instead of just leaving a stupidly broken page for our unfortunate IE6 users it took all of five minutes to implement <a href="http://forabeautifulweb.com/blog/about/universal_internet_explorer_6_css">Andy Clarke&#8217;s awesome Universal IE6 stylesheet</a>. It essentially strips away all layout styling and leaves a nice looking, linear page for IE6 users which is designed to allow them access to the content only.</p>
<p>So far I&#8217;ve not heard one complaint about this approach from our users.</p>
<h2>Remove obstacles from developers</h2>
<p>One problem I continually see with the projects I have been on is the need to introduce process where it absolutely shouldn&#8217;t be. And I&#8217;m referring to little things that just stop a developer from developing. On the Radio Times project for example, we would spend time in our stand up meeting putting smiley faces on sprint goals that showed how we were progressing. If anything, Project Managers should be looking to strip away as much process as possible. No one will complain that there aren&#8217;t enough wall charts and meetings. Ever.</p>
<p>The most productive times I&#8217;ve ever had are when I&#8217;m given a task to complete and then just left for a day or two to complete it. No meetings, no continual interruptions. PMs don&#8217;t need to justify their position with fluffy processes.</p>
<h2>Script loaders are ace, but not the only solution</h2>
<p>I made the mistake of thinking <a href="http://requirejs.org/">RequireJS</a> was so awesome that it could simply work in every single scenario. Obviously all libraries have their uses and I got a little blinded by all the asynchronous script loading and module based sexiness. I wrote all the MooTools classes to take advantage of the dependency based approach that RequireJS affords and ensured nearly all our scripts were loaded this way.</p>
<p>I actually ended up having <strong>a lot</strong> of issues with load order of the scripts, particularly in IE. I&#8217;m confident I was using the library correctly as most browsers played nice and the loading issues appeared to be intermittent. However, it was deemed too risky to release with those hidden problems so I had the fun task of editing <strong>all</strong> the Moo classes!</p>
<p>Working with one of the back-end devs, we created a similar system that would load scripts but concatenate them into one file, all in order and also minified when the page loaded. This proved to be just as useful and even faster on the load speed (we tried the RequireJS build tool first and didn&#8217;t have much luck).</p>
<p>This actually inspired the creation of <a href="http://boxjs.com">BoxJS</a> and <a href="http://boxcss.com">BoxCSS</a> which essentially do the same thing.</p>
<h2>Embrace retrospectives</h2>
<p>One thing I&#8217;m glad we did do on Radio Times was to really embrace fortnightly retrospectives. Now, this is not all to do with the beer and snacks that we would bring along, but if you&#8217;re gonna have a long meeting on a Friday afternoon I&#8217;ve noticed no one complains when a beer is on the table.</p>
<p>I think we tried about ten different ways of working the Agile board and cards on this project based on feedback from these meetings, but that is preferred over battling on with a system that doesn&#8217;t work. Being able to discuss negatives and positives openly in a dev team makes a big difference to the morale of the project, especially when measures are put in place to address the problems.</p>
<p>Never come out of a retrospective and start quietly moaning about problems on a project. Voice them!</p>
<h2>Using custom fonts? Test them without ClearType enabled</h2>
<p>Here&#8217;s an interesting one.</p>
<p>The designs for the new site utilised the <a href="http://new.myfonts.com/fonts/fontbureau/interstate/">Interstate font family</a> quite heavily and many of these fonts are quite thin. At BBC Worldwide if you&#8217;re not using a Mac then 90% of the time you&#8217;ll be on an XP machine, and helpfully the default setting for these boxes is to have ClearType disabled. Trying to read some of the Radio Times fonts like this was a taxing process, and it became more evident when the site first went into beta as many users complained about the legibility of the copy.</p>
<p>Being too far down the line to start altering fonts (and having paid a bucket load to license Interstate!) we had to find a fix, which came in the form of <a href="http://www.useragentman.com/blog/2009/11/29/how-to-detect-font-smoothing-using-javascript/">this excellent technique for detecting aliasing with canvas</a>.</p>
<p>&nbsp;</p>
<p>I&#8217;ll wait for one my colleagues to tell me ten things I <em>should</em> have learnt!</p>
]]></content:encoded>
			<wfw:commentRss>http://simonsmith.io/10-things-i-learnt-from-building-radiotimes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
