😎 Give your xaringan slides some style
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

296 lines
19KB

  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.0">
  8. <title>Themes • xaringanthemer</title>
  9. <!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
  10. <link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png">
  11. <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png">
  12. <link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png">
  13. <link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png">
  14. <link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png">
  15. <!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha256-bZLfwXAP04zRMK2BjiO8iu9pf4FbLqX6zitd+tIvLhE=" crossorigin="anonymous">
  16. <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css">
  17. <script src="../bootstrap-toc.js"></script><!-- 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">
  18. <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">
  19. <!-- 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><!-- 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><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet">
  20. <script src="../pkgdown.js"></script><link href="../extra.css" rel="stylesheet">
  21. <meta property="og:title" content="Themes">
  22. <meta property="og:description" content="xaringanthemer">
  23. <meta property="og:image" content="https://pkg.garrickadenbuie.com/xaringanthemer/logo.png">
  24. <meta name="twitter:card" content="summary">
  25. <meta name="twitter:creator" content="@grrrck">
  26. <meta name="twitter:site" content="@grrrck">
  27. <!-- 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]>
  28. <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  29. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  30. <![endif]-->
  31. </head>
  32. <body data-spy="scroll" data-target="#toc">
  33. <div class="container template-article">
  34. <header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
  35. <div class="container">
  36. <div class="navbar-header">
  37. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
  38. <span class="sr-only">Toggle navigation</span>
  39. <span class="icon-bar"></span>
  40. <span class="icon-bar"></span>
  41. <span class="icon-bar"></span>
  42. </button>
  43. <span class="navbar-brand">
  44. <a class="navbar-link" href="../index.html">xaringanthemer</a>
  45. <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.4.0</span>
  46. </span>
  47. </div>
  48. <div id="navbar" class="navbar-collapse collapse">
  49. <ul class="nav navbar-nav">
  50. <li>
  51. <a href="../articles/xaringanthemer.html">Features</a>
  52. </li>
  53. <li>
  54. <a href="../reference/index.html">Reference</a>
  55. </li>
  56. <li>
  57. <a href="../articles/themes.html">Themes</a>
  58. </li>
  59. <li>
  60. <a href="../articles/ggplot2-themes.html">ggplot2 Themes</a>
  61. </li>
  62. <li class="dropdown">
  63. <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
  64. More
  65. <span class="caret"></span>
  66. </a>
  67. <ul class="dropdown-menu" role="menu">
  68. <li>
  69. <a href="../articles/fonts.html">Fonts</a>
  70. </li>
  71. <li>
  72. <a href="../articles/template-variables.html">Template Variables</a>
  73. </li>
  74. </ul>
  75. </li>
  76. </ul>
  77. <ul class="nav navbar-nav navbar-right">
  78. <li class="dropdown">
  79. <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
  80. <span class="far fa-newspaper fa-lg"></span>
  81. <span class="caret"></span>
  82. </a>
  83. <ul class="dropdown-menu" role="menu">
  84. <li>
  85. <a href="https://garrickadenbuie.com/blog/xaringanthemer-v0-3-0/">xaringan 0.3.0</a>
  86. </li>
  87. <li class="divider">
  88. <li>
  89. <a href="../news/index.html">Changelog</a>
  90. </li>
  91. </ul>
  92. </li>
  93. <li>
  94. <a href="https://github.com/gadenbuie/xaringanthemer">
  95. <span class="fab fa-github fa-lg"></span>
  96. </a>
  97. </li>
  98. <li>
  99. <a href="https://twitter.com/grrrck">
  100. <span class="fab fa-twitter fa-lg"></span>
  101. </a>
  102. </li>
  103. <li>
  104. <a href="https://www.garrickadenbuie.com">
  105. <span class="fas fa-home fa-lg"></span>
  106. </a>
  107. </li>
  108. </ul>
  109. </div>
  110. <!--/.nav-collapse -->
  111. </div>
  112. <!--/.container -->
  113. </div>
  114. <!--/.navbar -->
  115. </header><script src="themes_files/accessible-code-block-0.0.1/empty-anchor.js"></script><div class="row">
  116. <div class="col-md-9 contents">
  117. <div class="page-header toc-ignore">
  118. <h1 data-toc-skip>Themes</h1>
  119. <small class="dont-index">Source: <a href="https://github.com/gadenbuie/xaringanthemer/blob/master/vignettes/themes.Rmd"><code>vignettes/themes.Rmd</code></a></small>
  120. <div class="hidden name"><code>themes.Rmd</code></div>
  121. </div>
  122. <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>
  123. <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>
  124. <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>
  125. <p>If you 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>
  126. <div id="monotone" class="section level3">
  127. <h3 class="hasAnchor">
  128. <a href="#monotone" class="anchor"></a>Monotone</h3>
  129. <p>Use these functions to automatically create a consistent color palette for your slides, based around a single color.</p>
  130. <div id="style_mono_light" class="section level4">
  131. <h4 class="hasAnchor">
  132. <a href="#style_mono_light" class="anchor"></a><code>style_mono_light()</code>
  133. </h4>
  134. <p>A light theme based around a single color.</p>
  135. <div class="sourceCode" id="cb1"><pre class="downlit sourceCode r">
  136. <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>
  137. <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_mono_light.png" data-external="1"></p>
  138. </div>
  139. <div id="style_mono_dark" class="section level4">
  140. <h4 class="hasAnchor">
  141. <a href="#style_mono_dark" class="anchor"></a><code>style_mono_dark()</code>
  142. </h4>
  143. <p>A dark theme based around a single color.</p>
  144. <div class="sourceCode" id="cb2"><pre class="downlit sourceCode r">
  145. <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>
  146. <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_mono_dark.png" data-external="1"></p>
  147. </div>
  148. <div id="style_mono_accent" class="section level4">
  149. <h4 class="hasAnchor">
  150. <a href="#style_mono_accent" class="anchor"></a><code>style_mono_accent()</code>
  151. </h4>
  152. <p>The default xaringan theme with a single color used for color accents on select elements (headers, bold text, etc.).</p>
  153. <div class="sourceCode" id="cb3"><pre class="downlit sourceCode r">
  154. <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>
  155. <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_mono_accent.png" data-external="1"></p>
  156. </div>
  157. <div id="style_mono_accent_inverse" class="section level4">
  158. <h4 class="hasAnchor">
  159. <a href="#style_mono_accent_inverse" class="anchor"></a><code>style_mono_accent_inverse()</code>
  160. </h4>
  161. <p>An “inverted” default xaringan theme with a single color used for color accents on select elements (headers, bold text, etc.).</p>
  162. <div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
  163. <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>
  164. <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_mono_accent_inverse.png" data-external="1"></p>
  165. </div>
  166. </div>
  167. <div id="duotone" class="section level3">
  168. <h3 class="hasAnchor">
  169. <a href="#duotone" class="anchor"></a>Duotone</h3>
  170. <p>These themes build from two (ideally) complementary colors.</p>
  171. <div id="style_duo" class="section level4">
  172. <h4 class="hasAnchor">
  173. <a href="#style_duo" class="anchor"></a><code>style_duo()</code>
  174. </h4>
  175. <p>A two-colored theme based on a primary and secondary color.</p>
  176. <div class="sourceCode" id="cb5"><pre class="downlit sourceCode r">
  177. <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>
  178. <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_duo.png" data-external="1"></p>
  179. </div>
  180. <div id="style_duo_accent" class="section level4">
  181. <h4 class="hasAnchor">
  182. <a href="#style_duo_accent" class="anchor"></a><code>style_duo_accent()</code>
  183. </h4>
  184. <p>The default Xaringan theme with two accent colors.</p>
  185. <div class="sourceCode" id="cb6"><pre class="downlit sourceCode r">
  186. <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>
  187. <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_duo_accent.png" data-external="1"></p>
  188. </div>
  189. <div id="style_duo_accent_inverse" class="section level4">
  190. <h4 class="hasAnchor">
  191. <a href="#style_duo_accent_inverse" class="anchor"></a><code>style_duo_accent_inverse()</code>
  192. </h4>
  193. <p>An “inverted” default Xaringan theme with two accent colors.</p>
  194. <div class="sourceCode" id="cb7"><pre class="downlit sourceCode r">
  195. <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>
  196. <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_duo_accent_inverse.png" data-external="1"></p>
  197. </div>
  198. </div>
  199. <div id="solarized" class="section level3">
  200. <h3 class="hasAnchor">
  201. <a href="#solarized" class="anchor"></a>Solarized</h3>
  202. <p>There are also two themes based around the <a href="https://ethanschoonover.com/solarized/">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>
  203. <div id="style_solarized_light" class="section level4">
  204. <h4 class="hasAnchor">
  205. <a href="#style_solarized_light" class="anchor"></a><code>style_solarized_light()</code>
  206. </h4>
  207. <div class="sourceCode" id="cb8"><pre class="downlit sourceCode r">
  208. <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>
  209. <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_solarized_light.png" data-external="1"></p>
  210. </div>
  211. <div id="style_solarized_dark" class="section level4">
  212. <h4 class="hasAnchor">
  213. <a href="#style_solarized_dark" class="anchor"></a><code>style_solarized_dark()</code>
  214. </h4>
  215. <div class="sourceCode" id="cb9"><pre class="downlit sourceCode r">
  216. <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>
  217. <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_solarized_dark.png" data-external="1"></p>
  218. <p>To do this, your YAML header should look more-or-less like this:</p>
  219. <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>
  220. <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>
  221. <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>
  222. <span id="cb10-4"><a href="#cb10-4"></a><span class="at"> </span><span class="fu">nature</span><span class="kw">:</span></span>
  223. <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>
  224. <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>
  225. <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>
  226. </div>
  227. </div>
  228. <div id="colors" class="section level2">
  229. <h2 class="hasAnchor">
  230. <a href="#colors" class="anchor"></a>Colors</h2>
  231. <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>
  232. <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>
  233. <div class="sourceCode" id="cb11"><pre class="downlit sourceCode r">
  234. <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">c</a></span><span class="op">(</span>
  235. red <span class="op">=</span> <span class="st">"#f34213"</span>,
  236. purple <span class="op">=</span> <span class="st">"#3e2f5b"</span>,
  237. orange <span class="op">=</span> <span class="st">"#ff8811"</span>,
  238. green <span class="op">=</span> <span class="st">"#136f63"</span>,
  239. white <span class="op">=</span> <span class="st">"#FFFFFF"</span>
  240. <span class="op">)</span></code></pre></div>
  241. <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><a href="https://rdrr.io/r/stats/cor.html">var(--red)</a></code>.</p>
  242. <p>So slide text like this</p>
  243. <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>
  244. <span id="cb12-2"><a href="#cb12-2"></a>_.orange[shows]_ the colors .green[in action].</span></code></pre></div>
  245. <p>will be rendered in HTML as</p>
  246. <blockquote>
  247. 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>.
  248. </blockquote>
  249. <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>
  250. </div>
  251. </div>
  252. <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
  253. <nav id="toc" data-toggle="toc"><h2 data-toc-skip>Contents</h2>
  254. </nav>
  255. </div>
  256. </div>
  257. <footer><div class="copyright">
  258. <p>Developed by <a href="https://www.garrickadenbuie.com">Garrick Aden-Buie</a>.</p>
  259. </div>
  260. <div class="pkgdown">
  261. <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
  262. </div>
  263. </footer>
  264. </div>
  265. </body>
  266. </html>