😎 Give your xaringan slides some style
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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