jQuery Mobile Framework - Theming Toolbars

# Bar theming

Home Search

Both the header and footer bars will be styled by default with the theme's "a" color swatch (black in the default theme) because these bars are typically primary in the visual hierarchy of a page.

## Theming headers and footers

To set the header or footer bars to a different color in your theme, add the `data-theme` attribute and specify the letter of the theme swatch (a, b, c, etc.). For example, this will set the bar to swatch "b" (blue in the default theme):

    <div data-role="header" data-theme="b">
    	<h1>Page Title</h1>
    </div>

## Theming buttons in toolbars

Any link added inside the header block will be automatically styled as a button that matches the color of the bar's theme swatch. To make a button stand out as a primary call to action, the `data-theme` attribute can be used to specify a contrasting button color from a different theme swatch. For example, if we set the header to theme "c" (light gray), both buttons would be styled as the "c" button by default. If we wanted the Save button to visually pop out, we can override the color by setting the `data-theme` attribute to "b" (blue in our default theme) on the Save button's anchor.

    <a href="add-user.php" data-theme="b">Save</a>

## Theme variations

This is a demo of the variation that can be achieved by tweaking the theme swatches and buttons inside the headers and footers.

### Headers

# Bar swatch "a"

New
Cancel

# Bar swatch "a"

Save

# Bar swatch "b"

New
Cancel

# Bar swatch "b"

Save

# Bar swatch "c"

New
Cancel

# Bar swatch "c"

Save

# Bar swatch "d"

New
Cancel

# Bar swatch "d"

Save

# Bar swatch "e"

New
Cancel

# Bar swatch "e"

Save

### Footers

These are examples of a footer with link buttons inside. Note that footers do not have the same prescriptive markup conventions as headers with button slots so use layout grids or custom styles to achieve the design you want.

left right up down
left right up down
left right up down
left right up down
left right up down

### More in this section

- Toolbars
- Toolbar basics
- Header bars
- Footer bars
- Navbars
- Fixed positioning
- Persistent toolbars
- Theming toolbars