|
- <!DOCTYPE html>
- <!-- Generated by pkgdown: do not edit by hand --><html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Themes • xaringanthemer</title>
- <!-- favicons --><link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
- <link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png">
- <link rel="apple-touch-icon" type="image/png" sizes="180x180" href="../apple-touch-icon.png">
- <link rel="apple-touch-icon" type="image/png" sizes="120x120" href="../apple-touch-icon-120x120.png">
- <link rel="apple-touch-icon" type="image/png" sizes="76x76" href="../apple-touch-icon-76x76.png">
- <link rel="apple-touch-icon" type="image/png" sizes="60x60" href="../apple-touch-icon-60x60.png">
- <!-- 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">
- <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">
- <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">
- <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">
- <!-- 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">
- <script src="../pkgdown.js"></script><link href="../extra.css" rel="stylesheet">
- <meta property="og:title" content="Themes">
- <meta property="og:description" content="xaringanthemer">
- <meta property="og:image" content="https://pkg.garrickadenbuie.com/xaringanthemer/logo.png">
- <meta name="twitter:card" content="summary">
- <meta name="twitter:creator" content="@grrrck">
- <meta name="twitter:site" content="@grrrck">
- <meta name="robots" content="noindex">
- <!-- 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]>
- <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
- <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
- <![endif]-->
- </head>
- <body data-spy="scroll" data-target="#toc">
- <div class="container template-article">
- <header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
- <div class="container">
- <div class="navbar-header">
- <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
- <span class="sr-only">Toggle navigation</span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
- <span class="navbar-brand">
- <a class="navbar-link" href="../index.html">xaringanthemer</a>
- <span class="version label label-danger" data-toggle="tooltip" data-placement="bottom" title="In-development version">0.4.0.9000</span>
- </span>
- </div>
-
- <div id="navbar" class="navbar-collapse collapse">
- <ul class="nav navbar-nav">
- <li>
- <a href="../articles/xaringanthemer.html">Features</a>
- </li>
- <li>
- <a href="../reference/index.html">Reference</a>
- </li>
- <li>
- <a href="../articles/themes.html">Themes</a>
- </li>
- <li>
- <a href="../articles/ggplot2-themes.html">ggplot2 Themes</a>
- </li>
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
- More
-
- <span class="caret"></span>
- </a>
- <ul class="dropdown-menu" role="menu">
- <li>
- <a href="../articles/fonts.html">Fonts</a>
- </li>
- <li>
- <a href="../articles/template-variables.html">Template Variables</a>
- </li>
- </ul>
- </li>
- </ul>
- <ul class="nav navbar-nav navbar-right">
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
- <span class="far fa-newspaper fa-lg"></span>
-
-
-
- <span class="caret"></span>
- </a>
- <ul class="dropdown-menu" role="menu">
- <li>
- <a href="https://garrickadenbuie.com/blog/xaringanthemer-v0-3-0/">xaringanthemer 0.3.0</a>
- </li>
- <li class="divider">
- <li>
- <a href="../news/index.html">Changelog</a>
- </li>
- </ul>
- </li>
- <li>
- <a href="https://github.com/gadenbuie/xaringanthemer">
- <span class="fab fa-github fa-lg"></span>
-
- </a>
- </li>
- <li>
- <a href="https://twitter.com/grrrck">
- <span class="fab fa-twitter fa-lg"></span>
-
- </a>
- </li>
- <li>
- <a href="https://www.garrickadenbuie.com">
- <span class="fas fa-home fa-lg"></span>
-
- </a>
- </li>
- </ul>
- </div>
- <!--/.nav-collapse -->
- </div>
- <!--/.container -->
- </div>
- <!--/.navbar -->
-
-
-
- </header><script src="themes_files/accessible-code-block-0.0.1/empty-anchor.js"></script><div class="row">
- <div class="col-md-9 contents">
- <div class="page-header toc-ignore">
- <h1 data-toc-skip>Themes</h1>
-
-
- <small class="dont-index">Source: <a href="https://github.com/gadenbuie/xaringanthemer/blob/master/vignettes/themes.Rmd"><code>vignettes/themes.Rmd</code></a></small>
- <div class="hidden name"><code>themes.Rmd</code></div>
-
- </div>
-
-
-
- <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>
- <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>
- <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>
- <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>
- <div id="monotone" class="section level3">
- <h3 class="hasAnchor">
- <a href="#monotone" class="anchor"></a>Monotone</h3>
- <p>Use these functions to automatically create a consistent color palette for your slides, based around a single color.</p>
- <div id="style_mono_light" class="section level4">
- <h4 class="hasAnchor">
- <a href="#style_mono_light" class="anchor"></a><code>style_mono_light()</code>
- </h4>
- <p>A light theme based around a single color.</p>
- <div class="sourceCode" id="cb1"><pre class="downlit sourceCode r">
- <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>
- <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_mono_light.png" data-external="1"></p>
- </div>
- <div id="style_mono_dark" class="section level4">
- <h4 class="hasAnchor">
- <a href="#style_mono_dark" class="anchor"></a><code>style_mono_dark()</code>
- </h4>
- <p>A dark theme based around a single color.</p>
- <div class="sourceCode" id="cb2"><pre class="downlit sourceCode r">
- <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>
- <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_mono_dark.png" data-external="1"></p>
- </div>
- <div id="style_mono_accent" class="section level4">
- <h4 class="hasAnchor">
- <a href="#style_mono_accent" class="anchor"></a><code>style_mono_accent()</code>
- </h4>
- <p>The default xaringan theme with a single color used for color accents on select elements (headers, bold text, etc.).</p>
- <div class="sourceCode" id="cb3"><pre class="downlit sourceCode r">
- <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>
- <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_mono_accent.png" data-external="1"></p>
- </div>
- <div id="style_mono_accent_inverse" class="section level4">
- <h4 class="hasAnchor">
- <a href="#style_mono_accent_inverse" class="anchor"></a><code>style_mono_accent_inverse()</code>
- </h4>
- <p>An “inverted” default xaringan theme with a single color used for color accents on select elements (headers, bold text, etc.).</p>
- <div class="sourceCode" id="cb4"><pre class="downlit sourceCode r">
- <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>
- <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_mono_accent_inverse.png" data-external="1"></p>
- </div>
- </div>
- <div id="duotone" class="section level3">
- <h3 class="hasAnchor">
- <a href="#duotone" class="anchor"></a>Duotone</h3>
- <p>These themes build from two (ideally) complementary colors.</p>
- <div id="style_duo" class="section level4">
- <h4 class="hasAnchor">
- <a href="#style_duo" class="anchor"></a><code>style_duo()</code>
- </h4>
- <p>A two-colored theme based on a primary and secondary color.</p>
- <div class="sourceCode" id="cb5"><pre class="downlit sourceCode r">
- <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>
- <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_duo.png" data-external="1"></p>
- </div>
- <div id="style_duo_accent" class="section level4">
- <h4 class="hasAnchor">
- <a href="#style_duo_accent" class="anchor"></a><code>style_duo_accent()</code>
- </h4>
- <p>The default Xaringan theme with two accent colors.</p>
- <div class="sourceCode" id="cb6"><pre class="downlit sourceCode r">
- <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>
- <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_duo_accent.png" data-external="1"></p>
- </div>
- <div id="style_duo_accent_inverse" class="section level4">
- <h4 class="hasAnchor">
- <a href="#style_duo_accent_inverse" class="anchor"></a><code>style_duo_accent_inverse()</code>
- </h4>
- <p>An “inverted” default Xaringan theme with two accent colors.</p>
- <div class="sourceCode" id="cb7"><pre class="downlit sourceCode r">
- <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>
- <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_duo_accent_inverse.png" data-external="1"></p>
- </div>
- </div>
- <div id="solarized" class="section level3">
- <h3 class="hasAnchor">
- <a href="#solarized" class="anchor"></a>Solarized</h3>
- <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>
- <div id="style_solarized_light" class="section level4">
- <h4 class="hasAnchor">
- <a href="#style_solarized_light" class="anchor"></a><code>style_solarized_light()</code>
- </h4>
- <div class="sourceCode" id="cb8"><pre class="downlit sourceCode r">
- <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>
- <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_solarized_light.png" data-external="1"></p>
- </div>
- <div id="style_solarized_dark" class="section level4">
- <h4 class="hasAnchor">
- <a href="#style_solarized_dark" class="anchor"></a><code>style_solarized_dark()</code>
- </h4>
- <div class="sourceCode" id="cb9"><pre class="downlit sourceCode r">
- <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>
- <p><img src="https://raw.githubusercontent.com/gadenbuie/xaringanthemer/assets/example_solarized_dark.png" data-external="1"></p>
- <p>To do this, your YAML header should look more-or-less like this:</p>
- <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>
- <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>
- <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>
- <span id="cb10-4"><a href="#cb10-4"></a><span class="at"> </span><span class="fu">nature</span><span class="kw">:</span></span>
- <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>
- <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>
- <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>
- </div>
- </div>
- <div id="colors" class="section level2">
- <h2 class="hasAnchor">
- <a href="#colors" class="anchor"></a>Colors</h2>
- <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>
- <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>
- <div class="sourceCode" id="cb11"><pre class="downlit sourceCode r">
- <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>
- red <span class="op">=</span> <span class="st">"#f34213"</span>,
- purple <span class="op">=</span> <span class="st">"#3e2f5b"</span>,
- orange <span class="op">=</span> <span class="st">"#ff8811"</span>,
- green <span class="op">=</span> <span class="st">"#136f63"</span>,
- white <span class="op">=</span> <span class="st">"#FFFFFF"</span>
- <span class="op">)</span></code></pre></div>
- <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>
- <p>So slide text like this</p>
- <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>
- <span id="cb12-2"><a href="#cb12-2"></a>_.orange[shows]_ the colors .green[in action].</span></code></pre></div>
- <p>will be rendered in HTML as</p>
- <blockquote>
- 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>.
- </blockquote>
- <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>
- </div>
- </div>
-
- <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
-
- <nav id="toc" data-toggle="toc"><h2 data-toc-skip>Contents</h2>
- </nav>
- </div>
-
- </div>
-
-
-
- <footer><div class="copyright">
- <p>Developed by <a href="https://www.garrickadenbuie.com">Garrick Aden-Buie</a>.</p>
- </div>
-
- <div class="pkgdown">
- <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.6.1.</p>
- </div>
-
- </footer>
- </div>
-
-
-
-
- </body>
- </html>
|