😎 Give your xaringan slides some style
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

723 líneas
41KB

  1. <!DOCTYPE html>
  2. <!-- 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, shrink-to-fit=no"><meta name="description" content="Creates a customized Xaringan theme CSS file."><title>Write A Customized Xaringan Theme — xaringanthemer_font_default • 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"><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"><link href="../deps/bootstrap-5.1.3/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.1.3/bootstrap.bundle.min.js"></script><link href="../deps/IBM_Plex_Mono-0.4.2/font.css" rel="stylesheet"><link href="../deps/Outfit-0.4.2/font.css" rel="stylesheet"><!-- 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"><!-- 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"><meta property="og:title" content="Write A Customized Xaringan Theme — xaringanthemer_font_default"><meta property="og:description" content="Creates a customized Xaringan theme CSS file."><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]>
  3. <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  4. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  5. <![endif]--></head><body>
  6. <a href="#main" class="visually-hidden-focusable">Skip to contents</a>
  7. <nav class="navbar fixed-top navbar-light navbar-expand-lg bg-light"><div class="container">
  8. <a class="navbar-brand me-2" href="../index.html">xaringanthemer</a>
  9. <small class="nav-text text-danger me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="In-development version">0.4.1.9000</small>
  10. <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
  11. <span class="navbar-toggler-icon"></span>
  12. </button>
  13. <div id="navbar" class="collapse navbar-collapse ms-3">
  14. <ul class="navbar-nav me-auto"><li class="nav-item">
  15. <a class="nav-link" href="../articles/xaringanthemer.html">Features</a>
  16. </li>
  17. <li class="active nav-item">
  18. <a class="nav-link" href="../reference/index.html">Reference</a>
  19. </li>
  20. <li class="nav-item dropdown">
  21. <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown" role="button" aria-expanded="false" aria-haspopup="true" id="dropdown-themes">Themes</a>
  22. <div class="dropdown-menu" aria-labelledby="dropdown-themes">
  23. <h6 class="dropdown-header" data-toc-skip>Themes</h6>
  24. <a class="dropdown-item" href="../articles/themes.html">Slide Themes</a>
  25. <a class="dropdown-item" href="../articles/ggplot2-themes.html">ggplot2 Themes</a>
  26. <div class="dropdown-divider"></div>
  27. <h6 class="dropdown-header" data-toc-skip>More Customization</h6>
  28. <a class="dropdown-item" href="../articles/fonts.html">Fonts</a>
  29. <a class="dropdown-item" href="../articles/template-variables.html">Template Variables</a>
  30. </div>
  31. </li>
  32. </ul><form class="form-inline my-2 my-lg-0" role="search">
  33. <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"></form>
  34. <ul class="navbar-nav"><li class="nav-item dropdown">
  35. <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown" role="button" aria-expanded="false" aria-haspopup="true" id="dropdown--">
  36. <span class="far fa far fa-newspaper fa-lg"></span>
  37. </a>
  38. <div class="dropdown-menu" aria-labelledby="dropdown--">
  39. <a class="external-link dropdown-item" href="https://garrickadenbuie.com/blog/xaringanthemer-v0-3-0/">xaringanthemer 0.3.0</a>
  40. <div class="dropdown-divider"></div>
  41. <a class="dropdown-item" href="../news/index.html">Changelog</a>
  42. </div>
  43. </li>
  44. <li class="nav-item">
  45. <a class="external-link nav-link" href="https://github.com/gadenbuie/xaringanthemer">
  46. <span class="fab fa fab fa-github fa-lg"></span>
  47. </a>
  48. </li>
  49. <li class="nav-item">
  50. <a class="external-link nav-link" href="https://twitter.com/grrrck">
  51. <span class="fab fa fab fa-twitter fa-lg"></span>
  52. </a>
  53. </li>
  54. <li class="nav-item">
  55. <a class="external-link nav-link" href="https://www.garrickadenbuie.com">
  56. <span class="fas fa fas fa-home fa-lg"></span>
  57. </a>
  58. </li>
  59. </ul></div>
  60. </div>
  61. </nav><div class="container template-reference-topic">
  62. <div class="row">
  63. <main id="main" class="col-md-9"><div class="page-header">
  64. <img src="../logo.png" class="logo" alt=""><h1>Write A Customized Xaringan Theme</h1>
  65. <small class="dont-index">Source: <a href="https://github.com/gadenbuie/xaringanthemer/blob/HEAD/R/style_font_default.R" class="external-link"><code>R/style_font_default.R</code></a>, <a href="https://github.com/gadenbuie/xaringanthemer/blob/HEAD/R/style_xaringan.R" class="external-link"><code>R/style_xaringan.R</code></a></small>
  66. <div class="d-none name"><code>style_xaringan.Rd</code></div>
  67. </div>
  68. <div class="ref-description section level2">
  69. <p>Creates a customized Xaringan theme CSS file.</p>
  70. </div>
  71. <div class="section level2">
  72. <h2 id="ref-usage">Usage<a class="anchor" aria-label="anchor" href="#ref-usage"></a></h2>
  73. <div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">xaringanthemer_font_default</span><span class="op">(</span><span class="va">font_arg</span><span class="op">)</span></span>
  74. <span></span>
  75. <span><span class="fu">style_xaringan</span><span class="op">(</span></span>
  76. <span> text_color <span class="op">=</span> <span class="st">"#000"</span>,</span>
  77. <span> header_color <span class="op">=</span> <span class="st">"#000"</span>,</span>
  78. <span> background_color <span class="op">=</span> <span class="st">"#FFF"</span>,</span>
  79. <span> link_color <span class="op">=</span> <span class="st">"rgb(249, 38, 114)"</span>,</span>
  80. <span> text_bold_color <span class="op">=</span> <span class="cn">NULL</span>,</span>
  81. <span> text_slide_number_color <span class="op">=</span> <span class="va">inverse_background_color</span>,</span>
  82. <span> padding <span class="op">=</span> <span class="st">"16px 64px 16px 64px"</span>,</span>
  83. <span> background_image <span class="op">=</span> <span class="cn">NULL</span>,</span>
  84. <span> background_size <span class="op">=</span> <span class="cn">NULL</span>,</span>
  85. <span> background_position <span class="op">=</span> <span class="cn">NULL</span>,</span>
  86. <span> code_highlight_color <span class="op">=</span> <span class="st">"rgba(255,255,0,0.5)"</span>,</span>
  87. <span> code_inline_color <span class="op">=</span> <span class="st">"#000"</span>,</span>
  88. <span> code_inline_background_color <span class="op">=</span> <span class="cn">NULL</span>,</span>
  89. <span> code_inline_font_size <span class="op">=</span> <span class="st">"1em"</span>,</span>
  90. <span> inverse_background_color <span class="op">=</span> <span class="st">"#272822"</span>,</span>
  91. <span> inverse_text_color <span class="op">=</span> <span class="st">"#d6d6d6"</span>,</span>
  92. <span> inverse_text_shadow <span class="op">=</span> <span class="cn">FALSE</span>,</span>
  93. <span> inverse_header_color <span class="op">=</span> <span class="st">"#f3f3f3"</span>,</span>
  94. <span> inverse_link_color <span class="op">=</span> <span class="va">link_color</span>,</span>
  95. <span> title_slide_text_color <span class="op">=</span> <span class="va">inverse_text_color</span>,</span>
  96. <span> title_slide_background_color <span class="op">=</span> <span class="va">inverse_background_color</span>,</span>
  97. <span> title_slide_background_image <span class="op">=</span> <span class="cn">NULL</span>,</span>
  98. <span> title_slide_background_size <span class="op">=</span> <span class="cn">NULL</span>,</span>
  99. <span> title_slide_background_position <span class="op">=</span> <span class="cn">NULL</span>,</span>
  100. <span> footnote_color <span class="op">=</span> <span class="cn">NULL</span>,</span>
  101. <span> footnote_font_size <span class="op">=</span> <span class="st">"0.9em"</span>,</span>
  102. <span> footnote_position_bottom <span class="op">=</span> <span class="st">"60px"</span>,</span>
  103. <span> left_column_subtle_color <span class="op">=</span> <span class="st">"#777"</span>,</span>
  104. <span> left_column_selected_color <span class="op">=</span> <span class="st">"#000"</span>,</span>
  105. <span> blockquote_left_border_color <span class="op">=</span> <span class="st">"lightgray"</span>,</span>
  106. <span> table_border_color <span class="op">=</span> <span class="st">"#666"</span>,</span>
  107. <span> table_row_border_color <span class="op">=</span> <span class="st">"#ddd"</span>,</span>
  108. <span> table_row_even_background_color <span class="op">=</span> <span class="st">"#eee"</span>,</span>
  109. <span> base_font_size <span class="op">=</span> <span class="st">"20px"</span>,</span>
  110. <span> text_font_size <span class="op">=</span> <span class="st">"1rem"</span>,</span>
  111. <span> header_h1_font_size <span class="op">=</span> <span class="st">"2.75rem"</span>,</span>
  112. <span> header_h2_font_size <span class="op">=</span> <span class="st">"2.25rem"</span>,</span>
  113. <span> header_h3_font_size <span class="op">=</span> <span class="st">"1.75rem"</span>,</span>
  114. <span> header_background_auto <span class="op">=</span> <span class="cn">FALSE</span>,</span>
  115. <span> header_background_color <span class="op">=</span> <span class="va">header_color</span>,</span>
  116. <span> header_background_text_color <span class="op">=</span> <span class="va">background_color</span>,</span>
  117. <span> header_background_padding <span class="op">=</span> <span class="cn">NULL</span>,</span>
  118. <span> header_background_content_padding_top <span class="op">=</span> <span class="st">"7rem"</span>,</span>
  119. <span> header_background_ignore_classes <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><span class="st">"normal"</span>, <span class="st">"inverse"</span>, <span class="st">"title"</span>, <span class="st">"middle"</span>, <span class="st">"bottom"</span><span class="op">)</span>,</span>
  120. <span> text_slide_number_font_size <span class="op">=</span> <span class="st">"0.9rem"</span>,</span>
  121. <span> text_font_google <span class="op">=</span> <span class="cn">NULL</span>,</span>
  122. <span> text_font_family <span class="op">=</span> <span class="fu">xaringanthemer_font_default</span><span class="op">(</span><span class="st">"text_font_family"</span><span class="op">)</span>,</span>
  123. <span> text_font_weight <span class="op">=</span> <span class="fu">xaringanthemer_font_default</span><span class="op">(</span><span class="st">"text_font_weight"</span><span class="op">)</span>,</span>
  124. <span> text_bold_font_weight <span class="op">=</span> <span class="st">"bold"</span>,</span>
  125. <span> text_font_url <span class="op">=</span> <span class="fu">xaringanthemer_font_default</span><span class="op">(</span><span class="st">"text_font_url"</span><span class="op">)</span>,</span>
  126. <span> text_font_family_fallback <span class="op">=</span> <span class="fu">xaringanthemer_font_default</span><span class="op">(</span><span class="st">"text_font_family_fallback"</span><span class="op">)</span>,</span>
  127. <span> text_font_base <span class="op">=</span> <span class="st">"sans-serif"</span>,</span>
  128. <span> header_font_google <span class="op">=</span> <span class="cn">NULL</span>,</span>
  129. <span> header_font_family <span class="op">=</span> <span class="fu">xaringanthemer_font_default</span><span class="op">(</span><span class="st">"header_font_family"</span><span class="op">)</span>,</span>
  130. <span> header_font_weight <span class="op">=</span> <span class="fu">xaringanthemer_font_default</span><span class="op">(</span><span class="st">"header_font_weight"</span><span class="op">)</span>,</span>
  131. <span> header_font_family_fallback <span class="op">=</span> <span class="st">"Georgia, serif"</span>,</span>
  132. <span> header_font_url <span class="op">=</span> <span class="fu">xaringanthemer_font_default</span><span class="op">(</span><span class="st">"header_font_url"</span><span class="op">)</span>,</span>
  133. <span> code_font_google <span class="op">=</span> <span class="cn">NULL</span>,</span>
  134. <span> code_font_family <span class="op">=</span> <span class="fu">xaringanthemer_font_default</span><span class="op">(</span><span class="st">"code_font_family"</span><span class="op">)</span>,</span>
  135. <span> code_font_size <span class="op">=</span> <span class="st">"0.9rem"</span>,</span>
  136. <span> code_font_url <span class="op">=</span> <span class="fu">xaringanthemer_font_default</span><span class="op">(</span><span class="st">"code_font_url"</span><span class="op">)</span>,</span>
  137. <span> code_font_family_fallback <span class="op">=</span> <span class="fu">xaringanthemer_font_default</span><span class="op">(</span><span class="st">"code_font_family_fallback"</span><span class="op">)</span>,</span>
  138. <span> link_decoration <span class="op">=</span> <span class="st">"none"</span>,</span>
  139. <span> colors <span class="op">=</span> <span class="cn">NULL</span>,</span>
  140. <span> extra_css <span class="op">=</span> <span class="cn">NULL</span>,</span>
  141. <span> extra_fonts <span class="op">=</span> <span class="cn">NULL</span>,</span>
  142. <span> outfile <span class="op">=</span> <span class="st">"xaringan-themer.css"</span></span>
  143. <span><span class="op">)</span></span></code></pre></div>
  144. </div>
  145. <div class="section level2">
  146. <h2 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#arguments"></a></h2>
  147. <dl><dt>font_arg</dt>
  148. <dd><p>A font argument from the <span class="pkg">xaringanthemer</span> <code>style_</code>
  149. function family.</p></dd>
  150. <dt>text_color</dt>
  151. <dd><p>Text Color. Defaults to #000. Modifies the <code>body</code> element.
  152. The value of this variable is also stored as a CSS variable that can be
  153. referenced with <code>var(--text_color)</code> in any argument of a style function or
  154. in custom CSS.</p></dd>
  155. <dt>header_color</dt>
  156. <dd><p>Header Color. Defaults to #000. Modifies the
  157. <code>h1, h2, h3</code> elements. The value of this variable is also stored as a CSS
  158. variable that can be referenced with <code>var(--header-color)</code> in any argument
  159. of a style function or in custom CSS.</p></dd>
  160. <dt>background_color</dt>
  161. <dd><p>Slide Background Color. Defaults to #FFF. Modifies
  162. the <code>.remark-slide-content</code> class. The value of this variable is also
  163. stored as a CSS variable that can be referenced with
  164. <code>var(--background-color)</code> in any argument of a style function or in custom
  165. CSS.</p></dd>
  166. <dt>link_color</dt>
  167. <dd><p>Link Color. Defaults to rgb(249, 38, 114). Modifies the
  168. <code>a, a &gt; code</code> elements. The value of this variable is also stored as a CSS
  169. variable that can be referenced with <code>var(--link-color)</code> in any argument
  170. of a style function or in custom CSS.</p></dd>
  171. <dt>text_bold_color</dt>
  172. <dd><p>Bold Text Color. Defaults to <code>NULL</code>. Modifies the
  173. <code>strong</code> element. The value of this variable is also stored as a CSS
  174. variable that can be referenced with <code>var(--text-bold-color)</code> in any
  175. argument of a style function or in custom CSS.</p></dd>
  176. <dt>text_slide_number_color</dt>
  177. <dd><p>Slide Number Color. Defaults to
  178. <code>inverse_background_color</code>. Modifies the <code>.remark-slide-number</code> class.</p></dd>
  179. <dt>padding</dt>
  180. <dd><p>Slide Padding in <code>top right [bottom left]</code> format. Defaults
  181. to 16px 64px 16px 64px. Modifies the <code>.remark-slide-content</code> class.
  182. Accepts CSS
  183. <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/padding" class="external-link">padding</a>
  184. property values.</p></dd>
  185. <dt>background_image</dt>
  186. <dd><p>Background image applied to each <em>and every</em> slide.
  187. Set <code>title_slide_background_image = "none"</code> to remove the background image
  188. from the title slide. Defaults to <code>NULL</code>. Modifies the
  189. <code>.remark-slide-content</code> class.</p></dd>
  190. <dt>background_size</dt>
  191. <dd><p>Background image size, requires <code>background_image</code> to
  192. be set. If <code>background_image</code> is set, <code>background_size</code> will default to
  193. <code>cover</code> so the background fills the screen. If both <code>background_image</code> and
  194. <code>background_position</code> are set, will default to 100 percent. Defaults to
  195. <code>NULL</code>. Modifies the <code>.remark-slide-content</code> class. Accepts CSS
  196. <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/background-size" class="external-link">background-size</a>
  197. property values.</p></dd>
  198. <dt>background_position</dt>
  199. <dd><p>Background image position, requires
  200. <code>background_image</code> to be set, and it is recommended to adjust
  201. <code>background_size</code>. Defaults to <code>NULL</code>. Modifies the
  202. <code>.remark-slide-content</code> class. Accepts CSS
  203. <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/background-position" class="external-link">background-position</a>
  204. property values.</p></dd>
  205. <dt>code_highlight_color</dt>
  206. <dd><p>Code Line Highlight. Defaults to
  207. rgba(255,255,0,0.5). Modifies the <code>.remark-code-line-highlighted</code> class.
  208. The value of this variable is also stored as a CSS variable that can be
  209. referenced with <code>var(--code-highlight-color)</code> in any argument of a style
  210. function or in custom CSS.</p></dd>
  211. <dt>code_inline_color</dt>
  212. <dd><p>Inline Code Color. Defaults to #000. Modifies the
  213. <code>.remark-inline-code</code> class.</p></dd>
  214. <dt>code_inline_background_color</dt>
  215. <dd><p>Inline Code Background Color. Defaults
  216. to <code>NULL</code>. Modifies the <code>.remark-inline-code</code> class.</p></dd>
  217. <dt>code_inline_font_size</dt>
  218. <dd><p>Inline Code Text Font Size. Defaults to 1em.
  219. Modifies the <code>.remark-inline-code</code> class. Accepts CSS
  220. <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/font-size" class="external-link">font-size</a>
  221. property values. The value of this variable is also stored as a CSS
  222. variable that can be referenced with <code>var(--code-inline-font-size)</code> in any
  223. argument of a style function or in custom CSS.</p></dd>
  224. <dt>inverse_background_color</dt>
  225. <dd><p>Inverse Background Color. Defaults to
  226. #272822. Modifies the <code>.inverse</code> class. The value of this variable is also
  227. stored as a CSS variable that can be referenced with
  228. <code>var(--inverse-background-color)</code> in any argument of a style function or
  229. in custom CSS.</p></dd>
  230. <dt>inverse_text_color</dt>
  231. <dd><p>Inverse Text Color. Defaults to #d6d6d6. Modifies
  232. the <code>.inverse</code> class. The value of this variable is also stored as a CSS
  233. variable that can be referenced with <code>var(--inverse-text-color)</code> in any
  234. argument of a style function or in custom CSS.</p></dd>
  235. <dt>inverse_text_shadow</dt>
  236. <dd><p>Enables Shadow on text of inverse slides.
  237. Defaults to <code>FALSE</code>. Modifies the <code>.inverse</code> class.</p></dd>
  238. <dt>inverse_header_color</dt>
  239. <dd><p>Inverse Header Color. Defaults to #f3f3f3.
  240. Modifies the <code>.inverse h1, .inverse h2, .inverse h3</code> classes. The value of
  241. this variable is also stored as a CSS variable that can be referenced with
  242. <code>var(--inverse-header-color)</code> in any argument of a style function or in
  243. custom CSS.</p></dd>
  244. <dt>inverse_link_color</dt>
  245. <dd><p>Inverse Link Color. Defaults to <code>link_color</code>.
  246. Modifies the <code>.inverse a, .inverse a &gt; code</code> classes. The value of this
  247. variable is also stored as a CSS variable that can be referenced with
  248. <code>var(--inverse-link-color)</code> in any argument of a style function or in
  249. custom CSS.</p></dd>
  250. <dt>title_slide_text_color</dt>
  251. <dd><p>Title Slide Text Color. Defaults to
  252. <code>inverse_text_color</code>. Modifies the <code>.title-slide</code> class. The value of this
  253. variable is also stored as a CSS variable that can be referenced with
  254. <code>var(--title-slide-text-color)</code> in any argument of a style function or in
  255. custom CSS.</p></dd>
  256. <dt>title_slide_background_color</dt>
  257. <dd><p>Title Slide Background Color. Defaults
  258. to <code>inverse_background_color</code>. Modifies the <code>.title-slide</code> class. The
  259. value of this variable is also stored as a CSS variable that can be
  260. referenced with <code>var(--title-slide-background-color)</code> in any argument of a
  261. style function or in custom CSS.</p></dd>
  262. <dt>title_slide_background_image</dt>
  263. <dd><p>Title Slide Background Image URL.
  264. Defaults to <code>NULL</code>. Modifies the <code>.title-slide</code> class.</p></dd>
  265. <dt>title_slide_background_size</dt>
  266. <dd><p>Title Slide Background Image Size,
  267. defaults to "cover" if background image is set. Defaults to <code>NULL</code>.
  268. Modifies the <code>.title-slide</code> class. Accepts CSS
  269. <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/background-size" class="external-link">background-size</a>
  270. property values.</p></dd>
  271. <dt>title_slide_background_position</dt>
  272. <dd><p>Title Slide Background Image
  273. Position. Defaults to <code>NULL</code>. Modifies the <code>.title-slide</code> class. Accepts
  274. CSS
  275. <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/background-position" class="external-link">background-position</a>
  276. property values.</p></dd>
  277. <dt>footnote_color</dt>
  278. <dd><p>Footnote text color (if <code>NA</code>, then it will be the same
  279. color as <code>text_color</code>). Defaults to <code>NULL</code>. Modifies the <code>.footnote</code>
  280. class.</p></dd>
  281. <dt>footnote_font_size</dt>
  282. <dd><p>Footnote font size. Defaults to 0.9em. Modifies
  283. the <code>.footnote</code> class. Accepts CSS
  284. <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/font-size" class="external-link">font-size</a>
  285. property values.</p></dd>
  286. <dt>footnote_position_bottom</dt>
  287. <dd><p>Footnote location from bottom of screen.
  288. Defaults to 60px. Modifies the <code>.footnote</code> class. Accepts CSS
  289. <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/position_value" class="external-link">position</a>
  290. property values.</p></dd>
  291. <dt>left_column_subtle_color</dt>
  292. <dd><p>Left Column Text (not last). Defaults to
  293. #777. Modifies the <code>.left-column h2, .left-column h3</code> classes.</p></dd>
  294. <dt>left_column_selected_color</dt>
  295. <dd><p>Left Column Current Selection. Defaults to
  296. #000. Modifies the
  297. <code>.left-column h2:last-of-type, .left-column h3:last-child</code> classes.</p></dd>
  298. <dt>blockquote_left_border_color</dt>
  299. <dd><p>Blockquote Left Border Color. Defaults
  300. to lightgray. Modifies the <code>blockquote</code> element.</p></dd>
  301. <dt>table_border_color</dt>
  302. <dd><p>Table top/bottom border. Defaults to #666.
  303. Modifies the <code>table: border-top, border-bottom</code> elements.</p></dd>
  304. <dt>table_row_border_color</dt>
  305. <dd><p>Table row inner bottom border. Defaults to
  306. #ddd. Modifies the <code>table thead th: border-bottom</code> elements.</p></dd>
  307. <dt>table_row_even_background_color</dt>
  308. <dd><p>Table Even Row Background Color.
  309. Defaults to #eee. Modifies the <code>thead, tfoot, tr:nth-child(even)</code>
  310. elements.</p></dd>
  311. <dt>base_font_size</dt>
  312. <dd><p>Base Font Size for All Slide Elements (must be <code>px</code>).
  313. Defaults to 20px. Modifies the <code>html</code> element. The value of this variable
  314. is also stored as a CSS variable that can be referenced with
  315. <code>var(--base-font-size)</code> in any argument of a style function or in custom
  316. CSS.</p></dd>
  317. <dt>text_font_size</dt>
  318. <dd><p>Slide Body Text Font Size. Defaults to 1rem. Modifies
  319. the <code>.remark-slide-content</code> class. Accepts CSS
  320. <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/font-size" class="external-link">font-size</a>
  321. property values. The value of this variable is also stored as a CSS
  322. variable that can be referenced with <code>var(--text-font-size)</code> in any
  323. argument of a style function or in custom CSS.</p></dd>
  324. <dt>header_h1_font_size</dt>
  325. <dd><p>h1 Header Text Font Size. Defaults to 2.75rem.
  326. Modifies the <code>.remark-slide-content h1</code> class. Accepts CSS
  327. <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/font-size" class="external-link">font-size</a>
  328. property values. The value of this variable is also stored as a CSS
  329. variable that can be referenced with <code>var(--header-h1-font-size)</code> in any
  330. argument of a style function or in custom CSS.</p></dd>
  331. <dt>header_h2_font_size</dt>
  332. <dd><p>h2 Header Text Font Size. Defaults to 2.25rem.
  333. Modifies the <code>.remark-slide-content h2</code> class. Accepts CSS
  334. <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/font-size" class="external-link">font-size</a>
  335. property values. The value of this variable is also stored as a CSS
  336. variable that can be referenced with <code>var(--header-h2-font-size)</code> in any
  337. argument of a style function or in custom CSS.</p></dd>
  338. <dt>header_h3_font_size</dt>
  339. <dd><p>h3 Header Text Font Size. Defaults to 1.75rem.
  340. Modifies the <code>.remark-slide-content h3</code> class. Accepts CSS
  341. <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/font-size" class="external-link">font-size</a>
  342. property values. The value of this variable is also stored as a CSS
  343. variable that can be referenced with <code>var(--header-h3-font-size)</code> in any
  344. argument of a style function or in custom CSS.</p></dd>
  345. <dt>header_background_auto</dt>
  346. <dd><p>Add background under slide title automatically
  347. for h1 header elements. If not enabled, use <code>class: header_background</code> to
  348. enable. Defaults to <code>FALSE</code>.</p></dd>
  349. <dt>header_background_color</dt>
  350. <dd><p>Background Color for h1 Header with
  351. Background. Defaults to <code>header_color</code>. Modifies the
  352. <code>.remark-slide-content h1</code> class. The value of this variable is also
  353. stored as a CSS variable that can be referenced with
  354. <code>var(--header-background-color)</code> in any argument of a style function or in
  355. custom CSS.</p></dd>
  356. <dt>header_background_text_color</dt>
  357. <dd><p>Text Color for h1 Header with
  358. Background. Defaults to <code>background_color</code>. Modifies the
  359. <code>.remark-slide-content h1</code> class. The value of this variable is also
  360. stored as a CSS variable that can be referenced with
  361. <code>var(--header-background-text-color)</code> in any argument of a style function
  362. or in custom CSS.</p></dd>
  363. <dt>header_background_padding</dt>
  364. <dd><p>Padding for h1 Header with Background.
  365. Defaults to <code>NULL</code>. Modifies the <code>.remark-slide-content h1</code> class. Accepts
  366. CSS <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/padding" class="external-link">padding</a>
  367. property values.</p></dd>
  368. <dt>header_background_content_padding_top</dt>
  369. <dd><p>Top Padding for Content in
  370. Slide with Header with Background. Defaults to 7rem. Modifies the
  371. <code>.remark-slide-content</code> class.</p></dd>
  372. <dt>header_background_ignore_classes</dt>
  373. <dd><p>Slide Classes Where Header with
  374. Background will not be Applied. Defaults to
  375. <code>c('normal', 'inverse', 'title', 'middle', 'bottom')</code>. Modifies the
  376. <code>.remark-slide-content</code> class.</p></dd>
  377. <dt>text_slide_number_font_size</dt>
  378. <dd><p>Slide Number Text Font Size. Defaults to
  379. 0.9rem. Modifies the <code>.remark-slide-number</code> class. Accepts CSS
  380. <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/font-size" class="external-link">font-size</a>
  381. property values.</p></dd>
  382. <dt>text_font_google</dt>
  383. <dd><p>Use <code><a href="google_font.html">google_font()</a></code> to specify body font. Defaults
  384. to <code>NULL</code>. Modifies the <code>body</code> element.</p></dd>
  385. <dt>text_font_family</dt>
  386. <dd><p>Body Text Font Family (xaringan default is
  387. <code>'Droid Serif'</code>). Defaults to
  388. <code>xaringanthemer_font_default("text_font_family")</code>. Modifies the <code>body</code>
  389. element. The value of this variable is also stored as a CSS variable that
  390. can be referenced with <code>var(--text-font-family)</code> in any argument of a
  391. style function or in custom CSS.</p></dd>
  392. <dt>text_font_weight</dt>
  393. <dd><p>Body Text Font Weight. Defaults to
  394. <code>xaringanthemer_font_default("text_font_weight")</code>. Modifies the <code>body</code>
  395. element. Accepts CSS
  396. <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight" class="external-link">font-weight</a>
  397. property values.</p></dd>
  398. <dt>text_bold_font_weight</dt>
  399. <dd><p>Body Bold Text Font Weight. Defaults to bold.
  400. Modifies the <code>strong</code> element.</p></dd>
  401. <dt>text_font_url</dt>
  402. <dd><p>Body Text Font URL(s). Defaults to
  403. <code>xaringanthemer_font_default("text_font_url")</code>. Modifies the
  404. <code>@import url()</code> elements.</p></dd>
  405. <dt>text_font_family_fallback</dt>
  406. <dd><p>Body Text Font Fallbacks. Defaults to
  407. <code>xaringanthemer_font_default("text_font_family_fallback")</code>. Modifies the
  408. <code>body</code> element. The value of this variable is also stored as a CSS
  409. variable that can be referenced with <code>var(--text-font-family-fallback)</code> in
  410. any argument of a style function or in custom CSS.</p></dd>
  411. <dt>text_font_base</dt>
  412. <dd><p>Body Text Base Font (Total Failure Fallback). Defaults
  413. to sans-serif. Modifies the <code>body</code> element. The value of this variable is
  414. also stored as a CSS variable that can be referenced with
  415. <code>var(--text-font-base)</code> in any argument of a style function or in custom
  416. CSS.</p></dd>
  417. <dt>header_font_google</dt>
  418. <dd><p>Use <code><a href="google_font.html">google_font()</a></code> to specify header font.
  419. Defaults to <code>NULL</code>. Modifies the <code>body</code> element.</p></dd>
  420. <dt>header_font_family</dt>
  421. <dd><p>Header Font Family (xaringan default is
  422. <code>'Yanone Kaffeesatz'</code>). Defaults to
  423. <code>xaringanthemer_font_default("header_font_family")</code>. Modifies the
  424. <code>h1, h2, h3</code> elements. The value of this variable is also stored as a CSS
  425. variable that can be referenced with <code>var(--header-font-family)</code> in any
  426. argument of a style function or in custom CSS.</p></dd>
  427. <dt>header_font_weight</dt>
  428. <dd><p>Header Font Weight. Defaults to
  429. <code>xaringanthemer_font_default("header_font_weight")</code>. Modifies the
  430. <code>h1, h2, h3</code> elements. Accepts CSS
  431. <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight" class="external-link">font-weight</a>
  432. property values.</p></dd>
  433. <dt>header_font_family_fallback</dt>
  434. <dd><p>Header Font Family Fallback. Defaults to
  435. Georgia, serif. Modifies the <code>h1, h2, h3</code> elements. The value of this
  436. variable is also stored as a CSS variable that can be referenced with
  437. <code>var(--header-font-family-fallback)</code> in any argument of a style function
  438. or in custom CSS.</p></dd>
  439. <dt>header_font_url</dt>
  440. <dd><p>Header Font URL. Defaults to
  441. <code>xaringanthemer_font_default("header_font_url")</code>. Modifies the
  442. <code>@import url</code> elements.</p></dd>
  443. <dt>code_font_google</dt>
  444. <dd><p>Use <code><a href="google_font.html">google_font()</a></code> to specify code font. Defaults
  445. to <code>NULL</code>. Modifies the <code>body</code> element.</p></dd>
  446. <dt>code_font_family</dt>
  447. <dd><p>Code Font Family. Defaults to
  448. <code>xaringanthemer_font_default("code_font_family")</code>. Modifies the
  449. <code>.remark-code, .remark-inline-code</code> classes. The value of this variable is
  450. also stored as a CSS variable that can be referenced with
  451. <code>var(--code-font-family)</code> in any argument of a style function or in custom
  452. CSS.</p></dd>
  453. <dt>code_font_size</dt>
  454. <dd><p>Code Text Font Size. Defaults to 0.9rem. Modifies the
  455. <code>.remark-inline</code> class. Accepts CSS
  456. <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/font-size" class="external-link">font-size</a>
  457. property values. The value of this variable is also stored as a CSS
  458. variable that can be referenced with <code>var(--code-font-size)</code> in any
  459. argument of a style function or in custom CSS.</p></dd>
  460. <dt>code_font_url</dt>
  461. <dd><p>Code Font URL. Defaults to
  462. <code>xaringanthemer_font_default("code_font_url")</code>. Modifies the <code>@import url</code>
  463. elements.</p></dd>
  464. <dt>code_font_family_fallback</dt>
  465. <dd><p>Code Font Fallback. Defaults to
  466. <code>xaringanthemer_font_default("code_font_family_fallback")</code>. Modifies the
  467. <code>.remark-code, .remark-inline-code</code> classes.</p></dd>
  468. <dt>link_decoration</dt>
  469. <dd><p>Text decoration of links. Defaults to none. Modifies
  470. the <code>a, a &gt; code</code> elements. Accepts CSS
  471. <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration" class="external-link">text-decoration</a>
  472. property values.</p></dd>
  473. <dt>colors</dt>
  474. <dd><p>A named vector of custom colors. The names of the colors
  475. become CSS variables and classes that can be used within your slides.
  476. For example, <code>colors = c(blue = "#bad4ed")</code> adds a CSS variable
  477. <code>--blue</code>, a <code>.blue</code> CSS class that applies the color to the text or
  478. foreground color, and a <code>.bg-blue</code> CSS class that applies the color
  479. to the background.</p></dd>
  480. <dt>extra_css</dt>
  481. <dd><p>A named list of CSS definitions each containing a named list
  482. of CSS property-value pairs, i.e.
  483. <code>list(".class-id" = list("css-property" = "value"))</code>.</p></dd>
  484. <dt>extra_fonts</dt>
  485. <dd><p>A list of additional fonts to import, each list element
  486. can be either a URL as a character string or a call to
  487. <code><a href="google_font.html">google_font</a>()</code>. To use a font imported in <code>extra_fonts</code>, you
  488. will need to write custom CSS rules that apply the font to an element or
  489. class with the <code>font-family</code> property. See the <strong>Fonts</strong> section of
  490. <code><a href="../articles/xaringanthemer.html">vignette("xaringanthemer")</a></code> for an example.</p></dd>
  491. <dt>outfile</dt>
  492. <dd><p>Customized xaringan CSS output file name, default is "xaringan-themer.css"</p></dd>
  493. </dl></div>
  494. <div class="section level2">
  495. <h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
  496. <p>The CSS styles are written to the file path provided in <code>outfile</code></p>
  497. <p>(by default to <code>xaringan-themer.css</code>). If <code>outfile</code> is <code>NULL</code>, the CSS is
  498. returned directly as a character string.</p>
  499. </div>
  500. <div class="section level2">
  501. <h2 id="functions">Functions<a class="anchor" aria-label="anchor" href="#functions"></a></h2>
  502. <ul><li><p><code>xaringanthemer_font_default()</code>: Default values for font family, weight, URLs and
  503. font fallbacks.</p></li>
  504. </ul></div>
  505. <div class="section level2">
  506. <h2 id="usage">Usage<a class="anchor" aria-label="anchor" href="#usage"></a></h2>
  507. <p>To use the styles created by this theme function, make sure
  508. that you use <code>xaringan-themer.css</code> as your CSS file in your slides' YAML
  509. header. If you change the name of the output file using the <code>outfile</code>
  510. argument, use that name instead of the default file name.</p>
  511. <p></p><div class="sourceCode yaml"><pre><code><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="fu">output</span><span class="kw">:</span></span>
  512. <span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="at">xaringan:</span><span class="fu">:moon_reader</span><span class="kw">:</span></span>
  513. <span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="at"> </span><span class="fu">css</span><span class="kw">:</span><span class="at"> xaringan-themer.css</span></span></code></pre><p></p></div>
  514. </div>
  515. <div class="section level2">
  516. <h2 id="see-also">See also<a class="anchor" aria-label="anchor" href="#see-also"></a></h2>
  517. <div class="dont-index"><p>Other themes:
  518. <code><a href="style_duo_accent_inverse.html">style_duo_accent_inverse</a>()</code>,
  519. <code><a href="style_duo_accent.html">style_duo_accent</a>()</code>,
  520. <code><a href="style_duo.html">style_duo</a>()</code>,
  521. <code><a href="style_mono_accent_inverse.html">style_mono_accent_inverse</a>()</code>,
  522. <code><a href="style_mono_accent.html">style_mono_accent</a>()</code>,
  523. <code><a href="style_mono_dark.html">style_mono_dark</a>()</code>,
  524. <code><a href="style_mono_light.html">style_mono_light</a>()</code>,
  525. <code><a href="style_solarized_dark.html">style_solarized_dark</a>()</code>,
  526. <code><a href="style_solarized_light.html">style_solarized_light</a>()</code></p></div>
  527. </div>
  528. <div class="section level2">
  529. <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
  530. <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="co"># Create a xaringan style in a temporary file</span></span></span>
  531. <span class="r-in"><span><span class="va">xaringan_themer_css</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/tempfile.html" class="external-link">tempfile</a></span><span class="op">(</span><span class="st">"xaringan-themer-"</span>, fileext <span class="op">=</span> <span class="st">".css"</span><span class="op">)</span></span></span>
  532. <span class="r-in"><span></span></span>
  533. <span class="r-in"><span><span class="fu">style_xaringan</span><span class="op">(</span></span></span>
  534. <span class="r-in"><span> text_color <span class="op">=</span> <span class="st">"#002b3"</span>,</span></span>
  535. <span class="r-in"><span> inverse_background_color <span class="op">=</span> <span class="st">"#31b09e"</span>,</span></span>
  536. <span class="r-in"><span> inverse_text_color <span class="op">=</span> <span class="st">"#002b3"</span>,</span></span>
  537. <span class="r-in"><span> outfile <span class="op">=</span> <span class="va">xaringan_themer_css</span> <span class="co"># omit in your slides to write the</span></span></span>
  538. <span class="r-in"><span> <span class="co"># styles to xaringan-themer.css</span></span></span>
  539. <span class="r-in"><span><span class="op">)</span></span></span>
  540. <span class="r-wrn co"><span class="r-pr">#&gt;</span> <span class="warning">Warning: </span>Colors that will be used by `theme_xaringan()` need to be in hexadecimal format: text_color, inverse_text_color</span>
  541. <span class="r-in"><span></span></span>
  542. <span class="r-in"><span><span class="co"># View the CSS:</span></span></span>
  543. <span class="r-in"><span><span class="co"># file.edit(xaringan_themer_css)</span></span></span>
  544. </code></pre></div>
  545. </div>
  546. </main><aside class="col-md-3"><nav id="toc"><h2>On this page</h2>
  547. </nav></aside></div>
  548. <footer><div class="pkgdown-footer-left">
  549. <p></p><p>Developed by <a href="https://www.garrickadenbuie.com" class="external-link">Garrick Aden-Buie</a>.</p>
  550. </div>
  551. <div class="pkgdown-footer-right">
  552. <p></p><p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.6.</p>
  553. </div>
  554. </footer></div>
  555. <script>window.jQuery('.navbar-brand + small').addClass(['badge', 'bg-secondary', 'text-light']).removeClass('text-muted')</script></body></html>