Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#5538 closed enhancement (fixed)

Insulation from browser specific stylesheet manipulation

Reported by: ptwobrussell Owned by: alex
Priority: high Milestone: 1.2
Component: Dojox Version:
Keywords: Cc: ptwobrussell@…
Blocked By: Blocking:

Description (last modified by Mike Wilcox)

I ran into an interesting use case today where I needed to dynamically create *classes* (because I was using dojo.query extensively to track/maintain state) on they fly, and there was no possible way that these could be known a priori. In doing so, I quickly learned that there wasn't a toolkit provided mechanism for insulating you from the FF vs IE way of dynamically creating classes by manipulating a particular stylesheet (insertRule vs addRule -- both with different params).

This article sort of summarizes the issue:

http://www.javascriptkit.com/dhtmltutors/externalcss2.shtml

Unless I've missed another better way of doing this, it seems like a good addition to Base perhaps? Something like dojo.createCSSRule maybe?

Anyway, I'd be interested to hear your thoughts on this, and in case you agree, I wanted to go ahead and file it as a ticket so I could track it.

Change History (4)

comment:1 Changed 12 years ago by alex

Milestone: 2.01.3

Milestone 2.0 deleted

comment:2 Changed 11 years ago by Mike Wilcox

Component: CoreDojox
Description: modified (diff)
Milestone: 1.31.2
Resolution: fixed
Status: newclosed

Committed revision 14465:

Implementing dojox.html.styles. Insert and remove CSS rules Search document for style sheets Toggle sheets on and off (based on the W3C spec) Includes two tests: test_styles.html which goes though most of the functionality of rules and sheets; and test_themes.html, which demonstrates the W3C manner of toggling style sheets, with the dojo themes."

html/styles.js html/tests/test_styles.html html/tests/test_themes.html

comment:3 Changed 11 years ago by dante

does this have any overlap with dojox.data.css ?

comment:4 Changed 11 years ago by Mike Wilcox

Yes, there's overlap. There is some functionality with toggling style sheets on and off. But mostly it's a way to manage css without a data store.

Tom and Adam are consulting about it.

Note: See TracTickets for help on using tickets.