Hi Dainius,

as the others already wrote, cascading the styles and removing redundant code 
might already reduce the css file size and make it much easier to adjust the 
whole design (e.g. only having to change two or three styles for the background 
color, instead of having to change that dozens of times).

The ability to override styles by loading an additional, custom css file after 
the default ones makes it fairly easy to change the look and feel of the shop 
without changing the original files (making it easier to update the shop when 
patches and updates are released - the less has been changed, the less needs to 
be reviewed for changes).
What makes this difficult is the use of "!important" in the css files, as such 
styles cannot be overridden. If you plan to check the stylesheets for 
simplification, then try to remove the !important styles if possible...
By the way: I've just checked, and the 4.5.0 seems to contain only two 
!important styles, so that's probably not a problem anymore. Just wanted to 
note that, because we had some trouble with such styles a while ago ;-)

If you split the css into several files, and only include those that are needed 
for the current page, then please keep in mind that shops tend to be customized 
a lot ;-)
There are shops that change the layout and display topsellers on pages where 
the original version didn't show them, etc.
So if you omit some stylesheets, then you might end up with pages where styles 
are missing, because the shop has been customized to show stuff that isn't 
"expected" on that page.
If you load all the styles on every page, then you don't have that problem. If 
you load only some stylesheets, then you would need to provide a hook (e.g. a 
getter method in oxView or oxUBase) that can be overloaded by a module class to 
specify additional stylesheets to load...

As for the number of css files and using compressed stylesheets: maybe its best 
to setup a small test environment and run some benchmarks... However, I doubt 
that the impact will be that high... most of the load time will still result 
from php scripts I guess ;-)

Beste Grüße aus Dortmund!
Robert Rosendahl | Entwicklung u. Support

--
anzido GmbH
Kirchhörder Str. 12
44229 Dortmund
Tel.: 0231 - 60 71 079
Fax.: 0231 - 60 71 081
Mobil:0176 - 8325 1488
Email: [email protected]
Web: http://www.anzido.com/ (http://www.anzido.com)
USt-ID: DE257982972
Geschäftsführung: Andreas Ziethen
Amtsgericht Dortmund HRB 20883

-----Ursprüngliche Daten-----
Datum: 16.06.2011 15:43:45
Von: Dainius Bigelis <[email protected]>
An: [email protected] <[email protected]>
Betreff: [oxid-dev-general] Split CSS files to smaller ones
Vorgang: T-RJBY6ROEBV-04

> Hi,
>
> Currently we are working to improve the code and structure of CSS files.
>
> Just we are not sure about one idea, that we want to implement, so we would 
> like to ask you about your opinion regarding that.
>
> Currently (in eShop 4.5.0 verson) we have ~10 css files, where one of these 
> (elements) have ~4000 lines of code.
>
> Making any change in that and maintain it became really difficult for 
> developers.
>
> So we thought that would be good to split this file to the smaller ones 
> (according the type of elements) and change the structure of other files.
>
> As a result of that would be 3-5 files according to the type of page (details 
> page, list, checkout, main pagehellip). These files would do nothing, just 
> include the smaller css files for elements, which are really used used in 
> this particular page.
>
> The advantage of such structure:
>
> - Much more easy development/changes and maintenance;
>
> - Scalability of pages, as elements which are not needed in this page would 
> not be loaded (i.e. elements used only in checkout would not be loaded in 
> details page).
>
> Disadvantage:
>
> - There are some ideas, that loading more files may reduce the performance. 
> But we think that such effect may be noticed only during the first load of 
> the page and then it is cached. But considering what we have now ndash it 
> parses all the long (4k lines) file even of some big part of this is not 
> needed in the page.
>
> Also, one of solutions to work with smaller files and deliver one file as 
> result ndash is to use the dedicated tools for compiling the css files into 
> one during deployment.
>
> So ndash please tell your ideas about this concept or any arguments for one 
> or other solution.
>
> Best regards,
>
> Dainius Bigelis
>
> _______________________________________________
> dev-general mailing list [email protected] 
> http://dir.gmane.org/gmane.comp.php.oxid.general
_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general

Reply via email to