Theming pages

Home Search

Page Theming

jQuery Mobile has a rich theming system that gives you full control of how pages are styled. There is detailed theming documentation within each page widget, but let's look at a few high-level examples of how theming is applied.

The data-theme attribute can be applied to the header and footer containers to apply any of the lettered theme color swatches. While the data-theme attribute could be added to the content container, we recommend adding it instead to div or container that has been assigned the data-role="page" attribute to ensure that the background color is applied to the full page. When this is done, all widgets on the page will also inherit the theme specified in the page container. However, headers and footers will default to theme "a". If you want to have a page with, for example, only theme "b" for all its elements, including its header and footer, you will need to specify data-theme="b" to the page div as well as the header and footer divs.

The default Theme mixes styles from multiple swatches to create visual texture and present the various elements in optimal contrast to one another:

Default Theme

Default Theme Content Header

This is the default content color swatch and a preview of a link.

Button

And each of the five "swatches" applies its style consistently across all page elements, as shown below:

Swatch "a"

Header A

Header

This is content color swatch "a" and a preview of a link.

Button

Swatch "b"

Header B

Header

This is content color swatch "b" and a preview of a link.

Button

Swatch "c"

Header C

Header

This is content color swatch "c" and a preview of a link.

Button

Swatch "d"

Header D

Header

This is content color swatch "d" and a preview of a link.

Button

Swatch "e"

Header E

Header

This is content color swatch "e" and a preview of a link.

Button