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.
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…
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:
- Increases selector efficiency
- Reduces location dependency
- Increases portability
- Reduces chances of selector breakage
- Decreases specificity
- Can make code more forgiving
29th April, 2012 in Speaking
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).
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.