Monthly Archives: August 2010

You are browsing the site archives by month.

Re-thinking CSS, Can Javascript replace CSS or Simplify it?

Today Javascript is everywhere.  When the web was born you might have a browser that could support it, but so many browsers do, that it’s almost as common as HTML.  I think it’s been nearly a decade since I have developed a page without any javascript on it.  We use Javascript for core site menues, for google analytics for so much on the site, that if your browser didn’t support Javascript well you might as well not even browse the web.  Even our phones support Javascript, and if that is not enough, 500 million people a month use sites like Facebook that use Javascript to load content dynamicaly like a desktop application.

So now that we have established that Javascript is everywhere you want to be, and just about everyone has it enabled, you probably can say that it’s at least as common as CSS.

One of the core problems with CSS is how static it is, and how hard it is to get consistaint results between browsers, where as with Javascript all browser support the core of Javascript extremely consitaintly.  Infact the largest difference between browsers is found in the DOM ( Document Object Model ) for which CSS must conform to.  However with Javascript frameworks have been built to extend Javascript just enough to even create consitiansy at the Document Object Model.

To this point, it might make sense to actually describe page layout via a proper Javascript framework that can describe page layout consistiantly across browsers.  If this could be accomplished, then, we as web designers might finally be free from multi browser design.  I now for my self that designing for IE5, or IE6 can eat 80% of your dev time.  What cool sites could you design if you were 2-5x more productive?

Now, I am not saying that CSS will go away, but I am saying that for a number of design choices, Javascript might be the tool of choice, as it’s functionality could grow with the framework rather than at the rate of consistian browser implementation.

Consider implementing rounded corners via javascript, in FF, Opera, and Chrome you could use a CSS property, however in IE, you could programaticly solve the problem.  Consider box model consitiancy between the browsers, the framework could addapt quickly.

What about getting more lateral?  CSS can do alot, but what if you wanted to present data in a parrallaxed plane? These UX standards can be brought in easily with Javascript, and not CSS.

Maybe I am stating the obvious, but

Javascript is the new default design language on the web.