Further Defence of Scoped CSS!

April 27, 2012 - By

It’s probably obvious where I stand on this topic: I was the author of CSS-Tricks post ‘Saving the Day with Scoped CSS‘, and I got an honourable mention in the WIRED article ‘HTML5 Offers ‘Scoped’ CSS for Precision Styling‘. I’ve done more than just author a post though, I’ve kept up the conversation in the comments, and by searching what people are saying on Twitter. I think it’s safe to say not everyone is enthusiastic as I am, and I love that.  It’s awesome to see other perspectives.

I wanted to share a few thoughts that I’ve had as a result of these conversations. 

Judging by the comments, and Twitter buzz on the topic i think there will be many many posts opposite mine, along the lines of ‘Destroying Sites with Scoped CSS‘. I’m not convinced that everyone who shared this sentiment read the full pros / cons in my article, but they certainly have a point. Scoped CSS could be (and yeah, will be) a disaster in the right hands.

Yes, Scoped CSS can be used in terrible ways. Yes, it can create the same kind of chaos that inline styles do – but that’s not to say it’s a terrible idea automatically. Everything has its place when used properly! Inline styles are used everyday brilliantly with jQuery for example. Name a tag or an element and I can abuse it. I don’t even think that in itself is automatically a bad thing either. In fact, using elements to the extreme can become artistic and inspiring!

This isn’t the early nineties, Scoped CSS wasn’t invented “just because we can do it”. Maybe the good folks at the w3c finally trust us again after that whole “table layout” fiasco! The Internet, its audience, and its developers are getting more mature. I think we can handle this a lot better than we have with things in the past.

I love web standards, and doing things the proper way for client’s sites, but I don’t think we should lose sight of the fact that we can experiment and break the mould to try different things. Making websites is one of the funnest things on the planet. When we dismiss something as stupid without giving it a shot, we are just robbing ourselves of a chance to expand our horizons and think in a new way.

Scoped CSS is the new kid on the block, I think we should be a little more welcoming, and get to know him better before judging. I’m certain that all that we’ve covered on the topic so far is the tip of the iceberg – I bet there’s someone out there willing to use it, and explore who will change the way we think about scoping styles again.

Let’s not dwell on the negative. Cautious optimism is really fun.

I for one am still excited to see what the future holds for this new element.

Categorized in:

This post was written by ArleyM