content-themes.html 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>jQuery Mobile Docs - Content Themes</title>
  7. <link rel="stylesheet" href="../../jquery.mobile-1.0.1.min.css" />
  8. <link rel="stylesheet" href="../_assets/css/jqm-docs.css"/>
  9. <script src="../../jquery.js"></script>
  10. <script src="../../experiments/themeswitcher/jquery.mobile.themeswitcher.js"></script>
  11. <script src="../_assets/js/jqm-docs.js"></script>
  12. <script src="../../jquery.mobile-1.0.1.min.js"></script>
  13. </head>
  14. <body>
  15. <div data-role="page" class="type-interior">
  16. <div data-role="header" data-theme="f">
  17. <h1>Theming content</h1>
  18. <a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-right jqm-home">Home</a>
  19. </div><!-- /header -->
  20. <div data-role="content">
  21. <div class="content-primary">
  22. <h2>Theming the content area</h2>
  23. <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>
  24. <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>
  25. <code>
  26. &lt;div data-role=&quot;page&quot; <strong> data-theme=&quot;a&quot;</strong> <strong>data-content-theme=&quot;a&quot;</strong>&gt;
  27. </code>
  28. <h2>Theming collapsible blocks</h2>
  29. <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>
  30. <code>
  31. &lt;div data-role=&quot;collapsible&quot; data-collapsed=&quot;true&quot; <strong> data-theme=&quot;a&quot;&gt;</strong>
  32. </code>
  33. <h2>Themed examples</h2>
  34. <p><strong>A</strong> theme swatch on content &amp; collapsible</p>
  35. <div class="ui-body ui-body-a">
  36. <h1>H1 Heading</h1>
  37. <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>
  38. <div data-role="collapsible" data-collapsed="true" data-theme="a">
  39. <h3>I'm a themed collapsible</h3>
  40. <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>
  41. </div><!-- /collapsible -->
  42. <div data-role="collapsible" data-theme="a" data-content-theme="a">
  43. <h3>I'm a themed collapsible with a themed content</h3>
  44. <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>
  45. </div>
  46. </div><!-- /themed container -->
  47. <p><strong>B</strong> theme swatch on content &amp; collapsible</p>
  48. <div class="ui-body ui-body-b">
  49. <h1>H1 Heading</h1>
  50. <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>
  51. <div data-role="collapsible" data-collapsed="true" data-theme="b">
  52. <h3>I'm a themed collapsible</h3>
  53. <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>
  54. </div><!-- /collapsible -->
  55. <div data-role="collapsible" data-theme="b" data-content-theme="b">
  56. <h3>I'm a themed collapsible with a themed content</h3>
  57. <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>
  58. </div>
  59. </div><!-- /themed container -->
  60. <p><strong>C</strong> theme swatch on content &amp; collapsible</p>
  61. <div class="ui-body ui-body-c">
  62. <h1>H1 Heading</h1>
  63. <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>
  64. <div data-role="collapsible" data-collapsed="true" data-theme="c">
  65. <h3>I'm a themed collapsible</h3>
  66. <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>
  67. </div><!-- /collapsible -->
  68. <div data-role="collapsible" data-theme="c" data-content-theme="c">
  69. <h3>I'm a themed collapsible with a themed content</h3>
  70. <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>
  71. </div>
  72. </div><!-- /themed container -->
  73. <p><strong>D</strong> theme swatch on content &amp; collapsible</p>
  74. <div class="ui-body ui-body-d">
  75. <h1>H1 Heading</h1>
  76. <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>
  77. <div data-role="collapsible" data-collapsed="true" data-theme="d">
  78. <h3>I'm a themed collapsible</h3>
  79. <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>
  80. </div><!-- /collapsible -->
  81. <div data-role="collapsible" data-theme="d" data-content-theme="d">
  82. <h3>I'm a themed collapsible with a themed content</h3>
  83. <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>
  84. </div>
  85. </div><!-- /themed container -->
  86. <p><strong>E</strong> theme swatch on content &amp; collapsible</p>
  87. <div class="ui-body ui-body-e">
  88. <h1>H1 Heading</h1>
  89. <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>
  90. <div data-role="collapsible" data-collapsed="true" data-theme="e">
  91. <h3>I'm a themed collapsible</h3>
  92. <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>
  93. </div><!-- /collapsible -->
  94. <div data-role="collapsible" data-theme="e" data-content-theme="e">
  95. <h3>I'm a themed collapsible with a themed content</h3>
  96. <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>
  98. </div><!-- /themed container -->
  99. </div><!--/content-primary -->
  100. <div class="content-secondary">
  101. <div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">
  102. <h3>More in this section</h3>
  103. <ul data-role="listview" data-theme="c" data-dividertheme="d">
  104. <li data-role="list-divider">Content Formatting</li>
  105. <li><a href="content-html.html">Basic HTML styles</a></li>
  106. <li><a href="content-grids.html">Layout grids (columns)</a></li>
  107. <li><a href="content-collapsible.html">Collapsible content blocks</a></li>
  108. <li><a href="content-collapsible-set.html">Collapsible sets (accordions)</a></li>
  109. <li data-theme="a"><a href="content-themes.html">Theming content</a></li>
  110. </ul>
  111. </div>
  112. </div>
  113. </div><!-- /content -->
  114. <div data-role="footer" class="footer-docs" data-theme="c">
  115. <p>&copy; 2011-2012 The jQuery Project</p>
  116. </div>
  117. </div><!-- /page -->
  118. </body>
  119. </html>