# Themes and Control Variants

Themes within Airkit provide a way to brand an application to create a particular look and feel.  There's the ability to import/export themes, change the visual properties of any type of controls, or add specific variants for each control, all configured within [Theme Builder](../studio/builder-bar/theme-builder). This article will cover the following topics:

* [Variants](#h_01F38GA75JVBN2C45Q89CNDVBF)
* [Modifying a Variant](#h_01F38GAE603BQD05H95VRZRRN8)
* [Adding a Variant](#h_01F38GAMNFSJPAK687KYZA630T)
* [Changing Styles in a Theme](#h_01F38GAVRX68Y1B16BM3VMKHRH)
* [Adding a Style Class to a Theme](#h_01F38GB49QCPS4HEF27ZJKSN7M)

![Screen\_Shot\_2021-04-13\_at\_1.38.27\_PM.png](https://4185914948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSItjRhbHaLQ4ar3DUljt%2Fuploads%2Fgit-blob-72c94b131e4e79e92b9e90ed109f57a373131a4e%2Fthemes-and-control-variants-v181-0.png?alt=media)

### Variants

A variant in Airkit is a set of styling properties for a specific control, similar to a class in CSS. Variants are used to create style uniformity across an application. For example, labels have multiple variants such as a body text variant or a headline variant, and these variants can be selected when adding a label control to an application. Each of these variants have different properties associated with them and can be maintained and edited within Theme Builder. When a variant is edited, then that change will reflect across all instances of that control using that variant. Variants are also seen when adding a control in an application. When adding a control, there is the option to select the different variants available with the option to modify it later as well.

![](https://4185914948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSItjRhbHaLQ4ar3DUljt%2Fuploads%2Fgit-blob-db74cff83d30e99116e9558c6084c2984490373d%2Fthemes-and-control-variants-v181-1.png?alt=media)

### Modifying a Variant

For example, an application uses a mix of body text and headline text and there is a requirement to change all the headline text to have a bold font weight. Instead of identifying all of the label controls with a headline text and overriding the styles, the headline text variant can be edited.&#x20;

Go to Theme Builder and open the **Label Variant** accordion in the tree. Select **largeHeadline**, which is the largeHeadline variant that would be used across the application.&#x20;

![](https://4185914948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSItjRhbHaLQ4ar3DUljt%2Fuploads%2Fgit-blob-01fb9b612c234f682459bf3c96d9a661ad020cf9%2Fthemes-and-control-variants-v181-2?alt=media).png)

When **largeHeadline** is selected, the inspector will show all of the style properties that are associated with **largeHeadline**. Any changes made here will reflect across all instances of largeHeadline in an application, unless the styles are overrode in Web Flows Builder. To change the font weight of the largeHeadline to bold, change the dropdown from Regular to Bold under the Font properties.&#x20;

![](https://4185914948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSItjRhbHaLQ4ar3DUljt%2Fuploads%2Fgit-blob-e32e692000c0422366126cd461d8808d8c68fe22%2Fthemes-and-control-variants-v181-3.png?alt=media)

After saving, the changes will then reflect in the application.&#x20;

### Adding a Variant

If none of the variants that come default fit the need of an application or the application requires additional variants, there is the ability to add a variant to any of the controls. This example will show how to add a Button Variant.

Go to Theme Builder and click on the '+' icon at the Theme level in the tree. Select '**Button**'.&#x20;

![](https://4185914948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSItjRhbHaLQ4ar3DUljt%2Fuploads%2Fgit-blob-8894d6516f840a6dcced761284b9adba2321fd75%2Fthemes-and-control-variants-v181-4.png?alt=media)

Select the 'Button Variant' accordion in the tree and there will be a variant called 'default 2' which was the variant just added. The variant can also be renamed to a name that is more fitting for that variant.&#x20;

![](https://4185914948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSItjRhbHaLQ4ar3DUljt%2Fuploads%2Fgit-blob-6ccce4dfc4f7e2346c1de0c89975dee0d3974fee%2Fthemes-and-control-variants-v181-5.png?alt=media)

Select 'default 2' and see the inspector. In the inspector is where the different style properties can be set. Once the styles are set, save the application and the variant can be used throughout the application.&#x20;

There is also the ability to duplicate variants as well. To duplicate variants, click on the 'Duplicate' icon to make an exact copy of the selected variant.

![](https://4185914948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSItjRhbHaLQ4ar3DUljt%2Fuploads%2Fgit-blob-01fb9b612c234f682459bf3c96d9a661ad020cf9%2Fthemes-and-control-variants-v181-6?alt=media).png)

### Changing Styles in a Theme

In Theme Builder, there are different levels at which styles can be applied. Styles can be applied by variant or they can be applied to affect the entire application. Themes consist of Colors, Sizes, and Fonts and include theme variables that can be referenced throughout the application and control variants. These styles are also used by all the default variants as well, so when configured, it will also affect the default variants.&#x20;

To change a style in a Theme, go to Theme Builder and click on '**Theme'** in the tree. The inspector will then show all of the different theme variables that can be configured.&#x20;

![](https://4185914948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSItjRhbHaLQ4ar3DUljt%2Fuploads%2Fgit-blob-7c75493b9fae2d9393958f0ab4edb833ad277b26%2Fthemes-and-control-variants-v181-7.png?alt=media)

Then select a property to change. For example, to change the primary color of the brand of an application, click on the hex value of the **brandPrimary** property and change the color. This change will automatically affect all controls and variants that use the brandPrimary property for that control.&#x20;

![](https://4185914948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSItjRhbHaLQ4ar3DUljt%2Fuploads%2Fgit-blob-b7c256dec0ce7b93f23afb9cdad5b071860d25b7%2Fthemes-and-control-variants-v181-8.png?alt=media)

Changing style properties at the Theme level is useful for creating a stylesheet for an application without having to change colors, fonts, or sizes in many areas.&#x20;

### Adding a Theme Variable

If a theme requires additional styles, there is also the ability to add additional color, size, or font theme variables. To add a Theme Variable, go the Theme Builder and with **Theme** selected in the tree, click on the '+' icon next to one of the Theme properties. This will create a new Color, Size, or Font variable to be used across the application or variants.&#x20;

![](https://4185914948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSItjRhbHaLQ4ar3DUljt%2Fuploads%2Fgit-blob-15f22aea5f6ac10c840bba961e252e1a17a2d2b4%2Fthemes-and-control-variants-v181-9.png?alt=media)

### Further Reading

Themes and control variants provide a mechanism to quickly and efficiently style an application. They help bring a uniform look and feel to applications and help standardize how the different controls look across the application. For more information on styling, see:

* [Common Style Properties of Web Controls](../web-controls/web-controls-overview/common-style-properties-of-web-controls)
* [Working with Custom Fonts](working-with-custom-fonts)
* [Importing and Exporting Themes](importing-and-exporting-themes)
