😎 Give your xaringan slides some style
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

275 lines
20KB

  1. <!DOCTYPE html>
  2. <!-- Generated by pkgdown: do not edit by hand --><html lang="en">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  8. <meta name="description" content="xaringanthemer">
  9. <title>Themes • xaringanthemer</title>
  10. <!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
  11. <link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png">
  12. <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png">
  13. <link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png">
  14. <link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png">
  15. <link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png">
  16. <script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  17. <link href="../deps/bootstrap-5.1.0/bootstrap.min.css" rel="stylesheet">
  18. <script src="../deps/bootstrap-5.1.0/bootstrap.bundle.min.js"></script><link href="../deps/_IBM%20Plex%20Mono-0.4.0/font.css" rel="stylesheet">
  19. <!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous">
  20. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous">
  21. <!-- bootstrap-toc --><script src="https://cdn.rawgit.com/afeld/bootstrap-toc/v1.0.1/dist/bootstrap-toc.min.js"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- search --><script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/6.4.6/fuse.js" integrity="sha512-zv6Ywkjyktsohkbp9bb45V6tEMoWhzFzXis+LrMehmJZZSys19Yxf1dopHx7WzIKxr5tK2dVcYmaCk2uqdjF4A==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/0.38.0/autocomplete.jquery.min.js" integrity="sha512-GU9ayf+66Xx2TmpxqJpliWbT5PiGYxpaG8rfnBEk1LL8l1KGkRShhngwdXK1UgqhAzWpZHSiYPc09/NwDQIGyg==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/mark.min.js" integrity="sha512-5CYOlHXGh6QpOFA/TeTylKLWfB3ftPsde7AnmhuitiTX4K5SqCLBeKro6sPS8ilsz1Q4NRx3v8Ko2IBiszzdww==" crossorigin="anonymous"></script><!-- pkgdown --><script src="../pkgdown.js"></script><link href="../extra.css" rel="stylesheet">
  22. <meta property="og:title" content="Themes">
  23. <meta property="og:description" content="xaringanthemer">
  24. <meta property="og:image" content="https://pkg.garrickadenbuie.com/xaringanthemer/logo.png">
  25. <meta name="twitter:card" content="summary">
  26. <meta name="twitter:creator" content="@grrrck">
  27. <meta name="twitter:site" content="@grrrck">
  28. <!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
  29. <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  30. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  31. <![endif]-->
  32. </head>
  33. <body>
  34. <a href="#main" class="visually-hidden-focusable">Skip to contents</a>
  35. <nav class="navbar fixed-top navbar-light navbar-expand-lg bg-light"><div class="container">
  36. <a class="navbar-brand me-2" href="../index.html">xaringanthemer</a>
  37. <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Released version">0.4.1</small>
  38. <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
  39. <span class="navbar-toggler-icon"></span>
  40. </button>
  41. <div id="navbar" class="collapse navbar-collapse ms-2">
  42. <ul class="navbar-nav me-auto">
  43. <li class="nav-item">
  44. <a class="nav-link" href="../articles/xaringanthemer.html">Features</a>
  45. </li>
  46. <li class="nav-item">
  47. <a class="nav-link" href="../reference/index.html">Reference</a>
  48. </li>
  49. <li class="active nav-item dropdown">
  50. <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown" role="button" aria-expanded="false" aria-haspopup="true" id="dropdown-themes">Themes</a>
  51. <div class="dropdown-menu" aria-labelledby="dropdown-themes">
  52. <h6 class="dropdown-header" data-toc-skip>Themes</h6>
  53. <a class="dropdown-item" href="../articles/themes.html">Slide Themes</a>
  54. <a class="dropdown-item" href="../articles/ggplot2-themes.html">ggplot2 Themes</a>
  55. <div class="dropdown-divider"></div>
  56. <h6 class="dropdown-header" data-toc-skip>More Customization</h6>
  57. <a class="dropdown-item" href="../articles/fonts.html">Fonts</a>
  58. <a class="dropdown-item" href="../articles/template-variables.html">Template Variables</a>
  59. </div>
  60. </li>
  61. </ul>
  62. <form class="form-inline my-2 my-lg-0" role="search">
  63. <input type="search" class="form-control me-sm-2" aria-label="Toggle navigation" name="search-input" data-search-index="../search.json" id="search-input" placeholder="Search for" autocomplete="off">
  64. </form>
  65. <ul class="navbar-nav">
  66. <li class="nav-item dropdown">
  67. <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown" role="button" aria-expanded="false" aria-haspopup="true" id="dropdown--">
  68. <span class="far fa far fa-newspaper fa-lg"></span>
  69. </a>
  70. <div class="dropdown-menu" aria-labelledby="dropdown--">
  71. <a class="external-link dropdown-item" href="https://garrickadenbuie.com/blog/xaringanthemer-v0-3-0/">xaringanthemer 0.3.0</a>
  72. <div class="dropdown-divider"></div>
  73. <a class="dropdown-item" href="../news/index.html">Changelog</a>
  74. </div>
  75. </li>
  76. <li class="nav-item">
  77. <a class="external-link nav-link" href="https://github.com/gadenbuie/xaringanthemer">
  78. <span class="fab fa fab fa-github fa-lg"></span>
  79. </a>
  80. </li>
  81. <li class="nav-item">
  82. <a class="external-link nav-link" href="https://twitter.com/grrrck">
  83. <span class="fab fa fab fa-twitter fa-lg"></span>
  84. </a>
  85. </li>
  86. <li class="nav-item">
  87. <a class="external-link nav-link" href="https://www.garrickadenbuie.com">
  88. <span class="fas fa fas fa-home fa-lg"></span>
  89. </a>
  90. </li>
  91. </ul>
  92. </div>
  93. </div>
  94. </nav><div class="container template-article">
  95. <script src="themes_files/accessible-code-block-0.0.1/empty-anchor.js"></script><div class="row">
  96. <main id="main"><div class="page-header">
  97. <img src="../logo.png" class="logo" alt=""><h1>Themes</h1>
  98. <small class="dont-index">Source: <a href="https://github.com/gadenbuie/xaringanthemer/blob/HEAD/vignettes/themes.Rmd" class="external-link"><code>vignettes/themes.Rmd</code></a></small>
  99. <div class="d-none name"><code>themes.Rmd</code></div>
  100. </div>
  101. <p><strong>xaringanthemer</strong> includes a number of functions that provide themed <strong>xaringan</strong> styles. All of the styling functions start with the <code>style_</code> prefix.</p>
  102. <p>The goal of each style function is to quickly set up a coordinated color palette for your slides based on one or two starter colors. Styles based on one color start with <code>style_mono_</code> and styles based on two colors start with <code>style_duo_</code>. How the starter colors are used is described in the final portion of the style function name. For example, <code><a href="../reference/style_mono_accent.html">style_mono_accent()</a></code> uses a single color as an accent color.</p>
  103. <p>Note that the colors used below are for demonstration only, the point of the <code>style_</code> functions is for you to choose your own color palette!</p>
  104. <p>If your color palette uses more than two colors, you can add additional colors with the <code>colors</code> argument. See the <a href="#colors">Colors</a> section for more information.</p>
  105. <div class="section level3">
  106. <h3 id="monotone">Monotone<a class="anchor" aria-label="anchor" href="#monotone"></a>
  107. </h3>
  108. <p>Use these functions to automatically create a consistent color palette for your slides, based around a single color.</p>
  109. <div class="section level4">
  110. <h4 id="style_mono_light">
  111. <code>style_mono_light()</code><a class="anchor" aria-label="anchor" href="#style_mono_light"></a>
  112. </h4>
  113. <p>A light theme based around a single color.</p>
  114. <div class="sourceCode" id="cb1"><pre class="downlit sourceCode r">
  115. <code class="sourceCode R"><span class="fu"><a href="../reference/style_mono_light.html">style_mono_light</a></span><span class="op">(</span>base_color <span class="op">=</span> <span class="st">"#23395b"</span><span class="op">)</span></code></pre></div>
  116. <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_mono_light.png" data-external="1"></p>
  117. </div>
  118. <div class="section level4">
  119. <h4 id="style_mono_dark">
  120. <code>style_mono_dark()</code><a class="anchor" aria-label="anchor" href="#style_mono_dark"></a>
  121. </h4>
  122. <p>A dark theme based around a single color.</p>
  123. <div class="sourceCode" id="cb2"><pre class="downlit sourceCode r">
  124. <code class="sourceCode R"><span class="fu"><a href="../reference/style_mono_dark.html">style_mono_dark</a></span><span class="op">(</span>base_color <span class="op">=</span> <span class="st">"#cbf7ed"</span><span class="op">)</span></code></pre></div>
  125. <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_mono_dark.png" data-external="1"></p>
  126. </div>
  127. <div class="section level4">
  128. <h4 id="style_mono_accent">
  129. <code>style_mono_accent()</code><a class="anchor" aria-label="anchor" href="#style_mono_accent"></a>
  130. </h4>
  131. <p>The default xaringan theme with a single color used for color accents on select elements (headers, bold text, etc.).</p>
  132. <div class="sourceCode" id="cb3"><pre class="downlit sourceCode r">
  133. <code class="sourceCode R"><span class="fu"><a href="../reference/style_mono_accent.html">style_mono_accent</a></span><span class="op">(</span>base_color <span class="op">=</span> <span class="st">"#43418A"</span><span class="op">)</span></code></pre></div>
  134. <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_mono_accent.png" data-external="1"></p>
  135. </div>
  136. <div class="section level4">
  137. <h4 id="style_mono_accent_inverse">
  138. <code>style_mono_accent_inverse()</code><a class="anchor" aria-label="anchor" href="#style_mono_accent_inverse"></a>
  139. </h4>
  140. <p>An “inverted” default xaringan theme with a single color used for color accents on select elements (headers, bold text, etc.).</p>
  141. <div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
  142. <code class="sourceCode R"><span class="fu"><a href="../reference/style_mono_accent_inverse.html">style_mono_accent_inverse</a></span><span class="op">(</span>base_color <span class="op">=</span> <span class="st">"#3C989E"</span><span class="op">)</span></code></pre></div>
  143. <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_mono_accent_inverse.png" data-external="1"></p>
  144. </div>
  145. </div>
  146. <div class="section level3">
  147. <h3 id="duotone">Duotone<a class="anchor" aria-label="anchor" href="#duotone"></a>
  148. </h3>
  149. <p>These themes build from two (ideally) complementary colors.</p>
  150. <div class="section level4">
  151. <h4 id="style_duo">
  152. <code>style_duo()</code><a class="anchor" aria-label="anchor" href="#style_duo"></a>
  153. </h4>
  154. <p>A two-colored theme based on a primary and secondary color.</p>
  155. <div class="sourceCode" id="cb5"><pre class="downlit sourceCode r">
  156. <code class="sourceCode R"><span class="fu"><a href="../reference/style_duo.html">style_duo</a></span><span class="op">(</span>primary_color <span class="op">=</span> <span class="st">"#1F4257"</span>, secondary_color <span class="op">=</span> <span class="st">"#F97B64"</span><span class="op">)</span></code></pre></div>
  157. <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_duo.png" data-external="1"></p>
  158. </div>
  159. <div class="section level4">
  160. <h4 id="style_duo_accent">
  161. <code>style_duo_accent()</code><a class="anchor" aria-label="anchor" href="#style_duo_accent"></a>
  162. </h4>
  163. <p>The default Xaringan theme with two accent colors.</p>
  164. <div class="sourceCode" id="cb6"><pre class="downlit sourceCode r">
  165. <code class="sourceCode R"><span class="fu"><a href="../reference/style_duo_accent.html">style_duo_accent</a></span><span class="op">(</span>primary_color <span class="op">=</span> <span class="st">"#035AA6"</span>, secondary_color <span class="op">=</span> <span class="st">"#03A696"</span><span class="op">)</span></code></pre></div>
  166. <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_duo_accent.png" data-external="1"></p>
  167. </div>
  168. <div class="section level4">
  169. <h4 id="style_duo_accent_inverse">
  170. <code>style_duo_accent_inverse()</code><a class="anchor" aria-label="anchor" href="#style_duo_accent_inverse"></a>
  171. </h4>
  172. <p>An “inverted” default Xaringan theme with two accent colors.</p>
  173. <div class="sourceCode" id="cb7"><pre class="downlit sourceCode r">
  174. <code class="sourceCode R"><span class="fu"><a href="../reference/style_duo_accent_inverse.html">style_duo_accent_inverse</a></span><span class="op">(</span>primary_color <span class="op">=</span> <span class="st">"#035AA6"</span>, secondary_color <span class="op">=</span> <span class="st">"#03A696"</span><span class="op">)</span></code></pre></div>
  175. <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_duo_accent_inverse.png" data-external="1"></p>
  176. </div>
  177. </div>
  178. <div class="section level3">
  179. <h3 id="solarized">Solarized<a class="anchor" aria-label="anchor" href="#solarized"></a>
  180. </h3>
  181. <p>There are also two themes based around the <a href="https://ethanschoonover.com/solarized/" class="external-link">solarized color palette</a>, <code><a href="../reference/style_solarized_light.html">style_solarized_light()</a></code> and <code><a href="../reference/style_solarized_dark.html">style_solarized_dark()</a></code>. For both themes, it is advisted to change the syntax highlighting theme to <code>solarized-light</code> or <code>solarized-dark</code> (looks great paired or constrasted).</p>
  182. <div class="section level4">
  183. <h4 id="style_solarized_light">
  184. <code>style_solarized_light()</code><a class="anchor" aria-label="anchor" href="#style_solarized_light"></a>
  185. </h4>
  186. <div class="sourceCode" id="cb8"><pre class="downlit sourceCode r">
  187. <code class="sourceCode R"><span class="fu"><a href="../reference/style_solarized_light.html">style_solarized_light</a></span><span class="op">(</span><span class="op">)</span></code></pre></div>
  188. <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_solarized_light.png" data-external="1"></p>
  189. </div>
  190. <div class="section level4">
  191. <h4 id="style_solarized_dark">
  192. <code>style_solarized_dark()</code><a class="anchor" aria-label="anchor" href="#style_solarized_dark"></a>
  193. </h4>
  194. <div class="sourceCode" id="cb9"><pre class="downlit sourceCode r">
  195. <code class="sourceCode R"><span class="fu"><a href="../reference/style_solarized_dark.html">style_solarized_dark</a></span><span class="op">(</span><span class="op">)</span></code></pre></div>
  196. <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_solarized_dark.png" data-external="1"></p>
  197. <p>To do this, your YAML header should look more-or-less like this:</p>
  198. <div class="sourceCode" id="cb10"><pre class="sourceCode yaml"><code class="sourceCode yaml"><span id="cb10-1"><a href="#cb10-1"></a><span class="fu">output</span><span class="kw">:</span></span>
  199. <span id="cb10-2"><a href="#cb10-2"></a><span class="at"> xaringan:</span><span class="fu">:moon_reader</span><span class="kw">:</span></span>
  200. <span id="cb10-3"><a href="#cb10-3"></a><span class="at"> </span><span class="fu">css</span><span class="kw">:</span><span class="at"> </span><span class="kw">[</span><span class="st">"xaringan-themer.css"</span><span class="kw">]</span></span>
  201. <span id="cb10-4"><a href="#cb10-4"></a><span class="at"> </span><span class="fu">nature</span><span class="kw">:</span></span>
  202. <span id="cb10-5"><a href="#cb10-5"></a><span class="at"> </span><span class="fu">highlightStyle</span><span class="kw">:</span><span class="at"> solarized-dark</span></span>
  203. <span id="cb10-6"><a href="#cb10-6"></a><span class="at"> </span><span class="fu">highlightLines</span><span class="kw">:</span><span class="at"> </span><span class="ch">true</span></span>
  204. <span id="cb10-7"><a href="#cb10-7"></a><span class="at"> </span><span class="fu">countIncrementalSlides</span><span class="kw">:</span><span class="at"> </span><span class="ch">false</span></span></code></pre></div>
  205. </div>
  206. </div>
  207. <div class="section level2">
  208. <h2 id="colors">Colors<a class="anchor" aria-label="anchor" href="#colors"></a>
  209. </h2>
  210. <p>When designing your xaringan theme, you may have additional colors in your desired color palette beyond those used in the accent colors of the mono and duotone styles.</p>
  211. <p>The <code>style*()</code> functions in xaringanthemer include a <code>colors</code> argument that lets you quickly define additional colors to use in your slides. This argument takes a vector of named colors</p>
  212. <div class="sourceCode" id="cb11"><pre class="downlit sourceCode r">
  213. <code class="sourceCode R"><span class="va">colors</span> <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span>
  214. red <span class="op">=</span> <span class="st">"#f34213"</span>,
  215. purple <span class="op">=</span> <span class="st">"#3e2f5b"</span>,
  216. orange <span class="op">=</span> <span class="st">"#ff8811"</span>,
  217. green <span class="op">=</span> <span class="st">"#136f63"</span>,
  218. white <span class="op">=</span> <span class="st">"#FFFFFF"</span>
  219. <span class="op">)</span></code></pre></div>
  220. <p>and creates CSS classes from the color name that set the text color — e.g. <code>.red</code> — or that set the background color — e.g. <code>.bg-red</code>. If you use custom CSS in your slides, the color name is also stored in a CSS variable — e.g. <code>var(--red)</code>.</p>
  221. <p>So slide text like this</p>
  222. <div class="sourceCode" id="cb12"><pre class="sourceCode markdown"><code class="sourceCode markdown"><span id="cb12-1"><a href="#cb12-1"></a>This **.red[simple]** .white.bg-purple[demo] </span>
  223. <span id="cb12-2"><a href="#cb12-2"></a>_.orange[shows]_ the colors .green[in action].</span></code></pre></div>
  224. <p>will be rendered in HTML as</p>
  225. <blockquote>
  226. This <strong><span style="color: #f34213">simple</span></strong> <span style="color:#FFFFFF;background-color:#3e2f5b;">demo</span> <em style="color:#ff8811">shows</em> the colors <span style="color:#136f63">in action</span>.
  227. </blockquote>
  228. <p>Note that the color names in <code>colors</code> need to be valid CSS names, so <code>"purple-light"</code> will work, but <code>"purple light"</code> will not.</p>
  229. </div>
  230. </main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>
  231. </nav></aside>
  232. </div>
  233. <footer><div class="pkgdown-footer-left">
  234. <p></p>
  235. <p>Developed by <a href="https://www.garrickadenbuie.com" class="external-link">Garrick Aden-Buie</a>.</p>
  236. </div>
  237. <div class="pkgdown-footer-right">
  238. <p></p>
  239. <p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.1.</p>
  240. </div>
  241. </footer>
  242. </div>
  243. </body>
  244. </html>