Variables

To use variables in xCSS you need to define them first.
Create a new object called vars.


vars {
    
}

Creating vars is very similar to PHP $var_name = var_value;.
Here some examples: You don't need to quote strings


vars {
    $path = ../img/tmpl1/png;
    $color1 = #FF00FF;
    $border = border-top: 1px solid $color1;
}

And invoke them is even simpler: You can use variables across xCSS files


.selector {
    background-image: url($path/head_bg.png);
    background-color: $color1;
    $border;
}


.selector {
    background-image: url(../img/tmpl1/png/head_bg.png);
    background-color: #FF00FF;
    border-top: 1px solid #FF00FF;
}

Found an error on this page? Please help to correct it!