I am developing a large-scale RIA application using Ext JS 4. Inside my index.html I've the following definitions:
<link rel="stylesheet" href="ext/resources/css/ext-all.css">
<link rel="stylesheet" href="ext/src/ux/grid/css/GridFilters.css">
<link rel="stylesheet" href="ext/src/ux/grid/css/RangeMenu.css">
<link rel="stylesheet" href="resources/css/default/index.css">
<link rel="stylesheet" href="resources/css/default/profile/user.css">
<link rel="stylesheet" href="resources/css/default/profile/documents.css">
The problem
In provided code only index.css
is present, but each view in my application will have its own CSS stylesheet, which will use its own sprites/images (I've added user.css
and documents.css
in provided code as example). That all will grow into a huge amount of not minified CSS files, which will slow down application loading time significantly.
Also, some styles of Ext JS 'ux' components are not included in ext-all.css
(GridFilters.css
and RangeMenu.css
in provided code).
I can write down a script, which will compress all these CSS files into one file, but ...
The question
- Which is the correct way for styling Ext JS 4 applications? Maybe one should create
SCSS
files and do all styling there, and compile each time withcompass compile
to create CSS files and do development? - Is there any way to include styles for 'ux' components which comes in standard Ext JS 4 distribution? Some thing like
ext-all.css
for 'ux components (something likeext-ux-all.css
)
I hope many people are using Ext JS to create great applications and they've thought about or solved such problems for themselves. I'll be grateful for any share of knowledge regarding this topic.