How To Add Together Custom Variable Definitions To Blogger
Saturday, February 1, 2020
Edit
In this tutorial, nosotros are going larn virtually the CSS Variable Definitions for Colors in addition to Fonts that could last establish at the hap of the agency canvass of a Blogger blog. The values for the Variable definitions tin last modified straight through the Blogger Template Designer where are the settings for colors, backgrounds, fonts in addition to font sizes.

Most default Blogger templates, such equally the Minima Template, role these settings for the CSS, which makes it easier to modify the variables through the Blogger dashboard, using the Template Designer ("Template" > "Customize") editor in addition to going to the "Advanced" section.

If the definitions are already added inwards the CSS, we'll last able to alter the background colors, font colors, styles or sizes, straight from our Blogger dashboard without having to affect the HTML code of our template.
If these values are non set, nosotros tin define them past times creating our ain variables. The to a greater extent than variables are created, the greater volition last the remain of changing colors in addition to fonts of the Page Elements past times going to the "Template Designer" in addition to click on the "Advanced" tab.
In roughly cases, nosotros can't alter the color or font of a custom template if the designer has non implemented the variables in addition to didn't defined & specified a detail value straight into a property. And if at that spot is no definition for these values, nosotros may non last able to customize it through the Blogger's Template Designer.
There are 2 types of variables:
1) Color Variable:

Please re-create the below snippet in addition to supervene upon the names in addition to types equally you lot like, in addition to therefore glue the code below this comment:

Here, I direct keep created a variable of type "color", amongst the "variablecolor" name. The color values (#DDF2FF) tin last applied to all the borders of my weblog in addition to whenever I desire to use color styles to a specific border, I volition type it similar this:
Once nosotros direct keep created the variable, nosotros tin use it on whatsoever belongings (not alone borders) of whatsoever selector (page element) where it is possible applying the chosen color.
For example, if I desire to add together this color inwards the main-inner background (sidebar in addition to posts area), I volition add together it simply later on the "main-inner" degree selector, similar this:

Now that a novel variable has been added, relieve in addition to supply dorsum to the blogger dashboard past times clicking on the "Customize" button, in addition to therefore the "Advanced" tab. You volition notice that at that spot is a novel variable called "Variable amongst low-cal blueish color". In social club to alter the color, simply role the color picker tool.

Once the font variable has been implemented, nosotros tin add together it to whatsoever belongings of whatsoever selector where nosotros desire to define this font style.
To define where this variable should last applied (which, inwards my example, is the championship of the sidebar gadgets), I volition require to include the values directly inwards the "h2" belongings of the "sidebar" selector (sidebar-right-1), past times creating the next CSS rule:

Now, that nosotros direct keep included a novel variable, Save the template in addition to supply to the Blogger dashboard past times clicking on the "Template" > "Customize" push in addition to access the "Advanced" tab. Scroll downward in addition to nosotros volition run across a novel variable named "Gadgets Title Font" - if you lot desire to alter the font type or size, you lot tin practice it straight via this panel.

After you've decided what font agency should last applied, click on the Apply to blog push on the correct side.

As you lot run on your template design, you lot tin add together lots of color in addition to font variable types, however, for other types of CSS attributes, it is non necessary to create variables. The other types, such equally margin, padding, require to last included inwards the HTML of the template higher upwards the ]]></b:skin> tag. So that's how you lot tin add together custom variable definitions to Blogger. Enjoy!

Most default Blogger templates, such equally the Minima Template, role these settings for the CSS, which makes it easier to modify the variables through the Blogger dashboard, using the Template Designer ("Template" > "Customize") editor in addition to going to the "Advanced" section.

If the definitions are already added inwards the CSS, we'll last able to alter the background colors, font colors, styles or sizes, straight from our Blogger dashboard without having to affect the HTML code of our template.
If these values are non set, nosotros tin define them past times creating our ain variables. The to a greater extent than variables are created, the greater volition last the remain of changing colors in addition to fonts of the Page Elements past times going to the "Template Designer" in addition to click on the "Advanced" tab.
In roughly cases, nosotros can't alter the color or font of a custom template if the designer has non implemented the variables in addition to didn't defined & specified a detail value straight into a property. And if at that spot is no definition for these values, nosotros may non last able to customize it through the Blogger's Template Designer.
There are 2 types of variables:
1) Color Variable:
<Variable name="body.background.color" description="Outer Background" type="color" default="#66bbdd" value="#66bbdd"/>
- In red is the variable name. Here you lot tin lay whatsoever cite you lot want, however, it must non comprise spaces, that's why nosotros may run across roughly variable names using a point "." betwixt each word.
- In green is the description that volition seem inwards the Fonts in addition to Colors panel (it tin comprise spaces).
- In blue is variable type, which inwards this instance is "color".
- In purple is the default value, which runs inwards the absence of whatsoever other value.
- In orange is the value of the selected color.
<Variable name="body.font" description="Font" type="font" default="normal normal 12px Arial, Tahoma, Helvetica, FreeSans, sans-serif" value="normal normal 12px Arial, Tahoma, Helvetica, FreeSans, sans-serif" />
- In red the variable cite without spaces.
- In green the description of the variable, may comprise spaces.
- In blue is the type of the variable, which inwards this instance is font.
- In purple the default font.
- In orange is the font that you lot choose.
Where Are Variable Definitions located
We tin uncovering the variables definitions inwards the <head> department of our Template past times accessing the HTML code (click on the "Edit HTML" button). There nosotros should run across a brace of <b:skin>..</b:skin> tags. The CSS agency declarations volition acquire inwards betwixt those tags, along amongst the variable names.
How to Create Variables amongst type Color
Now, let's run across how nosotros tin create type="color" variables inwards our template.Please re-create the below snippet in addition to supervene upon the names in addition to types equally you lot like, in addition to therefore glue the code below this comment:
/* Variable definitionsCode to copy:
====================
<Variable name="NAME" description="DESCRIPTION" type="color" default="#xxxxxx" value="#xxxxxx" />For a ameliorate understanding, let's accept a expect at this instance amongst variable of type "color":
<Variable name="variablecolor" description="Variable amongst low-cal blueish color" type="color" default="#DDF2FF" value="#DDF2FF" />

Here, I direct keep created a variable of type "color", amongst the "variablecolor" name. The color values (#DDF2FF) tin last applied to all the borders of my weblog in addition to whenever I desire to use color styles to a specific border, I volition type it similar this:
border: 1px enterprise $(variablecolor);Note that I direct keep added the "$" symbol earlier the variable's cite in addition to included the cite within the parentheses. These should last added every fourth dimension you lot desire to implement a novel variable definition.
Once nosotros direct keep created the variable, nosotros tin use it on whatsoever belongings (not alone borders) of whatsoever selector (page element) where it is possible applying the chosen color.
For example, if I desire to add together this color inwards the main-inner background (sidebar in addition to posts area), I volition add together it simply later on the "main-inner" degree selector, similar this:
.main-inner {
background-color: $(variablecolor);
}

Now that a novel variable has been added, relieve in addition to supply dorsum to the blogger dashboard past times clicking on the "Customize" button, in addition to therefore the "Advanced" tab. You volition notice that at that spot is a novel variable called "Variable amongst low-cal blueish color". In social club to alter the color, simply role the color picker tool.

How to Create Variables of type Font
Now let's nation that I desire to create a novel variable of type="font" which I desire to use on the championship of the sidebar gadgets. I volition add together it this way:<Variable name="gadgetstitlefont" description="Gadgets Title Font" type="font" default="normal normal 16px Arial,Verdana,'Trebuchet MS',Trebuchet,Sans-serif" value="normal normal 20px Cambria"/>In this variable that I simply created, the default font to last searched past times the spider web browser should last Arial, in addition to inwards its absence, Verdana in addition to therefore on. Otherwise, use the Cambria font which is genuinely the font that nosotros desire in addition to which tin last easily changed past times accessing the Blogger Template Designer.
Once the font variable has been implemented, nosotros tin add together it to whatsoever belongings of whatsoever selector where nosotros desire to define this font style.
To define where this variable should last applied (which, inwards my example, is the championship of the sidebar gadgets), I volition require to include the values directly inwards the "h2" belongings of the "sidebar" selector (sidebar-right-1), past times creating the next CSS rule:
#sidebar-right-1 h2 {And I volition add together this higher upwards the ]]></b:skin> tag of the Template (don't forget to add together the "$" symbol earlier the variable's name, also lay the cite betwixt the parentheses, otherwise it won't work).
font: $(gadgetstitlefont);
}

Now, that nosotros direct keep included a novel variable, Save the template in addition to supply to the Blogger dashboard past times clicking on the "Template" > "Customize" push in addition to access the "Advanced" tab. Scroll downward in addition to nosotros volition run across a novel variable named "Gadgets Title Font" - if you lot desire to alter the font type or size, you lot tin practice it straight via this panel.

After you've decided what font agency should last applied, click on the Apply to blog push on the correct side.

As you lot run on your template design, you lot tin add together lots of color in addition to font variable types, however, for other types of CSS attributes, it is non necessary to create variables. The other types, such equally margin, padding, require to last included inwards the HTML of the template higher upwards the ]]></b:skin> tag. So that's how you lot tin add together custom variable definitions to Blogger. Enjoy!