Site maintenance: Sun 15 Nov, from 20:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Templates, Stylesheets, Page Layout / Combining Stylesheets

Combining Stylesheets

Locked

Started by neighbornick on 23 Mar 2009, 4:04 PM · Views: 998

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
23 Mar 2009, 4:04 PM
#1
neighbornick avatar

neighbornick

Zen Follower

Join Date:
Dec 2008
Posts:
93
Plugin Contributions:
0

Combining Stylesheets

Hey Guys,

I have the following stylesheets I want to combine:

Stylesheet.css
Stylesheet_tm.css
StyleSheet_main.css

To combine them do I just paste the codes of the other two style sheets into the stylesheet.css file?

Thanks,
Nick\

23 Mar 2009, 4:12 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Combining Stylesheets

Essentially, yes. If there are any overlapping or conflicting rules, the last one will generally win, so check what selectors are in the various stylesheets and resolve any conflicts first. The stylesheets are loaded in alphabetical order, so you know how they are currently interacting.
Even though fewer stylesheets is a good idea, it might make it more difficult to find some things if you have to search through a 3x-longer main stylesheet. On the other hand, it might be easier to have only one file to search for rules...

23 Mar 2009, 5:35 PM
#3
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Combining Stylesheets

gjh42:

Essentially, yes. If there are any overlapping or conflicting rules, the last one will generally win, so check what selectors are in the various stylesheets and resolve any conflicts first. The stylesheets are loaded in alphabetical order, so you know how they are currently interacting.
Even though fewer stylesheets is a good idea, it might make it more difficult to find some things if you have to search through a 3x-longer main stylesheet. On the other hand, it might be easier to have only one file to search for rules...
Generally you dont search :p, you use firebug or IE developer tool kit to see which rules are being applied, and where they are defined.

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

23 Mar 2009, 6:30 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Combining Stylesheets

Or if you haven't implemented the developer tools, you search the stylesheet... and the longer the file is, the more lines you have to scroll through to get to them in any case.