<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Lawrence Gosset</title>
    <description>Personal website of London based web developer, Lawrence Gosset.</description>
    <link>http://gosseti.com/</link>
    <author>Lawrence Gosset</author>
    <item>
      <title>Take Me There app</title>
      <description>&lt;p&gt;A few years ago I came up with an idea. I wanted to build an app that found geolocated photos from across the world, and showed you how to get to them. It worked a little something like this: think of a place, search for it, see inspiring photos and then get directions to the &lt;em&gt;exact&lt;/em&gt; spots the photos were taken. An app built for travellers, holiday goers, photographers and procrastinators.&lt;/p&gt;

&lt;p&gt;At the time I didn’t really have the technical chops to build it myself, so I drafted up a spec and went on the hunt for a developer to help me out. Unfortunately, due to costs and time constraints, this didn’t work out, and so I decided to shelve the idea and move onto other things.&lt;/p&gt;

&lt;p&gt;For about the past year I’ve been dabbling in Rails development, with my mind often being blown by its incredible power to build out ideas and apps in a small amount of time. Recently, I came to the realisation that I could build Take Me There myself, and so with a few weeks set aside, &lt;a href="http://takemethereapp.com/"&gt;I went and built it&lt;/a&gt;.&lt;/p&gt;

&lt;!--more--&gt;

&lt;p&gt;So what is Take Me There? Well, in the words taken from the app’s about page:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Take Me There was created to help you discover the stunning world around you. It cuts through the cruft and only shows you geolocated photos, meaning you can see the exact location every photo was taken.&lt;/p&gt;

&lt;p&gt;Using the 500px API, Take Me There gives you access to hundreds of thousands of photos at your fingertips.&lt;/p&gt;

&lt;p&gt;Travel inspiration, holiday inspiration, Monday morning office escapism, photography enthusiasm; the list of potential use cases goes on…&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Right now the app is very new and a bit buggy. It doesn’t filter out the cruft as much as I’d like it to, but pulls through more &lt;em&gt;good&lt;/em&gt; stuff than it does &lt;em&gt;not so good&lt;/em&gt; stuff.&lt;/p&gt;

&lt;p&gt;Anyway, go and check out &lt;a href="http://takemethereapp.com/"&gt;Take Me There app&lt;/a&gt;. Feel free to &lt;a href="http://twitter.com/gosseti/"&gt;tweet me&lt;/a&gt; with any feedback and thoughts, or if you’re keen to contribute. Enjoy!&lt;/p&gt;
</description>
      <pubDate>2014-03-04 11:55:00</pubDate>
      <link>http://gosseti.com/take-me-there-app</link>
      <guid>http://gosseti.com/take-me-there-app</guid>
    </item>
    <item>
      <title>Responsive performance</title>
      <description>&lt;p&gt;Recently I’ve had my responsive thinking cap on and have been experimenting beyond the CSS sheet. By shifting my focus onto performance, I’ve been able to get a feel for how improving it can transform the experience.&lt;/p&gt;

&lt;p&gt;By definition, when something responds, it reacts quickly and positively. Performance is big business that can cost companies millions for &lt;a href="http://news.ycombinator.com/item?id=273900"&gt;just a mere 100ms&lt;/a&gt; in page speed loss. It came as a shock to me when &lt;a href="http://24ways.org/2012/responsive-responsive-design/"&gt;Tim Kadlec measured&lt;/a&gt; a highly regarded responsive site to have taken a whopping 93 seconds to load over a 3G connection. It consisted of 105 requests weighing in at 5,942kB. &lt;/p&gt;

&lt;p&gt;It’s this kind of thing that is the polar opposite of responsive.&lt;/p&gt;

&lt;p&gt;Flexible images, percentage widths and media queries are all key ingredients of a responsive site — but it shouldn’t stop there. Performance needs to embraced as a guiding principle, instead of an afterthought. Snappy websites create positive experiences, and that’s good for business.&lt;/p&gt;

&lt;p&gt;During the build process of this site, I’ve jumped between the front and back-ends, with the aim of cutting as many milliseconds and kBs off the page load. Although this website is small and lightweight, the principles and best practices are valuable and can be applied to something larger in scale.&lt;/p&gt;

&lt;h3&gt;Initial payload&lt;/h3&gt;

&lt;p&gt;The most important performance consideration for me was the initial kB payload. When a page loads, the bare essentials should be delivered, and the rest progressively enhanced. For example, my base is made up of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Basic CSS file (120 lines at 4.25kB minified)&lt;/li&gt;
&lt;li&gt;Basic JavaScript file (15.75kB consisting of Modernizr, Turbolinks, Typekit async and jump navigation)&lt;/li&gt;
&lt;li&gt;Low-res or &lt;a href="http://filamentgroup.com/lab/rwd_img_compression/"&gt;compressive&lt;/a&gt; images&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Beyond that, my web fonts are loaded asynchronously, and demo page assets kept separate.&lt;/p&gt;

&lt;h3&gt;Async the web fonts&lt;/h3&gt;

&lt;p&gt;I’ve used &lt;a href="http://blog.typekit.com/2011/05/25/loading-typekit-fonts-asynchronously/"&gt;Typekit’s async snippet&lt;/a&gt; to load web fonts conditionally based off of a Modernizr.load (aka &lt;a href="http://yepnopejs.com/"&gt;yeynope&lt;/a&gt;) &lt;code&gt;@font-face&lt;/code&gt; test. Put simply, I’m only loading web fonts in browsers that can actually display them.&lt;/p&gt;

&lt;p&gt;By loading asynchronously, initial overhead is cut down and potential JavaScript blocking avoided.&lt;/p&gt;

&lt;p&gt;Here’s the code snippet:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Modernizr.load([{
  test: Modernizr.fontface,
  complete: function() {
    TypekitConfig = {
      kitId: &amp;#39;xxxxxxx&amp;#39;,
      scriptTimeout: 3000
    };
    (function() {
      var t = setTimeout(function() {
      }, TypekitConfig.scriptTimeout);
      var tk = document.createElement(&amp;#39;script&amp;#39;);
      tk.src = &amp;#39;//use.typekit.com/&amp;#39; + TypekitConfig.kitId + &amp;#39;.js&amp;#39;;
      tk.onload = tk.onreadystatechange = function() {
        var rs = this.readyState;
        if (rs &amp;amp;&amp;amp; rs != &amp;#39;complete&amp;#39; &amp;amp;&amp;amp; rs != &amp;#39;loaded&amp;#39;) return;
        clearTimeout(t);
        try { Typekit.load(TypekitConfig); } catch (e) {}
      };
      var s = document.getElementsByTagName(&amp;#39;script&amp;#39;)[0];
      s.parentNode.insertBefore(tk, s);
    })();
  }
}]);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The downside to this is that the fonts are only downloaded once the main JavaScript file has been parsed, which causes a ~500ms delay (on desktop).&lt;/p&gt;

&lt;h3&gt;‘One page’ with pushState&lt;/h3&gt;

&lt;p&gt;I’m using &lt;a href="https://github.com/rails/turbolinks"&gt;Turbolinks&lt;/a&gt; on this site, which takes advantage of the HTML5 history API’s pushState and replaceState methods. They allow you to replace the content of the &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt;, whilst keeping all the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; assets in tact. This performs a page load illusion by changing the URL and title dynamically, whilst pushing the new page onto the browser history stack. I like to think of it as legitimate AJAX.&lt;/p&gt;

&lt;p&gt;As a result of using pushState, page loads are noticeably faster. I’ve been measuring most of mine to be coming in between 100 – 150ms. Battery life is also conserved because of the unecessary HTTP request avoidance, and the flash of unstyled text is also eliminated. &lt;/p&gt;

&lt;p&gt;Keeping the current page instance alive through pushState is good, but does &lt;a href="https://github.com/rails/turbolinks/issues?page=1&amp;amp;state=closed"&gt;have its caveats&lt;/a&gt;. A lot more testing is needed as pesky edge cases do emerge.&lt;/p&gt;

&lt;p&gt;The &lt;a href="http://www.rbmaradio.com/"&gt;Red Bull Music Academy Radio&lt;/a&gt; and &lt;a href="https://soundcloud.com/"&gt;SoundCloud&lt;/a&gt; are two of my favourite examples of this in the wild.&lt;/p&gt;

&lt;h3&gt;Using Sass for legacy IE&lt;/h3&gt;

&lt;p&gt;I used to use &lt;a href="https://github.com/scottjehl/Respond"&gt;Respond.js&lt;/a&gt; as an IE media query polyfill. The trouble is that it has JavaScript dependency and XHRs your style sheets. The performance hit is undesirable. However, using  &lt;a href="http://sass-lang.com/"&gt;Sass @includes&lt;/a&gt;, I’m able to compile a media queried version and non media queried version of the same stylesheet. These are included in IE conditional comments:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;!--[if (gt IE 8) | (IEMobile)]&amp;gt;&amp;lt;!--&amp;gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;style.css&amp;quot;&amp;gt;
&amp;lt;!--&amp;lt;![endif]--&amp;gt;

&amp;lt;!--[if (lt IE 9) &amp;amp; (!IEMobile)]&amp;gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; href=&amp;quot;ie.css&amp;quot;&amp;gt;
&amp;lt;![endif]--&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Nicolas Gallagher is to credit for popularising this method in &lt;a href="http://nicolasgallagher.com/mobile-first-css-sass-and-ie/"&gt;his excellent article&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;Vanilla JavaScript&lt;/h3&gt;

&lt;p&gt;jQuery is an absolute godsend, but comes with a price: 32kB and a bundle of code to parse. I found that what I wanted to achieve could all be done in vanilla JavaScript, and by doing this eliminated an unecessary burden on less capable devices.&lt;/p&gt;

&lt;p&gt;For any larger scale site or application, I’d probably use a combination of Jeremy Keith’s &lt;a href="http://adactio.com/journal/5429/"&gt;‘Conditional CSS’&lt;/a&gt; method and yepnope to load jQuery based on screen width or features:&lt;/p&gt;

&lt;h3&gt;The CSS&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;@media all and (min-width: 45em) {
    body:after {
        content: &amp;#39;widescreen&amp;#39;;
        display: none;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;The JavaScript&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;var size = window.getComputedStyle(document.body,&amp;#39;:after&amp;#39;).getPropertyValue(&amp;#39;content&amp;#39;);
if (size == &amp;#39;widescreen&amp;#39;) {
    yepnope([{
    load: &amp;#39;jquery.js&amp;#39;,
    complete: function () {}
    }]);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://requirejs.org/"&gt;RequireJS&lt;/a&gt; could also be bundled into the file for including modules and increasing speed. Delivering only what is needed, when it is needed.&lt;/p&gt;

&lt;h3&gt;Caching&lt;/h3&gt;

&lt;p&gt;It’s important to let your website’s underlying codebase do as little work as possible. Cached pages are like fast food that can be served up in an instant, whereas non cached pages have to be cooked, warmed, packaged and sent the front-end.&lt;/p&gt;

&lt;p&gt;Caching on the server side is an essential performance step for any website or application. In the case of this site, I’m using &lt;a href="http://www.memcachier.com/"&gt;Memcachier&lt;/a&gt;: a memcache addon for Heroku. Memory based cache storage is favourable over disk based because it’s faster (think HDD vs. RAM).&lt;/p&gt;

&lt;p&gt;Apache are currently developing mod_pagespeed, which performs a lot of useful HTTP caching and asset optimisation at server level. Ilya Grigorik has an &lt;a href="http://www.igvita.com/2012/10/10/automating-web-performance-with-mod_pagespeed/"&gt;excellent write-up&lt;/a&gt; on the many things it can do. I anticipate  many will adopt this into their responsive toolkit.&lt;/p&gt;

&lt;h3&gt;Summary&lt;/h3&gt;

&lt;p&gt;Performance and page ‘responsiveness’ should be part of the process and not an afterthought. The tools are readily available, we just need to choose to use them, and to use them wisely.&lt;/p&gt;

&lt;p&gt;I completely agree with Tim Kadlec’s call to action to create a culture of performance:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you understand just how important performance is to the success of a project, the natural next step is to start creating a culture where high performance is a key consideration.&lt;/p&gt;
&lt;/blockquote&gt;
</description>
      <pubDate>2012-12-12 20:41:00</pubDate>
      <link>http://gosseti.com/responsive-performance</link>
      <guid>http://gosseti.com/responsive-performance</guid>
    </item>
    <item>
      <title>A tidier approach to using SVG</title>
      <description>&lt;p&gt;As the web progresses into a future where screen densities are becoming increasingly uncertain, the need for pixel agnostic graphics is paramount. Blurry graphics really don’t cut the mustard.&lt;/p&gt;

&lt;p&gt;I’ve been working with SVG a lot recently, trying to figure out the most robust way to use it. Unfortunately SVG browser support is fairly new, so workarounds are required to provide graceful fallbacks to raster.&lt;/p&gt;

&lt;p&gt;My initial proposed solution &lt;span data-no-turbolink&gt;&lt;a href="demos/envelope-window-svg" title="Envelope window SVG"&gt;‘envelope window SVG’&lt;/a&gt;&lt;/span&gt; used &lt;code&gt;visibility: hidden&lt;/code&gt; on an image, and hooked in an SVG background onto the parent element. The major flaw to it being that two assets were download where only one was needed. Increased HTTP requests negatively impact performance, which forced me to continue my search. I eventually found &lt;a href="https://github.com/baamenabar/svgfall" title="SVGfall JavaScript library"&gt;SVGfall&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;Enter SVGfall&lt;/h3&gt;

&lt;p&gt;SVGfall is based on the Picturefill library by Scott Jehl. It uses three &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; elements with &lt;code&gt;data-support&lt;/code&gt; attributes that are filtered, featured detected and converted into an image. For those browsers that have little or no JavaScript support, a fallback raster image wrapped in &lt;code&gt;&amp;lt;noscript&amp;gt;&lt;/code&gt; tags is required at the end.&lt;/p&gt;

&lt;h3&gt;See a demo&lt;/h3&gt;

&lt;p&gt;I’ve put together a &lt;span data-no-turbolink&gt;&lt;a href="http://gosseti.com/demos/svgfall" title="SVGfall Demo"&gt;small demo&lt;/a&gt;&lt;/span&gt; of it in action.&lt;/p&gt;
</description>
      <pubDate>2012-12-02 20:42:00</pubDate>
      <link>http://gosseti.com/tidier-svg</link>
      <guid>http://gosseti.com/tidier-svg</guid>
    </item>
    <item>
      <title>Routing constraint for High Voltage</title>
      <description>&lt;blockquote&gt;
&lt;p&gt;High Voltage is a Ruby gem for creating static pages, like ‘about us’, in Rails apps.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When building this site, my post and page routes ran into conflicts with one and other. Whichever route came highest in the &lt;code&gt;routes.rb&lt;/code&gt; file took priority, making the one below defunct. In the interest of keeping things clean, the aim was to have all of my routes running from the base of the URI.&lt;/p&gt;

&lt;p&gt;This custom constraints method for High Voltage avoids the conflicts by checking for initial matches via &lt;code&gt;request.path&lt;/code&gt;, and if not matched, lets them carry on through.&lt;/p&gt;
</description>
      <pubDate>2012-11-04 20:41:00</pubDate>
      <link>http://gosseti.com/routing-constraint-for-high-voltage</link>
      <guid>http://gosseti.com/routing-constraint-for-high-voltage</guid>
    </item>
    <item>
      <title>Why I took a one year Facebook hiatus</title>
      <description>&lt;p&gt;First, the backstory.&lt;/p&gt;

&lt;p&gt;I never had a healthy relationship with Facebook. Not many people do. I felt a constant urge to check it and see if something interesting was happening. It’s addictive, almost like a computer game that demands constant attention but can’t be completed. I found it to be a constant distraction.&lt;/p&gt;

&lt;p&gt;This time last year, I stumbled across an alarming statistic on Twitter:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;An average Facebook user loses 23 hours a month on Facebook.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now, I’m not sure how accurate that is, but it works out to roughly 45 minutes of Facebook per day. If you scale that up to a typical lifetime, you’ve lost just over 775 days. That’s 2.7% of an &lt;em&gt;average&lt;/em&gt; American’s life span spent on Facebook.&lt;/p&gt;

&lt;p&gt;This woke me up. That’s a lot of time to lose — even before texting, email, and other social networks are factored in. It scared me to the extent that I decided to deactivate my Facebook for a while to see what impact it would have. American comedian Andy Borowitz’s quote perfectly sums up my reasons for doing so:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;There’s a fine line between social networking and wasting your fucking life.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Perhaps one of my &lt;a href="http://joekraus.com/were-creating-a-culture-of-distraction"&gt;favourite articles&lt;/a&gt; talks about this &lt;em&gt;culture of distraction&lt;/em&gt; and how we’re becoming increasingly reliant on distractions to plug time gaps where we feel mentally unstimulated.&lt;/p&gt;

&lt;p&gt;As Joe Kraus puts it (substitute ‘phone’ with ‘Facebook’):&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We threaten the key ingredients behind creativity and insight by filling up all our “gap” time with stimulation. And we inhibit real human connection when we prioritize our phones over our the people right in front of us.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;He then goes on…&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The effect of all of this is that we’re increasingly distracted. Less and less able to pay attention to anything for what used to be reasonable length of times.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It’s true. Some of us get so sucked into the virtual layer that we can sometimes be oblivious to the things around us. Almost using Facebook as a form of escapism from the task or social situation at hand. It’s a great tool for procrastination.&lt;/p&gt;

&lt;p&gt;What strikes me is this: what we perceive as ‘normal’ is often ‘statistically normal’ — i.e. &lt;em&gt;what everyone else does&lt;/em&gt;. Facebook has become so pervasive in Western youth culture that not having a profile is considered ‘abnormal’. Sometimes to the extent that people may consider you suspicious. James Holmes didn’t have a Facebook account.&lt;/p&gt;

&lt;p&gt;From the outset my intention was to lay off for just a few months, which then extended to just over a year. Deactivating essentially ghosted my profile, whilst keeping my data intact.&lt;/p&gt;

&lt;p&gt;Above all else it was a personal experiment to see what effects it would have on my day to day life. Suffice to say the impact has been very noticeable, and for the most part, positive.&lt;/p&gt;

&lt;p&gt;The most obvious and noticeable takeaway was being able to stay focussed for longer periods of time and get into a productive flow. Facebook no longer demanded any part of my attention. Without the ability to plug it into gaps of boredom or solitude, I was forced into longer form, insightful thinking. It’s a bit like having a shower, without the shower.&lt;/p&gt;

&lt;p&gt;As people weren’t readily available — and I wasn’t readily available to them — I made more effort to keep in touch. Apparently Facebook “helps connect people”, well not the way I see it. Real life conversations help connect people. A friend list, comment or status like on a screen is nothing more than that — it conveys no tone, senses or emotion. Removing the ability to digitally network amongst friends forced me to be more outgoing. Being out of touch and then catching up face to face makes it all the better, too.&lt;/p&gt;

&lt;p&gt;Having no Facebook resulted in me plugging myself into Twitter a lot more. Social networking amongst likeminded folk is really powerful. The people I follow — for the most part — aren’t close friends, so I never run risk of getting sucked into reading or sharing anything personal or trivial. It continues to prove itself an invaluable resource for links, articles, opinions, and short burst discussions. The constraint of 140 characters enforces this perfectly.&lt;/p&gt;

&lt;p&gt;A definite negative of Facebook abstinence, however, is that being out of the loop is tough — but not impossible. I’d often miss group related messages and invites. Deferring people to email is almost impossible with Facebook taking lead as the preferred means of group communication. That’s one thing it is very good for.&lt;/p&gt;

&lt;p&gt;Pros and cons aside, I feel that as a twenty-one year old, Facebook is on balance a necessary evil. Without it, I may be misjudged and misunderstood, and I don’t want either.&lt;/p&gt;

&lt;p&gt;Taking a year long break has forced me to get Facebook and other “stop gap” distractions under control and in perspective. Moving forward I hope to have a healthier, more productive relationship with them.&lt;/p&gt;
</description>
      <pubDate>2012-10-29 20:39:00</pubDate>
      <link>http://gosseti.com/facebook-hiatus</link>
      <guid>http://gosseti.com/facebook-hiatus</guid>
    </item>
    <item>
      <title>Tailor fitted SVG backgrounds</title>
      <description>&lt;p&gt;On the web, brand marks, logos, and icons are typically implemented using inline images or CSS backgrounds. The problem is that as screen pixel densities increase and become more fragmented, traditional techniques no longer cut the mustard. Raster graphics are often scaled beyond 100%, causing undesirable blur effects.&lt;/p&gt;

&lt;p&gt;Instead of creating several assets to cater for each density ratio, we really need two versions: one raster and one vector. Both the same size, just a different format.&lt;/p&gt;

&lt;h3&gt;Advanced caveat warning&lt;/h3&gt;

&lt;p&gt;This method is best suited for flat graphics that can easily be exported into SVG. The main caveat is that you’re loading two assets where only one is needed. However, these are shrunk drastically with gzip in effect. Uploading assets onto a CDN can also help with the concurrent request blocking commonly associated with mobiles.&lt;/p&gt;

&lt;p&gt;Modernizr is also required to feature detect SVG and background-sizing and provide class hooks for the CSS.&lt;/p&gt;

&lt;h3&gt;Time to sharpen up&lt;/h3&gt;

&lt;p&gt;We utilise the proportions of the inline image to create room for an identical background SVG. Check out &lt;span data-no-turbolink&gt;&lt;a href="/demos/envelope-window-svg"&gt;the demo&lt;/a&gt;&lt;/span&gt; for an exaggerated look at it in action. &lt;/p&gt;

&lt;h3&gt;The markup&lt;/h3&gt;

&lt;p&gt;A typical markup pattern for a logo uses an image wrapped within an anchor tag:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;a href=&amp;quot;http://example.com&amp;quot; class=&amp;quot;svg-mark&amp;quot; title=&amp;quot;Example&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;example.png&amp;quot; alt=&amp;quot;Example&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;The CSS&lt;/h3&gt;

&lt;p&gt;Using the proportions provided by the inline image, we can fit in an identical vector to the parent &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; element when SVG and background-sizing are supported.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;.svg-mark {
  display: block;
}

.svg.backgroundsize .svg-mark {
  background: url(example.svgz) no-repeat left center;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}

.svg.backgroundsize .svg-mark img {
  visibility: hidden;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;When Modernizr detects support for SVG and background-sizing, the image is styled with &lt;code&gt;visbility: hidden&lt;/code&gt;, allowing the crisp background vector to shine through.&lt;/p&gt;

&lt;p&gt;Depending on the size and positioning of the &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; element, try setting the &lt;code&gt;background-size&lt;/code&gt; to either: &lt;code&gt;cover&lt;/code&gt;, &lt;code&gt;auto&lt;/code&gt; or &lt;code&gt;100%&lt;/code&gt; to make it fit accordingly.&lt;/p&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;The markup is kept very clean. The only script dependency is with Modernizr, which has a small footprint when &lt;a href="http://modernizr.com/download/"&gt;custom built&lt;/a&gt; for production.&lt;/p&gt;
</description>
      <pubDate>2012-10-24 20:40:00</pubDate>
      <link>http://gosseti.com/tailor-fitted-svg-backgrounds</link>
      <guid>http://gosseti.com/tailor-fitted-svg-backgrounds</guid>
    </item>
    <item>
      <title>New site and return to blogging</title>
      <description>&lt;p&gt;My old site wasn’t any good for writing. WordPress got in the way and hindered me getting my words down onto the page. Its version of the TinyMCE (visual editor) often made a meal of my intended markup. I really just wanted to write Markdown from an unobtrusive admin interface.&lt;/p&gt;

&lt;p&gt;I tried searching for a solution that was simpler and could also have some creative control over. Ultimately, I decided the only way to truly get what I wanted was to create my own lightweight CMS.&lt;/p&gt;

&lt;p&gt;My decision to build this site on Rails was really to scratch an itch I’d had for a while. What was the minimum viable amount of code I could write to get the job done? All I wanted in my database was my blog posts and session data, so they’d be portable for future iterations. I wanted the back-end to be simple and clutter free. I essentially wanted to do less, but better.&lt;/p&gt;

&lt;p&gt;The design and front-end are very lean (there’s just under 120 lines of CSS and 15kb of JavaScript). I’ve gone all out on making it responsive from both a development and design perspective. The front-end performance has been one of my primary focusses.&lt;/p&gt;

&lt;p&gt;So, a week in the making and here it is. Moving forward, I’ll be tweaking, realigning, as well as writing about the build process.&lt;/p&gt;
</description>
      <pubDate>2012-10-17 20:42:00</pubDate>
      <link>http://gosseti.com/new-site-and-return-to-blogging</link>
      <guid>http://gosseti.com/new-site-and-return-to-blogging</guid>
    </item>
  </channel>
</rss>
