😎 Give your xaringan slides some style
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

772 行
39KB

  1. <!-- Generated by pkgdown: do not edit by hand -->
  2. <!DOCTYPE html>
  3. <html lang="en">
  4. <head>
  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>Write A Customized Xaringan Theme — xaringanthemer_font_default • xaringanthemer</title>
  9. <!-- favicons -->
  10. <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. <!-- jquery -->
  17. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
  18. <!-- Bootstrap -->
  19. <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" />
  20. <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>
  21. <!-- bootstrap-toc -->
  22. <link rel="stylesheet" href="../bootstrap-toc.css">
  23. <script src="../bootstrap-toc.js"></script>
  24. <!-- Font Awesome icons -->
  25. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous" />
  26. <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" />
  27. <!-- clipboard.js -->
  28. <script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script>
  29. <!-- headroom.js -->
  30. <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>
  31. <script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script>
  32. <!-- pkgdown -->
  33. <link href="../pkgdown.css" rel="stylesheet">
  34. <script src="../pkgdown.js"></script>
  35. <link href="../extra.css" rel="stylesheet">
  36. <meta property="og:title" content="Write A Customized Xaringan Theme — xaringanthemer_font_default" />
  37. <meta property="og:description" content="Creates a customized Xaringan theme CSS file." />
  38. <meta property="og:image" content="https://pkg.garrickadenbuie.com/xaringanthemer/logo.png" />
  39. <meta name="twitter:card" content="summary" />
  40. <meta name="twitter:creator" content="@grrrck" />
  41. <meta name="twitter:site" content="@grrrck" />
  42. <!-- mathjax -->
  43. <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
  44. <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>
  45. <!--[if lt IE 9]>
  46. <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
  47. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  48. <![endif]-->
  49. </head>
  50. <body data-spy="scroll" data-target="#toc">
  51. <div class="container template-reference-topic">
  52. <header>
  53. <div class="navbar navbar-default navbar-fixed-top" role="navigation">
  54. <div class="container">
  55. <div class="navbar-header">
  56. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
  57. <span class="sr-only">Toggle navigation</span>
  58. <span class="icon-bar"></span>
  59. <span class="icon-bar"></span>
  60. <span class="icon-bar"></span>
  61. </button>
  62. <span class="navbar-brand">
  63. <a class="navbar-link" href="../index.html">xaringanthemer</a>
  64. <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.3.0</span>
  65. </span>
  66. </div>
  67. <div id="navbar" class="navbar-collapse collapse">
  68. <ul class="nav navbar-nav">
  69. <li>
  70. <a href="../articles/xaringanthemer.html">Features</a>
  71. </li>
  72. <li>
  73. <a href="../reference/index.html">Reference</a>
  74. </li>
  75. <li>
  76. <a href="../articles/themes.html">Themes</a>
  77. </li>
  78. <li>
  79. <a href="../articles/ggplot2-themes.html">ggplot2 Themes</a>
  80. </li>
  81. <li class="dropdown">
  82. <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
  83. More
  84. <span class="caret"></span>
  85. </a>
  86. <ul class="dropdown-menu" role="menu">
  87. <li>
  88. <a href="../articles/fonts.html">Fonts</a>
  89. </li>
  90. <li>
  91. <a href="../articles/template-variables.html">Template Variables</a>
  92. </li>
  93. </ul>
  94. </li>
  95. </ul>
  96. <ul class="nav navbar-nav navbar-right">
  97. <li>
  98. <a href="../news/index.html">
  99. <span class="fa fa fa fa-newspaper-o fa-lg"></span>
  100. </a>
  101. </li>
  102. <li>
  103. <a href="https://github.com/gadenbuie/xaringanthemer">
  104. <span class="fa fa-github fa-lg"></span>
  105. </a>
  106. </li>
  107. <li>
  108. <a href="https://twitter.com/grrrck">
  109. <span class="fa fa-twitter fa-lg"></span>
  110. </a>
  111. </li>
  112. <li>
  113. <a href="https://www.garrickadenbuie.com">
  114. <span class="fa fa-home fa-lg"></span>
  115. </a>
  116. </li>
  117. </ul>
  118. </div><!--/.nav-collapse -->
  119. </div><!--/.container -->
  120. </div><!--/.navbar -->
  121. </header>
  122. <div class="row">
  123. <div class="col-md-9 contents">
  124. <div class="page-header">
  125. <h1>Write A Customized Xaringan Theme</h1>
  126. <small class="dont-index">Source: <a href='https://github.com/gadenbuie/xaringanthemer/blob/master/R/style_font_default.R'><code>R/style_font_default.R</code></a>, <a href='https://github.com/gadenbuie/xaringanthemer/blob/master/R/style_xaringan.R'><code>R/style_xaringan.R</code></a></small>
  127. <div class="hidden name"><code>style_xaringan.Rd</code></div>
  128. </div>
  129. <div class="ref-description">
  130. <p>Creates a customized Xaringan theme CSS file.</p>
  131. </div>
  132. <pre class="usage"><span class='fu'>xaringanthemer_font_default</span>(<span class='no'>font_arg</span>)
  133. <span class='fu'>style_xaringan</span>(
  134. <span class='kw'>text_color</span> <span class='kw'>=</span> <span class='st'>"#000"</span>,
  135. <span class='kw'>header_color</span> <span class='kw'>=</span> <span class='st'>"#000"</span>,
  136. <span class='kw'>background_color</span> <span class='kw'>=</span> <span class='st'>"#FFF"</span>,
  137. <span class='kw'>link_color</span> <span class='kw'>=</span> <span class='st'>"rgb(249, 38, 114)"</span>,
  138. <span class='kw'>text_bold_color</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
  139. <span class='kw'>text_slide_number_color</span> <span class='kw'>=</span> <span class='no'>inverse_background_color</span>,
  140. <span class='kw'>padding</span> <span class='kw'>=</span> <span class='st'>"16px 64px 16px 64px"</span>,
  141. <span class='kw'>background_image</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
  142. <span class='kw'>background_size</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
  143. <span class='kw'>background_position</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
  144. <span class='kw'>code_highlight_color</span> <span class='kw'>=</span> <span class='st'>"rgba(255,255,0,0.5)"</span>,
  145. <span class='kw'>code_inline_color</span> <span class='kw'>=</span> <span class='st'>"#000"</span>,
  146. <span class='kw'>code_inline_background_color</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
  147. <span class='kw'>code_inline_font_size</span> <span class='kw'>=</span> <span class='st'>"1em"</span>,
  148. <span class='kw'>inverse_background_color</span> <span class='kw'>=</span> <span class='st'>"#272822"</span>,
  149. <span class='kw'>inverse_text_color</span> <span class='kw'>=</span> <span class='st'>"#d6d6d6"</span>,
  150. <span class='kw'>inverse_text_shadow</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
  151. <span class='kw'>inverse_header_color</span> <span class='kw'>=</span> <span class='st'>"#f3f3f3"</span>,
  152. <span class='kw'>title_slide_text_color</span> <span class='kw'>=</span> <span class='no'>inverse_text_color</span>,
  153. <span class='kw'>title_slide_background_color</span> <span class='kw'>=</span> <span class='no'>inverse_background_color</span>,
  154. <span class='kw'>title_slide_background_image</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
  155. <span class='kw'>title_slide_background_size</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
  156. <span class='kw'>title_slide_background_position</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
  157. <span class='kw'>footnote_color</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
  158. <span class='kw'>footnote_font_size</span> <span class='kw'>=</span> <span class='st'>"0.9em"</span>,
  159. <span class='kw'>footnote_position_bottom</span> <span class='kw'>=</span> <span class='st'>"60px"</span>,
  160. <span class='kw'>left_column_subtle_color</span> <span class='kw'>=</span> <span class='st'>"#777"</span>,
  161. <span class='kw'>left_column_selected_color</span> <span class='kw'>=</span> <span class='st'>"#000"</span>,
  162. <span class='kw'>blockquote_left_border_color</span> <span class='kw'>=</span> <span class='st'>"lightgray"</span>,
  163. <span class='kw'>table_border_color</span> <span class='kw'>=</span> <span class='st'>"#666"</span>,
  164. <span class='kw'>table_row_border_color</span> <span class='kw'>=</span> <span class='st'>"#ddd"</span>,
  165. <span class='kw'>table_row_even_background_color</span> <span class='kw'>=</span> <span class='st'>"#eee"</span>,
  166. <span class='kw'>base_font_size</span> <span class='kw'>=</span> <span class='st'>"20px"</span>,
  167. <span class='kw'>text_font_size</span> <span class='kw'>=</span> <span class='st'>"1rem"</span>,
  168. <span class='kw'>header_h1_font_size</span> <span class='kw'>=</span> <span class='st'>"2.75rem"</span>,
  169. <span class='kw'>header_h2_font_size</span> <span class='kw'>=</span> <span class='st'>"2.25rem"</span>,
  170. <span class='kw'>header_h3_font_size</span> <span class='kw'>=</span> <span class='st'>"1.75rem"</span>,
  171. <span class='kw'>header_background_auto</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>,
  172. <span class='kw'>header_background_color</span> <span class='kw'>=</span> <span class='no'>header_color</span>,
  173. <span class='kw'>header_background_text_color</span> <span class='kw'>=</span> <span class='no'>background_color</span>,
  174. <span class='kw'>header_background_padding</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
  175. <span class='kw'>header_background_content_padding_top</span> <span class='kw'>=</span> <span class='st'>"7rem"</span>,
  176. <span class='kw'>header_background_ignore_classes</span> <span class='kw'>=</span> <span class='fu'><a href='https://rdrr.io/r/base/c.html'>c</a></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>),
  177. <span class='kw'>text_slide_number_font_size</span> <span class='kw'>=</span> <span class='st'>"0.9em"</span>,
  178. <span class='kw'>text_font_google</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
  179. <span class='kw'>text_font_family</span> <span class='kw'>=</span> <span class='fu'>xaringanthemer_font_default</span>(<span class='st'>"text_font_family"</span>),
  180. <span class='kw'>text_font_weight</span> <span class='kw'>=</span> <span class='fu'>xaringanthemer_font_default</span>(<span class='st'>"text_font_weight"</span>),
  181. <span class='kw'>text_font_url</span> <span class='kw'>=</span> <span class='fu'>xaringanthemer_font_default</span>(<span class='st'>"text_font_url"</span>),
  182. <span class='kw'>text_font_family_fallback</span> <span class='kw'>=</span> <span class='fu'>xaringanthemer_font_default</span>(<span class='st'>"text_font_family_fallback"</span>),
  183. <span class='kw'>text_font_base</span> <span class='kw'>=</span> <span class='st'>"sans-serif"</span>,
  184. <span class='kw'>header_font_google</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
  185. <span class='kw'>header_font_family</span> <span class='kw'>=</span> <span class='fu'>xaringanthemer_font_default</span>(<span class='st'>"header_font_family"</span>),
  186. <span class='kw'>header_font_weight</span> <span class='kw'>=</span> <span class='fu'>xaringanthemer_font_default</span>(<span class='st'>"header_font_weight"</span>),
  187. <span class='kw'>header_font_url</span> <span class='kw'>=</span> <span class='fu'>xaringanthemer_font_default</span>(<span class='st'>"header_font_url"</span>),
  188. <span class='kw'>code_font_google</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
  189. <span class='kw'>code_font_family</span> <span class='kw'>=</span> <span class='fu'>xaringanthemer_font_default</span>(<span class='st'>"code_font_family"</span>),
  190. <span class='kw'>code_font_size</span> <span class='kw'>=</span> <span class='st'>"0.9rem"</span>,
  191. <span class='kw'>code_font_url</span> <span class='kw'>=</span> <span class='fu'>xaringanthemer_font_default</span>(<span class='st'>"code_font_url"</span>),
  192. <span class='kw'>code_font_family_fallback</span> <span class='kw'>=</span> <span class='fu'>xaringanthemer_font_default</span>(<span class='st'>"code_font_family_fallback"</span>),
  193. <span class='kw'>colors</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
  194. <span class='kw'>extra_css</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
  195. <span class='kw'>extra_fonts</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
  196. <span class='kw'>outfile</span> <span class='kw'>=</span> <span class='st'>"xaringan-themer.css"</span>
  197. )</pre>
  198. <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
  199. <table class="ref-arguments">
  200. <colgroup><col class="name" /><col class="desc" /></colgroup>
  201. <tr>
  202. <th>font_arg</th>
  203. <td><p>A font argument from the <span class="pkg">xaringanthemer</span> <code>style_</code>
  204. function family.</p></td>
  205. </tr>
  206. <tr>
  207. <th>text_color</th>
  208. <td><p>Text Color. Defaults to #000. Modifies the <code>body</code> element.
  209. The value of this variable is also stored as a CSS variable that can be
  210. referenced with <code><a href='https://rdrr.io/r/stats/cor.html'>var(--text_color)</a></code> in any argument of a style function or
  211. in custom CSS.</p></td>
  212. </tr>
  213. <tr>
  214. <th>header_color</th>
  215. <td><p>Header Color. Defaults to #000. Modifies the
  216. <code>h1, h2, h3</code> elements. The value of this variable is also stored as a CSS
  217. variable that can be referenced with <code><a href='https://rdrr.io/r/stats/cor.html'>var(--header-color)</a></code> in any argument
  218. of a style function or in custom CSS.</p></td>
  219. </tr>
  220. <tr>
  221. <th>background_color</th>
  222. <td><p>Slide Background Color. Defaults to #FFF. Modifies
  223. the <code>.remark-slide-content</code> class. The value of this variable is also
  224. stored as a CSS variable that can be referenced with
  225. <code><a href='https://rdrr.io/r/stats/cor.html'>var(--background-color)</a></code> in any argument of a style function or in custom
  226. CSS.</p></td>
  227. </tr>
  228. <tr>
  229. <th>link_color</th>
  230. <td><p>Link Color. Defaults to rgb(249, 38, 114). Modifies the
  231. <code>a, a &gt; code</code> elements. The value of this variable is also stored as a CSS
  232. variable that can be referenced with <code><a href='https://rdrr.io/r/stats/cor.html'>var(--link-color)</a></code> in any argument
  233. of a style function or in custom CSS.</p></td>
  234. </tr>
  235. <tr>
  236. <th>text_bold_color</th>
  237. <td><p>Bold Text Color. Defaults to <code>NULL</code>. Modifies the
  238. <code>strong</code> element. The value of this variable is also stored as a CSS
  239. variable that can be referenced with <code><a href='https://rdrr.io/r/stats/cor.html'>var(--text-bold-color)</a></code> in any
  240. argument of a style function or in custom CSS.</p></td>
  241. </tr>
  242. <tr>
  243. <th>text_slide_number_color</th>
  244. <td><p>Slide Number Color. Defaults to
  245. <code>inverse_background_color</code>. Modifies the <code>.remark-slide-number</code> class.</p></td>
  246. </tr>
  247. <tr>
  248. <th>padding</th>
  249. <td><p>Slide Padding in <code>top right [bottom left]</code> format. Defaults
  250. to 16px 64px 16px 64px. Modifies the <code>.remark-slide-content</code> class.
  251. Accepts CSS
  252. <a href='https://developer.mozilla.org/en-US/docs/Web/CSS/padding'>padding</a>
  253. property values.</p></td>
  254. </tr>
  255. <tr>
  256. <th>background_image</th>
  257. <td><p>Background image applied to each <em>and every</em> slide.
  258. Set <code>title_slide_background_image = "none"</code> to remove the background image
  259. from the title slide. Defaults to <code>NULL</code>. Modifies the
  260. <code>.remark-slide-content</code> class.</p></td>
  261. </tr>
  262. <tr>
  263. <th>background_size</th>
  264. <td><p>Background image size, requires <code>background_image</code> to
  265. be set. If <code>background_image</code> is set, <code>background_size</code> will default to
  266. <code>cover</code> so the background fills the screen. If both <code>background_image</code> and
  267. <code>background_position</code> are set, will default to 100 percent. Defaults to
  268. <code>NULL</code>. Modifies the <code>.remark-slide-content</code> class. Accepts CSS
  269. <a href='https://developer.mozilla.org/en-US/docs/Web/CSS/background-size'>background-size</a>
  270. property values.</p></td>
  271. </tr>
  272. <tr>
  273. <th>background_position</th>
  274. <td><p>Background image position, requires
  275. <code>background_image</code> to be set, and it is recommended to adjust
  276. <code>background_size</code>. Defaults to <code>NULL</code>. Modifies the
  277. <code>.remark-slide-content</code> class. Accepts CSS
  278. <a href='https://developer.mozilla.org/en-US/docs/Web/CSS/background-position'>background-position</a>
  279. property values.</p></td>
  280. </tr>
  281. <tr>
  282. <th>code_highlight_color</th>
  283. <td><p>Code Line Highlight. Defaults to
  284. rgba(255,255,0,0.5). Modifies the <code>.remark-code-line-highlighted</code> class.
  285. The value of this variable is also stored as a CSS variable that can be
  286. referenced with <code><a href='https://rdrr.io/r/stats/cor.html'>var(--code-highlight-color)</a></code> in any argument of a style
  287. function or in custom CSS.</p></td>
  288. </tr>
  289. <tr>
  290. <th>code_inline_color</th>
  291. <td><p>Inline Code Color. Defaults to #000. Modifies the
  292. <code>.remark-inline-code</code> class.</p></td>
  293. </tr>
  294. <tr>
  295. <th>code_inline_background_color</th>
  296. <td><p>Inline Code Background Color. Defaults
  297. to <code>NULL</code>. Modifies the <code>.remark-inline-code</code> class.</p></td>
  298. </tr>
  299. <tr>
  300. <th>code_inline_font_size</th>
  301. <td><p>Inline Code Text Font Size. Defaults to 1em.
  302. Modifies the <code>.remark-inline-code</code> class. Accepts CSS
  303. <a href='https://developer.mozilla.org/en-US/docs/Web/CSS/font-size'>font-size</a>
  304. property values. The value of this variable is also stored as a CSS
  305. variable that can be referenced with <code><a href='https://rdrr.io/r/stats/cor.html'>var(--code-inline-font-size)</a></code> in any
  306. argument of a style function or in custom CSS.</p></td>
  307. </tr>
  308. <tr>
  309. <th>inverse_background_color</th>
  310. <td><p>Inverse Background Color. Defaults to
  311. #272822. Modifies the <code>.inverse</code> class. The value of this variable is also
  312. stored as a CSS variable that can be referenced with
  313. <code><a href='https://rdrr.io/r/stats/cor.html'>var(--inverse-background-color)</a></code> in any argument of a style function or
  314. in custom CSS.</p></td>
  315. </tr>
  316. <tr>
  317. <th>inverse_text_color</th>
  318. <td><p>Inverse Text Color. Defaults to #d6d6d6. Modifies
  319. the <code>.inverse</code> class. The value of this variable is also stored as a CSS
  320. variable that can be referenced with <code><a href='https://rdrr.io/r/stats/cor.html'>var(--inverse-text-color)</a></code> in any
  321. argument of a style function or in custom CSS.</p></td>
  322. </tr>
  323. <tr>
  324. <th>inverse_text_shadow</th>
  325. <td><p>Enables Shadow on text of inverse slides.
  326. Defaults to <code>FALSE</code>. Modifies the <code>.inverse</code> class.</p></td>
  327. </tr>
  328. <tr>
  329. <th>inverse_header_color</th>
  330. <td><p>Inverse Header Color. Defaults to #f3f3f3.
  331. Modifies the <code>.inverse h1, .inverse h2, .inverse h3</code> classes. The value of
  332. this variable is also stored as a CSS variable that can be referenced with
  333. <code><a href='https://rdrr.io/r/stats/cor.html'>var(--inverse-header-color)</a></code> in any argument of a style function or in
  334. custom CSS.</p></td>
  335. </tr>
  336. <tr>
  337. <th>title_slide_text_color</th>
  338. <td><p>Title Slide Text Color. Defaults to
  339. <code>inverse_text_color</code>. Modifies the <code>.title-slide</code> class. The value of this
  340. variable is also stored as a CSS variable that can be referenced with
  341. <code><a href='https://rdrr.io/r/stats/cor.html'>var(--title-slide-text-color)</a></code> in any argument of a style function or in
  342. custom CSS.</p></td>
  343. </tr>
  344. <tr>
  345. <th>title_slide_background_color</th>
  346. <td><p>Title Slide Background Color. Defaults
  347. to <code>inverse_background_color</code>. Modifies the <code>.title-slide</code> class. The
  348. value of this variable is also stored as a CSS variable that can be
  349. referenced with <code><a href='https://rdrr.io/r/stats/cor.html'>var(--title-slide-background-color)</a></code> in any argument of a
  350. style function or in custom CSS.</p></td>
  351. </tr>
  352. <tr>
  353. <th>title_slide_background_image</th>
  354. <td><p>Title Slide Background Image URL.
  355. Defaults to <code>NULL</code>. Modifies the <code>.title-slide</code> class.</p></td>
  356. </tr>
  357. <tr>
  358. <th>title_slide_background_size</th>
  359. <td><p>Title Slide Background Image Size,
  360. defaults to "cover" if background image is set. Defaults to <code>NULL</code>.
  361. Modifies the <code>.title-slide</code> class. Accepts CSS
  362. <a href='https://developer.mozilla.org/en-US/docs/Web/CSS/background-size'>background-size</a>
  363. property values.</p></td>
  364. </tr>
  365. <tr>
  366. <th>title_slide_background_position</th>
  367. <td><p>Title Slide Background Image
  368. Position. Defaults to <code>NULL</code>. Modifies the <code>.title-slide</code> class. Accepts
  369. CSS
  370. <a href='https://developer.mozilla.org/en-US/docs/Web/CSS/background-position'>background-position</a>
  371. property values.</p></td>
  372. </tr>
  373. <tr>
  374. <th>footnote_color</th>
  375. <td><p>Footnote text color (if <code>NA</code>, then it will be the same
  376. color as <code>text_color</code>). Defaults to <code>NULL</code>. Modifies the <code>.footnote</code>
  377. class.</p></td>
  378. </tr>
  379. <tr>
  380. <th>footnote_font_size</th>
  381. <td><p>Footnote font size. Defaults to 0.9em. Modifies
  382. the <code>.footnote</code> class. Accepts CSS
  383. <a href='https://developer.mozilla.org/en-US/docs/Web/CSS/font-size'>font-size</a>
  384. property values.</p></td>
  385. </tr>
  386. <tr>
  387. <th>footnote_position_bottom</th>
  388. <td><p>Footnote location from bottom of screen.
  389. Defaults to 60px. Modifies the <code>.footnote</code> class. Accepts CSS
  390. <a href='https://developer.mozilla.org/en-US/docs/Web/CSS/position_value'>position</a>
  391. property values.</p></td>
  392. </tr>
  393. <tr>
  394. <th>left_column_subtle_color</th>
  395. <td><p>Left Column Text (not last). Defaults to
  396. #777. Modifies the <code>.left-column h2, .left-column h3</code> classes.</p></td>
  397. </tr>
  398. <tr>
  399. <th>left_column_selected_color</th>
  400. <td><p>Left Column Current Selection. Defaults to
  401. #000. Modifies the
  402. <code>.left-column h2:last-of-type, .left-column h3:last-child</code> classes.</p></td>
  403. </tr>
  404. <tr>
  405. <th>blockquote_left_border_color</th>
  406. <td><p>Blockquote Left Border Color. Defaults
  407. to lightgray. Modifies the <code>blockquote</code> element.</p></td>
  408. </tr>
  409. <tr>
  410. <th>table_border_color</th>
  411. <td><p>Table top/bottom border. Defaults to #666.
  412. Modifies the <code>table: border-top, border-bottom</code> elements.</p></td>
  413. </tr>
  414. <tr>
  415. <th>table_row_border_color</th>
  416. <td><p>Table row inner bottom border. Defaults to
  417. #ddd. Modifies the <code>table thead th: border-bottom</code> elements.</p></td>
  418. </tr>
  419. <tr>
  420. <th>table_row_even_background_color</th>
  421. <td><p>Table Even Row Background Color.
  422. Defaults to #eee. Modifies the <code>thead, tfoot, tr:nth-child(even)</code>
  423. elements.</p></td>
  424. </tr>
  425. <tr>
  426. <th>base_font_size</th>
  427. <td><p>Base Font Size for All Slide Elements (must be <code>px</code>).
  428. Defaults to 20px. Modifies the <code>html</code> element. The value of this variable
  429. is also stored as a CSS variable that can be referenced with
  430. <code><a href='https://rdrr.io/r/stats/cor.html'>var(--base-font-size)</a></code> in any argument of a style function or in custom
  431. CSS.</p></td>
  432. </tr>
  433. <tr>
  434. <th>text_font_size</th>
  435. <td><p>Slide Body Text Font Size. Defaults to 1rem. Modifies
  436. the <code>.remark-slide-content</code> class. Accepts CSS
  437. <a href='https://developer.mozilla.org/en-US/docs/Web/CSS/font-size'>font-size</a>
  438. property values. The value of this variable is also stored as a CSS
  439. variable that can be referenced with <code><a href='https://rdrr.io/r/stats/cor.html'>var(--text-font-size)</a></code> in any
  440. argument of a style function or in custom CSS.</p></td>
  441. </tr>
  442. <tr>
  443. <th>header_h1_font_size</th>
  444. <td><p>h1 Header Text Font Size. Defaults to 2.75rem.
  445. Modifies the <code>.remark-slide-content h1</code> class. Accepts CSS
  446. <a href='https://developer.mozilla.org/en-US/docs/Web/CSS/font-size'>font-size</a>
  447. property values. The value of this variable is also stored as a CSS
  448. variable that can be referenced with <code><a href='https://rdrr.io/r/stats/cor.html'>var(--header-h1-font-size)</a></code> in any
  449. argument of a style function or in custom CSS.</p></td>
  450. </tr>
  451. <tr>
  452. <th>header_h2_font_size</th>
  453. <td><p>h2 Header Text Font Size. Defaults to 2.25rem.
  454. Modifies the <code>.remark-slide-content h2</code> class. Accepts CSS
  455. <a href='https://developer.mozilla.org/en-US/docs/Web/CSS/font-size'>font-size</a>
  456. property values. The value of this variable is also stored as a CSS
  457. variable that can be referenced with <code><a href='https://rdrr.io/r/stats/cor.html'>var(--header-h2-font-size)</a></code> in any
  458. argument of a style function or in custom CSS.</p></td>
  459. </tr>
  460. <tr>
  461. <th>header_h3_font_size</th>
  462. <td><p>h3 Header Text Font Size. Defaults to 1.75rem.
  463. Modifies the <code>.remark-slide-content h3</code> class. Accepts CSS
  464. <a href='https://developer.mozilla.org/en-US/docs/Web/CSS/font-size'>font-size</a>
  465. property values. The value of this variable is also stored as a CSS
  466. variable that can be referenced with <code><a href='https://rdrr.io/r/stats/cor.html'>var(--header-h3-font-size)</a></code> in any
  467. argument of a style function or in custom CSS.</p></td>
  468. </tr>
  469. <tr>
  470. <th>header_background_auto</th>
  471. <td><p>Add background under slide title automatically
  472. for h1 header elements. If not enabled, use <code>class: header_background</code> to
  473. enable. Defaults to <code>FALSE</code>.</p></td>
  474. </tr>
  475. <tr>
  476. <th>header_background_color</th>
  477. <td><p>Background Color for h1 Header with
  478. Background. Defaults to <code>header_color</code>. Modifies the
  479. <code>.remark-slide-content h1</code> class. The value of this variable is also
  480. stored as a CSS variable that can be referenced with
  481. <code><a href='https://rdrr.io/r/stats/cor.html'>var(--header-background-color)</a></code> in any argument of a style function or in
  482. custom CSS.</p></td>
  483. </tr>
  484. <tr>
  485. <th>header_background_text_color</th>
  486. <td><p>Text Color for h1 Header with
  487. Background. Defaults to <code>background_color</code>. Modifies the
  488. <code>.remark-slide-content h1</code> class. The value of this variable is also
  489. stored as a CSS variable that can be referenced with
  490. <code><a href='https://rdrr.io/r/stats/cor.html'>var(--header-background-text-color)</a></code> in any argument of a style function
  491. or in custom CSS.</p></td>
  492. </tr>
  493. <tr>
  494. <th>header_background_padding</th>
  495. <td><p>Padding for h1 Header with Background.
  496. Defaults to <code>NULL</code>. Modifies the <code>.remark-slide-content h1</code> class. Accepts
  497. CSS <a href='https://developer.mozilla.org/en-US/docs/Web/CSS/padding'>padding</a>
  498. property values.</p></td>
  499. </tr>
  500. <tr>
  501. <th>header_background_content_padding_top</th>
  502. <td><p>Top Padding for Content in
  503. Slide with Header with Background. Defaults to 7rem. Modifies the
  504. <code>.remark-slide-content</code> class.</p></td>
  505. </tr>
  506. <tr>
  507. <th>header_background_ignore_classes</th>
  508. <td><p>Slide Classes Where Header with
  509. Background will not be Applied. Defaults to
  510. <code><a href='https://rdrr.io/r/base/c.html'>c('normal', 'inverse', 'title', 'middle', 'bottom')</a></code>. Modifies the
  511. <code>.remark-slide-content</code> class.</p></td>
  512. </tr>
  513. <tr>
  514. <th>text_slide_number_font_size</th>
  515. <td><p>Slide Number Text Font Size. Defaults to
  516. 0.9em. Modifies the <code>.remark-slide-number</code> class. Accepts CSS
  517. <a href='https://developer.mozilla.org/en-US/docs/Web/CSS/font-size'>font-size</a>
  518. property values.</p></td>
  519. </tr>
  520. <tr>
  521. <th>text_font_google</th>
  522. <td><p>Use <code><a href='google_font.html'>google_font()</a></code> to specify body font. Defaults
  523. to <code>NULL</code>. Modifies the <code>body</code> element.</p></td>
  524. </tr>
  525. <tr>
  526. <th>text_font_family</th>
  527. <td><p>Body Text Font Family (xaringan default is
  528. <code>'Droid Serif'</code>). Defaults to
  529. <code>xaringanthemer_font_default("text_font_family")</code>. Modifies the <code>body</code>
  530. element. The value of this variable is also stored as a CSS variable that
  531. can be referenced with <code><a href='https://rdrr.io/r/stats/cor.html'>var(--text-font-family)</a></code> in any argument of a
  532. style function or in custom CSS.</p></td>
  533. </tr>
  534. <tr>
  535. <th>text_font_weight</th>
  536. <td><p>Body Text Font Weight. Defaults to
  537. <code>xaringanthemer_font_default("text_font_weight")</code>. Modifies the <code>body</code>
  538. element. Accepts CSS
  539. <a href='https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight'>font-weight</a>
  540. property values.</p></td>
  541. </tr>
  542. <tr>
  543. <th>text_font_url</th>
  544. <td><p>Body Text Font URL(s). Defaults to
  545. <code>xaringanthemer_font_default("text_font_url")</code>. Modifies the
  546. <code>@import url()</code> elements.</p></td>
  547. </tr>
  548. <tr>
  549. <th>text_font_family_fallback</th>
  550. <td><p>Body Text Font Fallbacks. Defaults to
  551. <code>xaringanthemer_font_default("text_font_family_fallback")</code>. Modifies the
  552. <code>body</code> element. The value of this variable is also stored as a CSS
  553. variable that can be referenced with <code><a href='https://rdrr.io/r/stats/cor.html'>var(--text-font-family-fallback)</a></code> in
  554. any argument of a style function or in custom CSS.</p></td>
  555. </tr>
  556. <tr>
  557. <th>text_font_base</th>
  558. <td><p>Body Text Base Font (Total Failure Fallback). Defaults
  559. to sans-serif. Modifies the <code>body</code> element. The value of this variable is
  560. also stored as a CSS variable that can be referenced with
  561. <code><a href='https://rdrr.io/r/stats/cor.html'>var(--text-font-base)</a></code> in any argument of a style function or in custom
  562. CSS.</p></td>
  563. </tr>
  564. <tr>
  565. <th>header_font_google</th>
  566. <td><p>Use <code><a href='google_font.html'>google_font()</a></code> to specify header font.
  567. Defaults to <code>NULL</code>. Modifies the <code>body</code> element.</p></td>
  568. </tr>
  569. <tr>
  570. <th>header_font_family</th>
  571. <td><p>Header Font Family (xaringan default is
  572. <code>'Yanone Kaffeesatz'</code>). Defaults to
  573. <code>xaringanthemer_font_default("header_font_family")</code>. Modifies the
  574. <code>h1, h2, h3</code> elements. The value of this variable is also stored as a CSS
  575. variable that can be referenced with <code><a href='https://rdrr.io/r/stats/cor.html'>var(--header-font-family)</a></code> in any
  576. argument of a style function or in custom CSS.</p></td>
  577. </tr>
  578. <tr>
  579. <th>header_font_weight</th>
  580. <td><p>Header Font Weight. Defaults to
  581. <code>xaringanthemer_font_default("header_font_weight")</code>. Modifies the
  582. <code>h1, h2, h3</code> elements. Accepts CSS
  583. <a href='https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight'>font-weight</a>
  584. property values.</p></td>
  585. </tr>
  586. <tr>
  587. <th>header_font_url</th>
  588. <td><p>Header Font URL. Defaults to
  589. <code>xaringanthemer_font_default("header_font_url")</code>. Modifies the
  590. <code>@import url</code> elements.</p></td>
  591. </tr>
  592. <tr>
  593. <th>code_font_google</th>
  594. <td><p>Use <code><a href='google_font.html'>google_font()</a></code> to specify code font. Defaults
  595. to <code>NULL</code>. Modifies the <code>body</code> element.</p></td>
  596. </tr>
  597. <tr>
  598. <th>code_font_family</th>
  599. <td><p>Code Font Family. Defaults to
  600. <code>xaringanthemer_font_default("code_font_family")</code>. Modifies the
  601. <code>.remark-code, .remark-inline-code</code> classes. The value of this variable is
  602. also stored as a CSS variable that can be referenced with
  603. <code><a href='https://rdrr.io/r/stats/cor.html'>var(--code-font-family)</a></code> in any argument of a style function or in custom
  604. CSS.</p></td>
  605. </tr>
  606. <tr>
  607. <th>code_font_size</th>
  608. <td><p>Code Text Font Size. Defaults to 0.9rem. Modifies the
  609. <code>.remark-inline</code> class. Accepts CSS
  610. <a href='https://developer.mozilla.org/en-US/docs/Web/CSS/font-size'>font-size</a>
  611. property values. The value of this variable is also stored as a CSS
  612. variable that can be referenced with <code><a href='https://rdrr.io/r/stats/cor.html'>var(--code-font-size)</a></code> in any
  613. argument of a style function or in custom CSS.</p></td>
  614. </tr>
  615. <tr>
  616. <th>code_font_url</th>
  617. <td><p>Code Font URL. Defaults to
  618. <code>xaringanthemer_font_default("code_font_url")</code>. Modifies the <code>@import url</code>
  619. elements.</p></td>
  620. </tr>
  621. <tr>
  622. <th>code_font_family_fallback</th>
  623. <td><p>Code Font Fallback. Defaults to
  624. <code>xaringanthemer_font_default("code_font_family_fallback")</code>. Modifies the
  625. <code>.remark-code, .remark-inline-code</code> classes.</p></td>
  626. </tr>
  627. <tr>
  628. <th>colors</th>
  629. <td><p>A named vector of custom colors. The names of the colors
  630. become CSS variables and classes that can be used within your slides.
  631. For example, <code>colors = c(blue = "#bad4ed")</code> adds a CSS variable
  632. <code>--blue</code>, a <code>.blue</code> CSS class that applies the color to the text or
  633. foreground color, and a <code>.bg-blue</code> CSS class that applies the color
  634. to the background.</p></td>
  635. </tr>
  636. <tr>
  637. <th>extra_css</th>
  638. <td><p>A named list of CSS definitions each containing a named list
  639. of CSS property-value pairs, i.e.
  640. <code><a href='https://rdrr.io/r/base/list.html'>list(".class-id" = list("css-property" = "value"))</a></code>.</p></td>
  641. </tr>
  642. <tr>
  643. <th>extra_fonts</th>
  644. <td><p>A list of additional fonts to import, each list element
  645. can be either a URL as a character string or a call to
  646. <code><a href='google_font.html'>google_font</a>()</code>. To use a font imported in <code>extra_fonts</code>, you
  647. will need to write custom CSS rules that apply the font to an element or
  648. class with the <code>font-family</code> property. See the <strong>Fonts</strong> section of
  649. <code><a href='../articles/xaringanthemer.html'>vignette("xaringanthemer")</a></code> for an example.</p></td>
  650. </tr>
  651. <tr>
  652. <th>outfile</th>
  653. <td><p>Customized xaringan CSS output file name, default is "xaringan-themer.css"</p></td>
  654. </tr>
  655. </table>
  656. <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
  657. <p>The CSS styles are written to the file path provided in <code>outfile</code>
  658. (by default to <code>xaringan-themer.css</code>). If <code>outfile</code> is <code>NULL</code>, the CSS is
  659. returned directly as a character string.</p>
  660. <h2 class="hasAnchor" id="functions"><a class="anchor" href="#functions"></a>Functions</h2>
  661. <ul>
  662. <li><p><code>xaringanthemer_font_default</code>: Default values for font family, weight, URLs and
  663. font fallbacks.</p></li>
  664. </ul>
  665. <h2 class="hasAnchor" id="usage"><a class="anchor" href="#usage"></a>Usage</h2>
  666. <p>To use the styles created by this theme function, make sure
  667. that you use <code>xaringan-themer.css</code> as your CSS file in your slides' YAML
  668. header. If you change the name of the output file using the <code>outfile</code>
  669. argument, use that name instead of the default file name.<div class="yaml"></p><pre><span class='no'>output</span>:
  670. <span class='kw pkg'>xaringan</span><span class='kw ns'>::</span><span class='no'><a href='https://rdrr.io/pkg/xaringan/man/moon_reader.html'>moon_reader</a></span>:
  671. <span class='no'>css</span>: <span class='no'>xaringan</span>-<span class='no'>themer.css</span></pre><p></div></p>
  672. <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
  673. <div class='dont-index'><p>Other themes:
  674. <code><a href='style_duo_accent_inverse.html'>style_duo_accent_inverse</a>()</code>,
  675. <code><a href='style_duo_accent.html'>style_duo_accent</a>()</code>,
  676. <code><a href='style_duo.html'>style_duo</a>()</code>,
  677. <code><a href='style_mono_accent_inverse.html'>style_mono_accent_inverse</a>()</code>,
  678. <code><a href='style_mono_accent.html'>style_mono_accent</a>()</code>,
  679. <code><a href='style_mono_dark.html'>style_mono_dark</a>()</code>,
  680. <code><a href='style_mono_light.html'>style_mono_light</a>()</code>,
  681. <code><a href='style_solarized_dark.html'>style_solarized_dark</a>()</code>,
  682. <code><a href='style_solarized_light.html'>style_solarized_light</a>()</code></p></div>
  683. <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
  684. <pre class="examples"><div class='input'><span class='co'># Create a xaringan style in a temporary file</span>
  685. <span class='no'>xaringan_themer_css</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://rdrr.io/r/base/tempfile.html'>tempfile</a></span>(<span class='st'>"xaringan-themer-"</span>, <span class='kw'>fileext</span> <span class='kw'>=</span> <span class='st'>".css"</span>)
  686. <span class='fu'>style_xaringan</span>(
  687. <span class='kw'>text_color</span> <span class='kw'>=</span> <span class='st'>"#002b3"</span>,
  688. <span class='kw'>inverse_background_color</span> <span class='kw'>=</span> <span class='st'>"#31b09e"</span>,
  689. <span class='kw'>inverse_text_color</span> <span class='kw'>=</span> <span class='st'>"#002b3"</span>,
  690. <span class='kw'>outfile</span> <span class='kw'>=</span> <span class='no'>xaringan_themer_css</span> <span class='co'># omit in your slides to write the</span>
  691. <span class='co'># styles to xaringan-themer.css</span>
  692. )</div><div class='output co'>#&gt; <span class='warning'>Warning: Colors that will be used by `theme_xaringan()` need to be in hexadecimal format: text_color, inverse_text_color</span></div><div class='input'>
  693. # View the CSS:
  694. # file.edit(xaringan_themer_css)
  695. </div></pre>
  696. </div>
  697. <div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
  698. <nav id="toc" data-toggle="toc" class="sticky-top">
  699. <h2 data-toc-skip>Contents</h2>
  700. </nav>
  701. </div>
  702. </div>
  703. <footer>
  704. <div class="copyright">
  705. <p>Developed by <a href='https://www.garrickadenbuie.com'>Garrick Aden-Buie</a>.</p>
  706. </div>
  707. <div class="pkgdown">
  708. <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.5.1.</p>
  709. </div>
  710. </footer>
  711. </div>
  712. </body>
  713. </html>