</>
— Mar 3, 2014 —

CSS Resetting, Responsibilities and Respect

A brief discussion on the use of Paul Irish's '* { Box-sizing: Border-box } FTW' approach in the office this morning just sparked a thought in me, so I thought I'd write it down to share with you lovely people.

The impromptu discussion

Whilst a colleague was reviewing some code and browser testing, they noticed that the CSS Box Model was being set to box-sizing: border-box. To single out the sentence that fired my weird little brain off in another direction:

"Why would you change what the browser renders by default?"

We had a brief discussion on support for the rule and how it makes things consistent across all browsers, but that isn't what I wanted to write about...

We always change the defaults

Every time I write a line of CSS, I'm changing the defaults by which any individual browser renders a page. Even things as simple as colour and text-align are resetting those defaults.

This can become more and more complex as you go, putting properties like position, z-index and floats together can quickly become a complicated, and even fragile, layout structure.

And I'm sure that the majority of us now use CSS resets like Eric Meyer's or normalize.css to help us build from a more solid, cross-browser supporting foundation.

In CSS, every line you write is a reset

Every time we write a new line of CSS, we are overriding the base styles that have been set previously, whether that be by the browser or the previous rules in our own stylesheets.

A level of responsibility and respect

Just as we need to consider accessibility, usability and the user experience as we design and build websites, we need to consider the flexibility and robustness of our code.

We need to respect the thought processes of other developers and designers. Their brain may process problems in an method other than that of our own. They may have gone down a path which didn't work out, tracked back and explored a different path before reaching the workable solution that remained.

Even if we don't want to admit it, we all leave unwanted code in any number of the projects we work on. Put yourself in someone else's shoes. Imagine what they went through to get to where you have picked up from. Apply the frustrations and problems you've encountered in your own projects and how you'd love to go back and fix them.

Let's just give a little bit of slack to those that come before us, and do our best for those that follow.