forked from jquery-archive/jquery-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bars-themes.html
executable file
·119 lines (90 loc) · 4.72 KB
/
bars-themes.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>jQuery Mobile Framework - Toolbars demo</title>
<link rel="stylesheet" href="../../themes/default/" />
<link rel="stylesheet" href="../_assets/css/jqm-docs.css"/>
<script type="text/javascript" src="../../js/"></script>
</head>
<body>
<div data-role="page">
<div data-role="header" data-position="inline">
<h1>Bar theming </h1>
</div>
<div data-role="content">
<p>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. </p>
<h2>Theming headers and footers</h2>
<p>To set the header or footer bars to a different color in your theme, add the <code>data-theme</code> 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):</p>
<div class="highlight">
<pre>
<span class="nt"><div</span> <span class="na">data-role=</span><span class="s">"header"</span> <span class="na">data-theme=</span><span class="s">"b"</span><span class="nt">></span>
<span class="nt"><h1></span>Page Title<span class="nt"></h1></span>
<span class="nt"></div></span>
</pre>
</div>
<h2>Theming buttons in toolbars</h2>
<p>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 <code>data-theme</code> 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, we can override the color by setting the <code>data-theme</code> attribute to "b" (blue in our default theme) on the Save button's anchor.</p>
<div class="highlight">
<pre>
<span class="nt"><a</span> <span class="na">href=</span><span class="s">"add-user.php"</span> <span class="na">data-theme=</span><span class="s">"b"</span><span class="nt">></span>Save<span class="nt"></a></span>
</pre>
</div>
<h2>Theme variations</h2>
<p>This is a demo of the variation that can be achieved by tweaking the theme swatches and buttons inside the headers and footers.</p>
<h3>Headers</h3>
</div>
<div data-role="header" data-position="inline">
<h1>Bar theme "a"</h1>
<a href="index.html" data-icon="plus" data-theme="c">New</a>
</div>
<div data-role="header" data-position="inline">
<a href="index.html" data-icon="delete" iconpos="notext">Cancel</a>
<h1>Bar theme "a"</h1>
<a href="index.html" data-icon="arrow-r" data-iconpos="right" data-theme="b">Save</a>
</div>
<div data-role="header" data-position="inline" data-theme="b">
<h1>Bar theme "b"</h1>
<a href="index.html" data-icon="plus" data-theme="a">New</a>
</div>
<div data-role="header" data-position="inline" data-theme="b">
<a href="index.html" data-icon="delete" iconpos="notext">Cancel</a>
<h1>Bar theme "b"</h1>
<a href="index.html" data-icon="arrow-r" data-iconpos="right" data-theme="d">Save</a>
</div>
<div data-role="header" data-position="inline" data-theme="c">
<h1>Bar theme "c"</h1>
<a href="index.html" data-icon="plus" data-theme="a">New</a>
</div>
<div data-role="header" data-position="inline" data-theme="c">
<a href="index.html" data-icon="delete" iconpos="notext">Cancel</a>
<h1>Bar theme "c"</h1>
<a href="index.html" data-icon="arrow-r" data-iconpos="right" data-theme="b">Save</a>
</div>
<div data-role="header" data-position="inline" data-theme="d">
<h1>Bar theme "d"</h1>
<a href="index.html" data-icon="plus" data-theme="a">New</a>
</div>
<div data-role="header" data-position="inline" data-theme="d">
<a href="index.html" data-icon="delete" iconpos="notext">Cancel</a>
<h1>Bar theme "d"</h1>
<a href="index.html" data-icon="arrow-r" data-iconpos="right" data-theme="b">Save</a>
</div>
<div data-role="content" class="ui-body">
<h3>Footers</h3>
</div>
<div data-role="footer" data-position="inline">
<div>
<a href="index.html" data-icon="arrow-l" data-iconpos="right">left</a>
<a href="index.html" data-icon="arrow-r" data-iconpos="right">right</a>
<a href="index.html" data-icon="arrow-u" data-iconpos="right">up</a>
<a href="index.html" data-icon="arrow-d" data-iconpos="right">down</a>
<a href="index.html" data-icon="plus" data-iconpos="right">plus</a>
<a href="index.html" data-icon="minus" data-iconpos="right">minus</a>
<a href="index.html" data-icon="delete" data-iconpos="right">delete</a>
</div>
</div>
<p></p>
</div>
</body>
</html>