Welcome to CSS Wizardry—Web standards design and development

The open/closed principle applied to CSS

21st June, 2012 in Web Development

A question that often gets asked of OOCSS is ‘What happens when an object changes?’. That is to say, if you have a basic object that underpins a dozen different components, what happens when changing that object will favourably impact one component, but negatively impact the other 11? With so much abstracted and shared CSS, simple changes to a base object can have massive ramifications across whole projects; how do you deal with that?

Well, the short answer is never change your base abstractions.

Continue reading this post →

By Harry Roberts in Web Development. Tags: , , , | 20 Comments »

Single-direction margin declarations

12th June, 2012 in Web Development

This morning I awoke to find Smashing Magazine had retweeted a tweet I made two months ago about how you should always try and apply margins in one direction only. This, like most rules in web development, is a very general (and breakable) rule. It’s even a rule you can opt not to follow at all, but after receiving a slew of Tweets asking why, I thought I’d write up why it’s a rule I live by, and one I’d recommend to anyone…

Continue reading this post →

By Harry Roberts in Web Development. Tags: , , | 37 Comments »

Keep your CSS selectors short

15th May, 2012 in Web Development

One thing I believe, as a very, very general rule of thumb, is that as sites get bigger, selectors should get shorter.

By this I mean that if you want to create extensible and maintainable, flexible and predictable websites, you should really take care to make your CSS selectors as dev-friendly as possible; i.e. short.

Keeping CSS selectors short helps with a lot of things:

Continue reading this post →

By Harry Roberts in Web Development. Tags: , , , , | 25 Comments »

Front-Trends 2012

29th April, 2012 in Speaking

Last night I landed back in a cold, miserable Leeds after spending what was by far the most exciting, amazing and fun few days I’ve ever had—as a speaker at Front-Trends.

Some time last year I was invited to speak at the conference, the first of its type I have ever spoken at; ‘nervous’ doesn’t even come close.

I delivered my talk—Breaking Good Habits—to 470 people! My only previous speaking experience was in the tiny English town of Barnsley to a small room of no more than 50. This was the most terrifying thing ever (and there are over a hundred people out of shot).

Continue reading this post →

By Harry Roberts in Speaking. Tags: | 7 Comments »

The single responsibility principle applied to CSS

28th April, 2012 in Web Development

Having just spoken at the Front-Trends conference in Warsaw, I’ve decided to expand on something which my talk mentioned a lot: classes.

My talk covered how to build big, scalable front-ends and one of the key factors involved in doing so is sensible and generous use of abstracted classes. One thing that really helps you achieve this is the application of the single responsibility principle, a method used mainly in OO programming.

Continue reading this post →

By Harry Roberts in Web Development. Tags: , , , , | 36 Comments »

Hi there, I am Harry Roberts. I am a 21 year old web developer from the UK. I Tweet and write about web standards, typography, best practices and everything in between. You should browse and search my archives and follow me on Twitter, 7,791 people do.

via Ad Packs