Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

CSS for each section

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 07-06-2010, 03:16 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default CSS for each section

So i thinking that since there is 5,000 lines of code and you don't need half of it I would re-work the CSS.

So Im thinking about having different style sheets for each section, and then putting an if statement in css_service.tpl.

So a style sheet for the home page, categories, product, cart... etc.

This would make the CSS much less, but would also greatly increase maintenance by having to update more style sheets.

Any suggestions, or ideas on how to improve the CSS for x-cart?

Ash
__________________
xcart 5.1.2
Reply With Quote
  #2  
Old 07-06-2010, 04:25 PM
 
Shamun Shamun is offline
 

X-Adept
  
Join Date: Jun 2009
Location: North Carolina
Posts: 841
 

Default Re: CSS for each section

Having a seperate style sheet for each page would increase overhead and ultimately alot of the styles would be repeating, so why not just use one?
__________________
- Shane Munroe
Reply With Quote
  #3  
Old 07-06-2010, 06:55 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: CSS for each section

Isn't that why the dang thing is 5,000 lines long in the first place? All the sectionsa re combined into one style sheet.
__________________
xcart 5.1.2
Reply With Quote
  #4  
Old 07-06-2010, 07:03 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: CSS for each section

For example, for your home page, 80% of it is not used. There has to be a solution to this.
__________________
xcart 5.1.2
Reply With Quote
  #5  
Old 07-07-2010, 04:38 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: CSS for each section

Any suggestions? seem to me like most of it never used any ways? should I just go thru and clean it up?
__________________
xcart 5.1.2
Reply With Quote
  #6  
Old 07-08-2010, 11:23 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: CSS for each section

The best way to clean it up would be to rewrite it all entirely. The safest way to clean it up is to break it up as you've specified but have a core style sheet for common styles. So you'd end up with:
common.css (layout)
product.css
cart.css
category.css
etc.

Each page would have 2 css files (common + supporting file) containing CSS that is actually used.

main.css is the func.php of x-cart verions < 4.0 in terms of bloat.
Reply With Quote
  #7  
Old 07-11-2010, 04:33 PM
 
Sisom Sisom is offline
 

eXpert
  
Join Date: Sep 2006
Posts: 310
 

Default Re: CSS for each section

I don't see why you shouldn't just use one CSS file for the entire site, and use comments in the CSS for each section.
I believe that there are 5,000 lines in the main.css file because it covers all the different templates that come free with X-Cart - is that correct? If it is, it seems like the wrong way to do it - a better way would be to have a separate CSS file for each template, and only call the CSS file which fits each template.
__________________
X-Cart Gold Version 4.3.2
Reply With Quote
  #8  
Old 07-11-2010, 04:40 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: CSS for each section

Yea, it is severe bloat. I've cut it in half just by removing duplicate, obsolete or poorly written classes. I also stripped out all of the add-ons and put them in separate stylesheets. Of course, I need to do this all again for 4.3 and 4.4. Fun fun.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #9  
Old 07-11-2010, 04:43 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: CSS for each section

Yes it's a bit annoying how screwed up it all is.
__________________
xcart 5.1.2
Reply With Quote
  #10  
Old 07-14-2010, 09:34 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: CSS for each section

Hi Ashley -

How about this approach:
1 - Start out with a css reset
2 - Strip out all css associated with modules and addons to their own unique file. So any css associated with a module which can be enabled or disabled in the administration's module page has its own css file. (FLC is treated as an addon - not its own css file.)
3 - The individual css files are enabled/disabled in css_service.tpl depending upon if the module is enabled or disabled in the cart.
4 - The cleaned up reset/main.css file is loaded first - at the top of the cascade
5 - The module css files are loaded next
6 - Any required skin/template css file is cascaded on top after that
7 - A clean css is loaded where the individual designers can add their own css if they want to minimize changes to your standard files.
8 - When the site goes into production mode - an addon that aggregates and compresses the css files is applied (or you have to do it manually)
9 - Browser adjusted css files are cascaded last based on the browser in play - I am not sure if these can be aggregated since they are loaded at run time based on the browser - but they can at least be compressed. (Should not be too big anyway)

10 - To debug - you have the ability to go back and load the original css files

(I think this is close to Balinor's method - except that maybe the aggregation and compression could be added to the flow.)
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:13 PM.

   

 
X-Cart forums © 2001-2020