Wednesday, January 13, 2010
try to write any...
...
The first part of the CSS code is enclosed in /* and */ comment tags, so it won't be shown on your blog, but only used by Blogger internally. There will be a list of variables here, one for each font or color that you want to be editable from the Fonts and Colors tab. Each variable is required to have the information shown in the example above and described here:
* name - This name may contain only letters or numbers, and each name in your template must be unique.
* description - This can be a more descriptive name, and can include spaces. This is what will appear in the Fonts and Colors tab.
* type - This can be either "font" or "color".
* default - The default value. For colors, this should be a hexadecimal color code, e.g. #FF0066. For fonts, it will be a list of the form font-style font-weight font-size font-family.
After the variables are set up, the rest of the code looks like regular CSS, with one exception. Any time you want to use a color or font for which you made a variable, you'll enter $variable_name instead of the actual color or font. In the example above, you can see that we created a variable called bgcolor and set it to white (#fff). Then later on in the code, instead of setting the body background property to white explictly, we just said background: $bgcolor. This still has the effect of making the background white, with the difference that we can change it easily from the Fonts and Colors tab if we want to.
As you work on your template design, you'll add lots of variables for all the different fonts and colors you want to control. You do not, however, need to create variables for other types of CSS attributes. These can be included in the CSS just as they normally would be (as with the margin: and padding: attributes in the example above).
Note: If you need to brush up on your CSS, you can start here.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
<