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.
The default Theme mixes styles from multiple swatches to create visual texture and present the various elements in optimal contrast to one another:
This is the default content color swatch and a preview of a link.
ButtonAnd each of the five "swatches" applies its style consistently across all page elements, as shown below: