Easy Tutorial
❮ Example Animate Api Hide ❯

jQuery UI Design Themes

File Structure

Themes are designed to enhance their usability in a specific manner. Typically, the file directory structure is as follows:

For examples of how the theme file structure is implemented, visit the jQuery UI Base Theme.

Defining Styles

Writing styles for a theme is straightforward due to the flexibility of themes.

All themes should have a basic CSS class. This primary class allows users to enable or disable the theme. Your root class should be formatted as .ui-themename. Its usage in the HTML file is as follows:

<html>
<head>
    <title>My Site</title>
    <link rel="stylesheet" href="themename/themename.css" />
    <link rel="stylesheet" href="othertheme/othertheme.css" />
    <link rel="stylesheet" href="othertheme/othertheme.dialog.css" />
</head>
<body class="ui-themename">
    <div class="ui-othertheme">
        <div class="ui-dialog">This is a modal dialog.</div>
    </div>
</body>
</html>

In the above example, several important things occur:

If we open the themename.css file, we can see the following code:

body.ui-themename { background:#111; color:snow; }
.ui-themename a, a.ui-themename { color:#68D; outline:none; }
.ui-themename a:visited, a.ui-themename:visited { color:#D66; }
.ui-themename a:hover, a.ui-themename:hover { color:#FFF; }

Note that the themename.css file includes only globally applicable style information; specific plugin styles are not defined here. These styles apply to all themes. Do not worry about a theme occupying multiple files - these will be streamlined during the creation and download process.

❮ Example Animate Api Hide ❯