[dojo-contributors] cssIgnoreImport

Dustin Machi dmachi at sitepen.com
Wed May 6 10:59:59 EDT 2009


In discussions with a customer, we noticed that in the tundra.css the  
dijit.css import is ignored.  After a little bit of tracing, this  
comes down to being ignored by the buildscripts via a  
cssIgnoreImport=../dijit.css option that we use in build-release.sh.   
While I can see some utility in being able to set an import to be  
ignored like this, I'm not sure it should be used on our release  
files, but I am trying to understand the reasoning for it being done  
this way.

At a minimum, we should probably document how people should use this  
with and without a custom build.   From my perspective, it seems that  
the only reason to exclude the flattening of the dijit.css import in a  
theme would be so that the dijit.css could be pulled in independently  
at one time and then let the tundra.css (or another theme) be loaded  
later without duplication of that css.  However, with the current  
case, trying to do this would end up with duplicate css requests (the  
initial direct linked dijit.css and then the imported one from  
tundra).   The only time separation of these two things really seems  
beneficial is if you want to change themese at runtime.  Keeping them  
separate would make that easier to do.  Though in this case, it seems  
like we would still end up loading dijit.css for each theme anyway.  I  
don't think that usecase outweighs the majority of pages that don't  
allow the theme to change at run time, and as I mentioned it doesn't  
seem to work right anyway.

In the end this comes down to a lack of any way to really do  
intelligent css builds, but for now it seems like we should just  
remove the import from tundra.css (and other themes) or let it get  
interned as with the rest of the files.
One alternative would be to have cssStripImports=../dijit.css, which  
would simply remove any matching import statements instead of ignoring  
them.  This way the default would just flatten as normal and inlcude  
dijit.css in the tundra.css file, but if someone wanted to load  
dijit.css separately, they could use cssStripImports to remove those  
things they don't want to be imported automatically.  Then they can  
take care of loading them when they want.

All this said, perhaps I'm missing some reasoning behind this option/ 
implementation and would be glad to hear about why that might be.

Thanks,
Dustin




More information about the dojo-contributors mailing list