Wednesday, 30 January 2008

What I would like in CSS3 - Save Restore State

Many years ago I was involved in creating Postscript systems, I even wrote my own postscript rendering system at one time (Postbox).

Now I work with websites and web developers, and one of the capabilities I miss from my postscript hacking days is the ability to save and reset the graphics state. 

Some background. 

I work for a large internet publisher, designing and recommending authoring and production systems for folks producing millions of pages of content a year. Increasingly we are moving towards component based page assembly, where pages are assembled from a library of modules that conform to common interfaces and common presentation standards.

A module may be standalone, or may have to interact or inherit design elements (colour pallets, fonts etc) from the overall page design. Trying to maintain a modular library is a nightmare because of the need to ensure that all variations of the modules on a page are supported by the active cascade running on the page.  

Module libraries are relatively easy to manage when you have 10's of modules to support, only a few production staff, and a limited set of design variations between pages. But extend that to 10's of thousands of modules, thousands of production staff, and hundreds of basic site designs and you soon discover that uniquley crafted CSS cascade descriptions are unmanageable. 

We have put a lot of research into designing suitable mechanisms for automatically building a pages CSS descriptions from the manifest of modules installed on the page, but this is itself a complex task. 

Sandboxing content

Sadly this could all be eliminated if there was a simple way to reset the cascade associated with an id back to the browser default, so that in-line CSS could be used to describe the behavior of the visual area enclosed by the div or span. Coupled with a simple mechanism for referencing particular cascade elements across the reset, to allow the sub-region to selectively pickup characteristics from the main layout, a simple and powerful mechanism would emerge that that would aid the portals in their quest to create dynamic content. 

This would also boost the adoption of personalization, allowing complete layouts to be individualy defined for users. 

I strongly feel that this should be a capability that is included in the CSS3 specification.

UPDATE: So here we are 8 years after this original post, and the capability i was looking for has finaly made an appearance, though not quite in the way i expected.  Checkout the ShadowDom initiative which provides the kind of presentation sandboxing i was seeking.  See below for more information.

No comments: