Generated Content by David Storey

box-sizing: border-box; the results are in

A week has passed since I created a poll on the use of box-sizing: border-box. In that time 256 people filled out the survey. The results so far are as follows:

Use box-sizing: border-box? Yes No
Currently personal project 71% 29%
Future personal project 88% 12%
Future team project 85% 15%
Future public project 60% 40%

In the table above, a team project is one which the developers are known to the person making the decision, such as developers in the same company or a group of friends with which you can work closely. A public project is one which developers could be anyone that you may not be able to personally communicate the usage, such as an open source project or a public API.

Although not a conclusive sample size, the signs are that developers are comfortable with and use (or are planning to use) the border box model, and are happy to use it in team projects. It surprises me a little how many developers actually already use it. The number of developers in favour of using the border box model in pubic project with potentially unknown developers drops, but is still 20% higher than those that wouldn’t. If these results signify anything, don’t be surprised if you see more projects spring up using the box model formally known as broken.

Although developers are largely in favour of using box-sizing: border-box, a sizeable number have mentioned that they’d only use it where needed, rather than blanket applying it across the whole document with the universal selector. A few mentioned it can break jQuery plug-ins, so that may limit adoption on jQuery-based sites. While a few others mentioned they would use it if its use was documented, such as with KSS comments (always a good practice when working with teams, or even solo projects if you’re going to have to maintain your code).

I will leave the poll open for now, in the hope of collecting a larger sample. As the results have largely stayed 60–40 in favour of the old IE box model throughout the life of the poll, I don’t expect the result to change significantly however.

  1. dstorey posted this