
Originally Posted by
Stevie D
What I mean by that would be the option to set out the basic colours for your site once and then refer to them by name/code throughout the stylesheet. So you could have something like:
Code css:
define-color["headings"] {color:#060;}
define-color["subtle"] {color:#afa;}
h1 {font-size:2em; color:"headings";}
h2 {font-size:1.5em; color:"headings";}
#footer {font-size:0.8em; color:"subtle";}
and then if you wanted to change the colour theme for the whole site you wouldn't need to worry about hunting down every last reference to #060 because you would just need to change it once. Not that I expect to see it happen 

Originally Posted by
YuriKolovsky
Having options to set colors would also work if CSS just had variables, which would come in handy for more than colors. Someday maybe

Or maybe today. 
320andup gives a great example on how to harness SASS to that end.
http://stuffandnonsense.co.uk/projects/320andup/
Excerpt from
_variables.scss
Code:
// 3. COLOUR ==============================
$basecolor : rgb(45,53,62);
$compcolor : adjust-hue($basecolor, 180);
$bordercolor : lighten($basecolor, 60%);
// Links
$linkcolor : rgb(1,53,104);
$linkcolorhover : darken($linkcolor, 10);
$linkcolorvisited : darken($linkcolorhover, 10);
$linkcolorfocus : darken($linkcolorvisited, 10);
// colour palettes
$alertcolor : rgb(252,248,227);
$errorcolor : rgb(218,79,73);
$infocolor : rgb(217,237,247);
$inverscolor : rgb(65,65,65);
$successcolor : rgb(91,183,91);
$warningcolor : rgb(250,167,50);
Excerpt from
320andup-csss.scss
Code:
// Colour interaction semantics
@import "colour";
Excerpt from
_colour.scss
Code:
/* Colour =================================================== */
// 1. ROOT ==============================
// 2. TYPOGRAPHY ==============================
// 3. COLOUR ==============================
a {
text-decoration : none;
color : $linkcolor;
&:visited {
color : $linkcolorvisited; }
&:hover {
text-decoration : underline;
color : $linkcolorhover; }
&:focus {
outline : thin dotted;
color : $linkcolorfocus; }
&:hover,
&:active {
outline : 0; }
}
::-moz-selection {
background-color : lighten($basecolor, 65%);
color : $basecolor;
text-shadow : none; }

Originally Posted by
YuriKolovsky
but now when everything is dynamic, styling can be dynamic too
320andup to the rescue again.
Look at the less folder for some great implementations of dynamic style with LESS.

Originally Posted by
YuriKolovsky
Could someone help me understand if the clients method has any major drawbacks or benefits or is his way of writing CSS better than mine?
So that I can decide what kind of CSS to continue writing.
Regarding "client's way" vs. "your way".
I'd say both are inherently wrong.
I mean if you have 10 boxes, then you don't make them "box1",...,"box10", you make them "box" and "one",...,"ten". And with that, everything changes. For the better.
Bookmarks