5 <meta name="viewport" content="width=device-width, initial-scale=1">
6 <title>jQuery Mobile Docs - Content Themes</title>
7 <link rel="stylesheet" href="../../css/themes/default/jquery.mobile.css" />
8 <link rel="stylesheet" href="../_assets/css/jqm-docs.css"/>
10 <script src="../../js/jquery.js"></script>
11 <script src="../../docs/_assets/js/jqm-docs.js"></script>
12 <script src="../../js/"></script>
17 <div data-role="page" class="type-interior">
19 <div data-role="header" data-theme="f">
20 <h1>Theming content</h1>
21 <a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse">Home</a>
22 <a href="../nav.html" data-icon="search" data-iconpos="notext" data-rel="dialog" data-transition="fade">Search</a>
23 </div><!-- /header -->
25 <div data-role="content">
26 <div class="content-primary">
27 <h2>Theming the content area</h2>
28 <p>The main content area of a page (container with the <code> data-role="content"</code> attribute) should be themed by adding the <code> data-theme</code> attribute to the <code> data-role="page"</code> container to ensure that the background colors are applied to the full page, regardless of the content length. (If you add the <code> data-theme</code> attribute to the content container, the background color will stop after the content. So there may be a gap in color between the content and fixed footer.)</p>
29 <p>Additionally, the content area of a collapsible can be themed to match the theme of the collapsible header using the <code>data-content-theme</code> attribute.</p>
32 <div data-role="page" <strong> data-theme="a"</strong> <strong>data-content-theme="a"</strong>>
35 <h2>Theming collapsible blocks</h2>
36 <p>To set the color of the collapsible header, add the <code> data-theme</code> attribute to the collapsible container. The icon and body are not currently themable through data attributes, but can be styled directly with custom css.</p>
39 <div data-role="collapsible" data-collapsed="true" <strong> data-theme="a"></strong>
41 <h2>Themed examples</h2>
43 <p><strong>A</strong> theme swatch on content & collapsible</p>
44 <div class="ui-body ui-body-a">
46 <p>This is a paragraph that contains <strong>strong</strong>, <em>emphasized</em> and <a href="index.html">linked</a> text. Here is more text so you can see how HTML markup works in content. Here is more text so you can see how HTML markup works in content.</p>
47 <div data-role="collapsible" data-collapsed="true" data-theme="a">
48 <h3>I'm a themed collapsible</h3>
49 <p>I have <code> data-theme</code> attribute set manually on my container to set the color to match the content block I'm in. </p>
50 </div><!-- /collapsible -->
51 <div data-role="collapsible" data-theme="a" data-content-theme="a">
52 <h3>I'm a themed collapsible with a themed content</h3>
53 <p>I have <code> data-content-theme</code> attribute set manually on my container to set the color to match the content block I'm in. </p>
55 </div><!-- /themed container -->
57 <p><strong>B</strong> theme swatch on content & collapsible</p>
58 <div class="ui-body ui-body-b">
60 <p>This is a paragraph that contains <strong>strong</strong>, <em>emphasized</em> and <a href="index.html">linked</a> text. Here is more text so you can see how HTML markup works in content. Here is more text so you can see how HTML markup works in content.</p>
61 <div data-role="collapsible" data-collapsed="true" data-theme="b">
62 <h3>I'm a themed collapsible</h3>
63 <p>I have <code> data-theme</code> attribute set manually on my container to set the color to match the content block I'm in. </p>
64 </div><!-- /collapsible -->
65 <div data-role="collapsible" data-theme="b" data-content-theme="b">
66 <h3>I'm a themed collapsible with a themed content</h3>
67 <p>I have <code> data-content-theme</code> attribute set manually on my container to set the color to match the content block I'm in. </p>
69 </div><!-- /themed container -->
71 <p><strong>C</strong> theme swatch on content & collapsible</p>
72 <div class="ui-body ui-body-c">
74 <p>This is a paragraph that contains <strong>strong</strong>, <em>emphasized</em> and <a href="index.html">linked</a> text. Here is more text so you can see how HTML markup works in content. Here is more text so you can see how HTML markup works in content.</p>
75 <div data-role="collapsible" data-collapsed="true" data-theme="c">
76 <h3>I'm a themed collapsible</h3>
77 <p>I have <code> data-theme</code> attribute set manually on my container to set the color to match the content block I'm in. </p>
78 </div><!-- /collapsible -->
79 <div data-role="collapsible" data-theme="c" data-content-theme="c">
80 <h3>I'm a themed collapsible with a themed content</h3>
81 <p>I have <code> data-content-theme</code> attribute set manually on my container to set the color to match the content block I'm in. </p>
83 </div><!-- /themed container -->
85 <p><strong>D</strong> theme swatch on content & collapsible</p>
86 <div class="ui-body ui-body-d">
88 <p>This is a paragraph that contains <strong>strong</strong>, <em>emphasized</em> and <a href="index.html">linked</a> text. Here is more text so you can see how HTML markup works in content. Here is more text so you can see how HTML markup works in content.</p>
89 <div data-role="collapsible" data-collapsed="true" data-theme="d">
90 <h3>I'm a themed collapsible</h3>
91 <p>I have <code> data-theme</code> attribute set manually on my container to set the color to match the content block I'm in. </p>
92 </div><!-- /collapsible -->
93 <div data-role="collapsible" data-theme="d" data-content-theme="d">
94 <h3>I'm a themed collapsible with a themed content</h3>
95 <p>I have <code> data-content-theme</code> attribute set manually on my container to set the color to match the content block I'm in. </p>
97 </div><!-- /themed container -->
99 <p><strong>E</strong> theme swatch on content & collapsible</p>
100 <div class="ui-body ui-body-e">
102 <p>This is a paragraph that contains <strong>strong</strong>, <em>emphasized</em> and <a href="index.html">linked</a> text. Here is more text so you can see how HTML markup works in content. Here is more text so you can see how HTML markup works in content.</p>
103 <div data-role="collapsible" data-collapsed="true" data-theme="e">
104 <h3>I'm a themed collapsible</h3>
105 <p>I have <code> data-theme</code> attribute set manually on my container to set the color to match the content block I'm in. </p>
106 </div><!-- /collapsible -->
107 <div data-role="collapsible" data-theme="e" data-content-theme="e">
108 <h3>I'm a themed collapsible with a themed content</h3>
109 <p>I have <code> data-content-theme</code> attribute set manually on my container to set the color to match the content block I'm in. </p>
111 </div><!-- /themed container -->
114 </div><!--/content-primary -->
116 <div class="content-secondary">
118 <div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">
120 <h3>More in this section</h3>
122 <ul data-role="listview" data-theme="c" data-dividertheme="d">
124 <li data-role="list-divider">Content Formatting</li>
125 <li><a href="content-html.html">Basic HTML styles</a></li>
126 <li><a href="content-grids.html">Layout grids (columns)</a></li>
127 <li><a href="content-collapsible.html">Collapsible content blocks</a></li>
128 <li><a href="content-collapsible-set.html">Collapsible sets (accordions)</a></li>
129 <li data-theme="a"><a href="content-themes.html">Theming content</a></li>
135 </div><!-- /content -->
137 <div data-role="footer" class="footer-docs" data-theme="c">
138 <p>© 2011-12 The jQuery Foundation</p>