StyleVars 
StyleVars (short for Style Variables) are PHP variables that contain a single value used for controlling the appearance of some aspect of a vBulletin style that would be difficult or impossible to control via CSS.

For example, one StyleVar (called $stylevar[cellspacing]) controls the spacing between cells in all <table> tags used in vBulletin, as you can see from the following examples:

Firstly, with the $stylevar[cellspacing] StyleVar set at its default value of 1, you can see a single-pixel border between cells in the table.

Next, with $stylevar[cellspacing] set to equal 0, you can see that the border between cells has completely disappeared.

Finally, with $stylevar[cellspacing] set at 3, a much wider, 3 pixel border is produced between each cell.
Another example of a StyleVar in use is $stylevar[cellpadding], which controls the padding of each cell in a table.

At the default value of $stylevar[cellpadding]: 6, tables appear with a large amount of padding around the content of each cell.

After reducing $stylevar[cellpadding] to 3, the margin around cell content is halved from the default amount of padding.

And finally, with $stylevar[cellpadding] set at 0, all padding is removed, leaving a rather nasty, cluttered layout having no margin between cell content and cell border at all.
StyleVars are incorporated into templates in the same way as any other PHP variables. The following example shows a block of XHTML code from a template using several StyleVars:
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]">
<tr>
    <td class="thead" align="$stylevar[left]">Welcome to vBulletin</td>
    <td class="thead" align="$stylevar[right]">$bbuserinfo[username]</td>
</tr>
<tr>
    <td class="alt1" colspan="2">
        <img src="$stylevar[titleimage]" alt="vBulletin Logo" />
    </td>
</tr>
</table>
The values of StyleVars are set in the StyleVars section of the Style Manager.

The following sections list and explain all the StyleVars used by vBulletin, so you can edit them with confidence, and incorporate them into any custom templates you might create.
User Contributed Notes: StyleVars Add a Comment