Selector namespacing with cssutils

44 views
Skip to first unread message

dotless-vienna

unread,
Dec 20, 2010, 2:12:33 AM12/20/10
to cssutils
Hi,

I'm using various third-party Javascript UI widgets in my web
application, all of them bring their own external stylesheets.
Unfortunately, some widgets have the annoying habbit to define some
styles with global selectors or use different JQuery UI CSS themes
that overwrite each other.

In my HTML, I already surrounded each widget with a "namespacing" div
(e.g. <div class="grid-widget"></div>). What I like to achieve with
cssutils is to establish this namespacing in the css files of the
widgets:

- element selectors like table, iframe etc should be prefixed with
their widget namespace class (e.g. .grid-widget table)
- "top level" selectors such as body, * should be replaced with the
widget namespace class
- all jquery ui styles should also be restricted to the widget
namespace

Since I fetch new versions for my widgets, I'd like to automate these
css transformations with a python script. Is there any cssutils
example for this purpose?

Franz
Reply all
Reply to author
Forward
0 new messages