😎 Give your xaringan slides some style
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

819 lines
40KB

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