Relativity

For a long time I’ve been trying to make the transition from sizing with pixels to the relative world of ems. My progress has always been hindered by the fact it normally means you need to work with a calculator by your side whilst dealing with ridiculous fractions, coupled with the fact I have the patience of a 5 year old.

Why Bother?

Good question, why bother with relative units? Most browsers these days will scale up pixel-based designs, treating them as if they were relative.

A reason people give for using relative units is the fact you can change the base font size and everything scales up or down with it. So as your viewport gets smaller you can use a media query to scale everything down. But with the advent of css pre-processors like sass, this is no longer a valid argument and can easily be achieved using pixels.

The real reason is that a pixel no longer means one physical pixel, and with more and more hi-dpi displays in the wild this is becoming more obvious. Strangely enough a pixel is actually a relative unit, albeit to the resolution of the display. If it wasn’t, pixel-sized text would appear tiny on a high-dpi (e.g. retina) display. The pixel has lost it’s meaning so we need to adopt a more appropriate unit.

REMS

I’m a little late to the party, but I’ve recently been introduced to the rem (root em) unit. With most browsers now supporting rems, thing’s have become a hell of a lot easier. Everything you size with rems is relative to the root element, rather than with ems where each size is relative to the parent element, which causes major brain-ache when putting margins or padding on text (and also maintaining a baseline grid).

With rems this means we can set the html font-size to 62.5%, as shown by Jonathan Snook, then by dividing each pixel size by 10 we can get the equivelant rem size:

html { font-size: 62.5%; }
body { font-size: 1.4rem; } /* =14px */
h1   { font-size: 2.4rem; } /* =24px */

This is great, but we are still working around pixels, if we are going to make the transition we might as well put rems first. Fortunately we now have css pre-processors like sass to help us out.

We can use sass to calculate our pixel to rem conversations in-line. So if our html font size is back at 100%, and we wanted to convert 24px to rem we just divide it by 16 (the default pixel size):

h1 { font-size: 24 / 16 + rem; }

Because support for rem’s (unlike those smug ems) isn’t quite widespread enough for the time being we still need to provide a pixel fallback. We can simplify this process with a sass mixin

@mixin font-size($FontSizePixels) {
    font-size: $FontSizePixels + px;
    font-size: $FontSizePixels / 16 + rem;
}

We feed the mixin the pixel font size, and in return it first gives us the pixel font size for backwards compatibility, then the rem size which will override it if supported by the browser.

EMS vs REMS

There is the possibility for both to work in unison, using rems for type and ems for padding/margin relative to the font-size could prove quite useful. Although I haven’t tried to get my head around how it would be possible to stick to a baseline grid with this method.

Using rems is definitely the most accessible method (especially for us designers) for moving on from pixels and sizing relatively.

Testing IE

Until now, every time I’ve had to test in IE I’ve made a new trial account over at browser stack. Whilst it’s a great service, a monthly plan is excessive for smaller studios who will only use it once or twice a month. A pain free solution I found on osxdaily.com, gives you access to all versions of IE at the cost of a few GB’s and a little time.

1. First, download Virtual Box

2. Next, open up Terminal and enter this line to install all versions of IE

curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | bash

Alternatively, for IE 7 only:

curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | IEVMS_VERSIONS="7" bash

IE 8 only:

curl -s curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | IEVMS_VERSIONS="8" bash

IE 9 only:

curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | IEVMS_VERSIONS="9" bash

This will take a while depending on your internet connection, but once it’s done open up Virtual Box and you will have a virtual machine for each version of IE.

These versions of windows are all unregistered - once the 30 day trial period runs out, you can return to the snapshot that was automatically created on install.

Why I love Vine

Almost two weeks ago Twitter launched it’s new service, Vine. As with every one of the hundreds of new services and apps, I expected to download it, have a look around, and then delete it. But this was not so with Vine.

Vine allows you to take a 6 second video in increments, much like a super 8 video camera. There is no editing, you can’t upload from the camera roll and you have to upload straight away.

Embracing Limitation

Twitter’s success is due in part to its 140 character limit, it defines it as a service. It’s so easy to share something knowing that you only have a certain amount of space to do so, and in turn it’s so easy to consume that short bit of information.

This is what’s so great about Vine; it’s easy for anyone to document or create something interesting with a 6 second video limit, and I’ve been captivated by the feed of animation, 6 second sketches, and documentation of people and places from around the world (specifically Adam Goldberg, follow him and watch his videos from the bottom-up).

The limitation fuels people’s creativity.

Will it last?

Will it out-live the novelty factor? Hopefully.

Imagine being able to pinpoint a place in the world and being able to view all the video’s coming from that place using geolocation. You can do this with twitter and images now but you don’t really get a feel for what’s really happening. Imagine being able to bypass the media and get first hand, live video reports from events around the world.

There is of course plenty of other services that allow you to record and upload video publicly, but there were also blogs before twitter - the almost instant nature of recording and uploading will make Vine popular, and with its popularity it will hopefully become a platform for many important, exciting, and funny things.

Please don’t ruin it

I’ve seen a lot of people requesting an editing feature, or the ability to upload videos. This will absolutely ruin Vine, and is what stops Instagram from being so Insta. You are forced to think about what you are shooting, and then forced to upload right away. So when someone uploads a video you know undoubtedly that it was shot very recently.

I like Chocolat

I’ve been waiting for the perfect text editor for a long time, I love Espresso and before that - Coda. Espresso being only a trial version not wanting to shell out £50 with Coda 2 just around the corner (maybe?). But then I discovered Chocolat. mmm

Having recently tried sublime text, I found out how potentially awesome a column layout would be for coding. You could have your base css in the first column, then the next media query css in the adjacent column, followed by the html in the third column. All nice and tidy, but unfortunately sublime text just felt really horrible with weird shortcuts and menus, due to it being a non-osx native app.

I like columns

Then comes along this handsome fellow, Chocolat, with his multi-column editing (just select multiple files in the left hand menu whilst holding cmd), and as a bonus you can have an auto-updating preview pane on the far right, shwing!

This is perfect for a mobile-up approach to front-end coding, as the column only needs to be skinny to begin with. Although with it’s full screen mode and a 27” screen, I can pretty much fit in a css column, html column, and a decent size web preview for a lovely focused workspace.

Go grab a copy

VSCO for iPhone

Visual supply co have just released their iPhone app following on from the success of VSCO film for Aperture and Lightroom.

They deal in film stock emulation, and they do a pretty good job of it. VSCO Cam is the photo app I’ve been waiting for - no over-the-top garish instagram filters to be found here.

The interface feels a little sloppy and doesn’t share the quality of the filters themselves. Some icons are badly chosen, for example - the import photo looks like export photo, and the speech bubble makes me think comment - not share. But I have faith that these details will be ironed out in time.

p>After spending a little time playing with it and seeing the results, especially of professional photographers, I’m pretty certain this will change the way a lot of people see iPhone photography.