Easy Tutorial
❮ Api Puff Effect Api Draggable ❯

jQuery UI Theming

All jQuery UI plugins allow developers to seamlessly integrate UI widgets into the appearance and feel of their websites or applications. Each plugin defines its styles through CSS, containing two layers of style information: the standard jQuery UI CSS Framework styles and specific plugin styles.

The jQuery UI CSS Framework provides semantic representation classes to indicate the role of elements within widgets, such as headers, content, or clickable areas. These are consistent across all widgets; a clickable tab, accordion, or button all share the same ui-state-default class to indicate they are clickable. When a user hovers over these elements, the class changes to ui-state-hover, and when selected, it becomes ui-state-active. This consistency ensures that elements with similar roles or interaction states appear uniform across all widgets.

The CSS framework styles are encapsulated in a single file named ui.theme.css. This file is modified through the ThemeRoller application. The framework styles only include properties that affect appearance and feel, such as colors, background images, and icons. These are "safe" styles that do not affect plugin functionality. This separation means developers can create a custom appearance and feel by modifying colors and images in the theme.css file. Future plugins or bug fixes will be usable without modification alongside the theme.

Since the framework styles only cover appearance and feel, specific plugin style sheets are also needed. These include all additional structural style rules that give widgets functionality, such as dimensions, padding, margins, positioning, and floats. Each plugin's style sheet is located in the themes/base folder and is named in conjunction with the plugin, such as "jquery.ui.accordion.css". These styles must be carefully edited as they provide overrides for the framework styles in conjunction with the scripts.

We encourage all developers to create jQuery plugins, as the jQuery UI CSS Framework makes it easier for end-users to customize themes and use plugins.

Theming

Below are three general methods for theming jQuery UI plugins:

Using ThemeRoller, jQuery UI CSS Framework, and Designing Custom Themes

❮ Api Puff Effect Api Draggable ❯