papandreou
14 May 2009, 12:51 AM
There's no doubt that the division into structural and visual css files makes a lot of sense, but it has a serious drawback for my build system because the background-image url()s in the stylesheets are wrong when the source css files are included directly, ie. when not simply using /resources/css/ext-all.css.
Here's an example from /resources/css/visual/button.css:
.x-btn-tl, .x-btn-tr, .x-btn-tc, .x-btn-ml, .x-btn-mr, .x-btn-mc, .x-btn-bl, .x-btn-br, .x-btn-bc{
background-image:url(../images/default/button/btn.gif);
}
Since url()s in css files are relative to the location of the stylesheet, this resolves to <ext dir>/resources/css/images/button/btn.gif, which is obviously wrong (should be /resources/images/...). Of course it works when everything is naively concatenated into <ext dir>/resources/css/ext-all.css, but in my opinion that's not good enough for at least two reasons:
1) Custom build systems that rewrite url()s in css files are going to have problems.
2) It's just good sense to have things work when the css files are used directly, for instance during development.
I propose that you either revert to the old /resources/css layout or make your build system powerful enough to rewrite url()s when the bundles are created. It's not that hard -- the css files are mostly free of hacks and parse cleanly.
Best regards,
Papandreou
Here's an example from /resources/css/visual/button.css:
.x-btn-tl, .x-btn-tr, .x-btn-tc, .x-btn-ml, .x-btn-mr, .x-btn-mc, .x-btn-bl, .x-btn-br, .x-btn-bc{
background-image:url(../images/default/button/btn.gif);
}
Since url()s in css files are relative to the location of the stylesheet, this resolves to <ext dir>/resources/css/images/button/btn.gif, which is obviously wrong (should be /resources/images/...). Of course it works when everything is naively concatenated into <ext dir>/resources/css/ext-all.css, but in my opinion that's not good enough for at least two reasons:
1) Custom build systems that rewrite url()s in css files are going to have problems.
2) It's just good sense to have things work when the css files are used directly, for instance during development.
I propose that you either revert to the old /resources/css layout or make your build system powerful enough to rewrite url()s when the bundles are created. It's not that hard -- the css files are mostly free of hacks and parse cleanly.
Best regards,
Papandreou