Selector namespacing with cssutils

已查看 46 次
跳至第一个未读帖子

dotless-vienna

未读,
2010年12月20日 02:12:332010/12/20
收件人 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
回复全部
回复作者
转发
0 个新帖子