Gossamer Forum
Home : Products : Gossamer Links : Discussions :

GLinks 3.x HOWTO: Overriding styles in CSS using custom.css

Quote Reply
GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
Since we've released the Gossamer Links 3.0 beta, I've seen a few custom.css files that various people have created. One of the things that I've noticed is that people are overriding more than they probably want to in their custom.css file.

Remember that the point of the custom.css file is to keep your custom changes separate allowing for easier upgrades. It allows us to make fixes and improvements to the core.css style sheet without overriding any changes that you've made. However, to make sure these changes make it through, you must make sure that you only override styles that you need changed.

For example, in core.css, the body's style is defined by:
Code:
body {
margin: 0px;
padding: 0px;
color: #33332e;
background: #ffffff;
font: normal 11px tahoma, geneva, verdana, sans-serif;
text-align: center;
}

If you wanted to change the background colour from white (#ffffff) to black then you would only add the following to your custom.css file:
Code:
body {
background: black;
}
rather than:
Code:
body {
margin: 0px;
padding: 0px;
color: #33332e;
background: black;
font: normal 11px tahoma, geneva, verdana, sans-serif;
text-align: center;
}
Why does this matter? Say, for example, we decide to change the margin to 5px in core.css, then you would not see this change, as you overrode it in your custom.css file when you copied it from the original style. By only overriding needed styles you not only keep your custom.css file shorter, but also make it easier to debug and manage upgrades.

Adrian

Last edited by:

brewt: Mar 17, 2005, 11:58 PM
Subject Author Views Date
Thread; hot thread GLinks 3.x HOWTO: Overriding styles in CSS using custom.css brewt 11662 Mar 17, 2005, 11:30 PM
Thread; hot thread Re: [brewt] GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
Jag 11356 Mar 18, 2005, 3:07 PM
Thread; hot thread Re: [Jag] GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
brewt 11253 Mar 18, 2005, 3:21 PM
Post; hot thread Re: [brewt] GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
Jag 11268 Mar 18, 2005, 4:59 PM
Thread; hot thread Re: [brewt] GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
aus_dave 10648 Oct 6, 2005, 11:12 PM
Thread; hot thread Re: [aus_dave] GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
brewt 10605 Oct 11, 2005, 4:30 PM
Post; hot thread Re: [brewt] GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
aus_dave 10560 Oct 11, 2005, 7:19 PM
Thread; hot thread Re: [brewt] GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
pugdog 11186 Mar 19, 2005, 12:41 AM
Post; hot thread Re: [pugdog] GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
brewt 11194 Mar 19, 2005, 1:30 AM
Thread; hot thread Re: [brewt] GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
rgbworld 11278 Mar 25, 2005, 6:41 PM
Thread; hot thread Re: [rgbworld] GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
brewt 11195 Mar 25, 2005, 7:00 PM
Thread; hot thread Re: [brewt] GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
erichcyber 10857 Jun 12, 2005, 1:27 PM
Thread; hot thread Re: [erichcyber] GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
brewt 10774 Jun 20, 2005, 8:46 PM
Thread; hot thread Re: [brewt] GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
erichcyber 10723 Jun 21, 2005, 11:29 AM
Thread; hot thread Re: [erichcyber] GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
pugdog 10728 Jun 21, 2005, 12:02 PM
Thread; hot thread Re: [pugdog] GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
brewt 10730 Jun 21, 2005, 12:14 PM
Post; hot thread Re: [brewt] GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
erichcyber 10746 Jun 21, 2005, 12:23 PM
Post; hot thread Re: [pugdog] GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
erichcyber 10726 Jun 21, 2005, 12:16 PM
Thread; hot thread Re: [brewt] GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
erichcyber 10804 Jun 12, 2005, 2:47 PM
Thread; hot thread Re: [erichcyber] GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
pugdog 10790 Jun 20, 2005, 2:24 PM
Post; hot thread Re: [pugdog] GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
erichcyber 10728 Jun 20, 2005, 3:02 PM
Post; hot thread Re: [brewt] GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
erichcyber 10806 Jun 20, 2005, 1:30 PM
Thread; hot thread Re: [rgbworld] GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
HyperTherm 11109 Mar 26, 2005, 2:19 AM
Post; hot thread Re: [HyperTherm] GLinks 3.x HOWTO: Overriding styles in CSS using custom.css
rgbworld 11112 Mar 26, 2005, 6:18 AM