Hi,

For production site, CSS should be only one file per site, minimized and 
compressed (if browser supports gzip). It will reduce network load by size and 
by request count (including DNS if it is not cached or in different domain like 
CDN). Also, Google will rate this 
(http://googlewebmastercentral.blogspot.com/2009/12/your-sites-performance-in-webmaster.html)
For development, you can use as many files as needed (one per template + global 
css and libs like reset.css)
Splitting to many files will be better for merging team work, as every 
developer could work on his side of css. 

http://pagespeed.googlelabs.com/#url=http_3A_2F_2Fdemoshop.oxid-esales.com_2Fcommunity-edition_2F&mobile=false&rule=MinifyCss
as analysis says “Minifying the following CSS resources could reduce their size 
by 18.2KiB (21% reduction).” it could be saved by one unique user.

So my opinion: if you can provide 3 versions of CSS:
  1.. minimized by some tool 
  2.. compressed 
  3.. any needed layout for easy development
and also some instructions how to minimize CSS if somebody changes it

Mažvydas

From: Dainius Bigelis 
Sent: Thursday, June 16, 2011 4:43 PM
To: [email protected] 
Subject: [oxid-dev-general] Split CSS files to smaller ones

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 page…). 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 – 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 – is to use the dedicated tools for compiling the css files into one 
during deployment.

 

So – 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