😎 Give your xaringan slides some style
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

480 rindas
22KB

  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/style_font_default.R, R/style_xaringan.R
  3. \name{xaringanthemer_font_default}
  4. \alias{xaringanthemer_font_default}
  5. \alias{style_xaringan}
  6. \title{Write A Customized Xaringan Theme}
  7. \usage{
  8. xaringanthemer_font_default(font_arg)
  9. style_xaringan(
  10. text_color = "#000",
  11. header_color = "#000",
  12. background_color = "#FFF",
  13. link_color = "rgb(249, 38, 114)",
  14. text_bold_color = NULL,
  15. text_slide_number_color = inverse_background_color,
  16. padding = "16px 64px 16px 64px",
  17. background_image = NULL,
  18. background_size = NULL,
  19. background_position = NULL,
  20. code_highlight_color = "rgba(255,255,0,0.5)",
  21. code_inline_color = "#000",
  22. code_inline_background_color = NULL,
  23. code_inline_font_size = "1em",
  24. inverse_background_color = "#272822",
  25. inverse_text_color = "#d6d6d6",
  26. inverse_text_shadow = FALSE,
  27. inverse_header_color = "#f3f3f3",
  28. inverse_link_color = link_color,
  29. title_slide_text_color = inverse_text_color,
  30. title_slide_background_color = inverse_background_color,
  31. title_slide_background_image = NULL,
  32. title_slide_background_size = NULL,
  33. title_slide_background_position = NULL,
  34. footnote_color = NULL,
  35. footnote_font_size = "0.9em",
  36. footnote_position_bottom = "60px",
  37. left_column_subtle_color = "#777",
  38. left_column_selected_color = "#000",
  39. blockquote_left_border_color = "lightgray",
  40. table_border_color = "#666",
  41. table_row_border_color = "#ddd",
  42. table_row_even_background_color = "#eee",
  43. base_font_size = "20px",
  44. text_font_size = "1rem",
  45. header_h1_font_size = "2.75rem",
  46. header_h2_font_size = "2.25rem",
  47. header_h3_font_size = "1.75rem",
  48. header_background_auto = FALSE,
  49. header_background_color = header_color,
  50. header_background_text_color = background_color,
  51. header_background_padding = NULL,
  52. header_background_content_padding_top = "7rem",
  53. header_background_ignore_classes = c("normal", "inverse", "title", "middle",
  54. "bottom"),
  55. text_slide_number_font_size = "0.9rem",
  56. text_font_google = NULL,
  57. text_font_family = xaringanthemer_font_default("text_font_family"),
  58. text_font_weight = xaringanthemer_font_default("text_font_weight"),
  59. text_bold_font_weight = "bold",
  60. text_font_url = xaringanthemer_font_default("text_font_url"),
  61. text_font_family_fallback = xaringanthemer_font_default("text_font_family_fallback"),
  62. text_font_base = "sans-serif",
  63. header_font_google = NULL,
  64. header_font_family = xaringanthemer_font_default("header_font_family"),
  65. header_font_weight = xaringanthemer_font_default("header_font_weight"),
  66. header_font_family_fallback = "Georgia, serif",
  67. header_font_url = xaringanthemer_font_default("header_font_url"),
  68. code_font_google = NULL,
  69. code_font_family = xaringanthemer_font_default("code_font_family"),
  70. code_font_size = "0.9rem",
  71. code_font_url = xaringanthemer_font_default("code_font_url"),
  72. code_font_family_fallback = xaringanthemer_font_default("code_font_family_fallback"),
  73. link_decoration = "none",
  74. colors = NULL,
  75. extra_css = NULL,
  76. extra_fonts = NULL,
  77. outfile = "xaringan-themer.css"
  78. )
  79. }
  80. \arguments{
  81. \item{font_arg}{A font argument from the \pkg{xaringanthemer} \code{style_}
  82. function family.}
  83. \item{text_color}{Text Color. Defaults to #000. Modifies the \code{body} element.
  84. The value of this variable is also stored as a CSS variable that can be
  85. referenced with \code{var(--text_color)} in any argument of a style function or
  86. in custom CSS.}
  87. \item{header_color}{Header Color. Defaults to #000. Modifies the
  88. \verb{h1, h2, h3} elements. The value of this variable is also stored as a CSS
  89. variable that can be referenced with \code{var(--header-color)} in any argument
  90. of a style function or in custom CSS.}
  91. \item{background_color}{Slide Background Color. Defaults to #FFF. Modifies
  92. the \code{.remark-slide-content} class. The value of this variable is also
  93. stored as a CSS variable that can be referenced with
  94. \code{var(--background-color)} in any argument of a style function or in custom
  95. CSS.}
  96. \item{link_color}{Link Color. Defaults to rgb(249, 38, 114). Modifies the
  97. \verb{a, a > code} elements. The value of this variable is also stored as a CSS
  98. variable that can be referenced with \code{var(--link-color)} in any argument
  99. of a style function or in custom CSS.}
  100. \item{text_bold_color}{Bold Text Color. Defaults to \code{NULL}. Modifies the
  101. \code{strong} element. The value of this variable is also stored as a CSS
  102. variable that can be referenced with \code{var(--text-bold-color)} in any
  103. argument of a style function or in custom CSS.}
  104. \item{text_slide_number_color}{Slide Number Color. Defaults to
  105. \code{inverse_background_color}. Modifies the \code{.remark-slide-number} class.}
  106. \item{padding}{Slide Padding in \verb{top right [bottom left]} format. Defaults
  107. to 16px 64px 16px 64px. Modifies the \code{.remark-slide-content} class.
  108. Accepts CSS
  109. \href{https://developer.mozilla.org/en-US/docs/Web/CSS/padding}{padding}
  110. property values.}
  111. \item{background_image}{Background image applied to each \emph{and every} slide.
  112. Set \code{title_slide_background_image = "none"} to remove the background image
  113. from the title slide. Defaults to \code{NULL}. Modifies the
  114. \code{.remark-slide-content} class.}
  115. \item{background_size}{Background image size, requires \code{background_image} to
  116. be set. If \code{background_image} is set, \code{background_size} will default to
  117. \code{cover} so the background fills the screen. If both \code{background_image} and
  118. \code{background_position} are set, will default to 100 percent. Defaults to
  119. \code{NULL}. Modifies the \code{.remark-slide-content} class. Accepts CSS
  120. \href{https://developer.mozilla.org/en-US/docs/Web/CSS/background-size}{background-size}
  121. property values.}
  122. \item{background_position}{Background image position, requires
  123. \code{background_image} to be set, and it is recommended to adjust
  124. \code{background_size}. Defaults to \code{NULL}. Modifies the
  125. \code{.remark-slide-content} class. Accepts CSS
  126. \href{https://developer.mozilla.org/en-US/docs/Web/CSS/background-position}{background-position}
  127. property values.}
  128. \item{code_highlight_color}{Code Line Highlight. Defaults to
  129. rgba(255,255,0,0.5). Modifies the \code{.remark-code-line-highlighted} class.
  130. The value of this variable is also stored as a CSS variable that can be
  131. referenced with \code{var(--code-highlight-color)} in any argument of a style
  132. function or in custom CSS.}
  133. \item{code_inline_color}{Inline Code Color. Defaults to #000. Modifies the
  134. \code{.remark-inline-code} class.}
  135. \item{code_inline_background_color}{Inline Code Background Color. Defaults
  136. to \code{NULL}. Modifies the \code{.remark-inline-code} class.}
  137. \item{code_inline_font_size}{Inline Code Text Font Size. Defaults to 1em.
  138. Modifies the \code{.remark-inline-code} class. Accepts CSS
  139. \href{https://developer.mozilla.org/en-US/docs/Web/CSS/font-size}{font-size}
  140. property values. The value of this variable is also stored as a CSS
  141. variable that can be referenced with \code{var(--code-inline-font-size)} in any
  142. argument of a style function or in custom CSS.}
  143. \item{inverse_background_color}{Inverse Background Color. Defaults to
  144. #272822. Modifies the \code{.inverse} class. The value of this variable is also
  145. stored as a CSS variable that can be referenced with
  146. \code{var(--inverse-background-color)} in any argument of a style function or
  147. in custom CSS.}
  148. \item{inverse_text_color}{Inverse Text Color. Defaults to #d6d6d6. Modifies
  149. the \code{.inverse} class. The value of this variable is also stored as a CSS
  150. variable that can be referenced with \code{var(--inverse-text-color)} in any
  151. argument of a style function or in custom CSS.}
  152. \item{inverse_text_shadow}{Enables Shadow on text of inverse slides.
  153. Defaults to \code{FALSE}. Modifies the \code{.inverse} class.}
  154. \item{inverse_header_color}{Inverse Header Color. Defaults to #f3f3f3.
  155. Modifies the \verb{.inverse h1, .inverse h2, .inverse h3} classes. The value of
  156. this variable is also stored as a CSS variable that can be referenced with
  157. \code{var(--inverse-header-color)} in any argument of a style function or in
  158. custom CSS.}
  159. \item{inverse_link_color}{Inverse Link Color. Defaults to \code{link_color}.
  160. Modifies the \verb{.inverse a, .inverse a > code} classes. The value of this
  161. variable is also stored as a CSS variable that can be referenced with
  162. \code{var(--inverse-link-color)} in any argument of a style function or in
  163. custom CSS.}
  164. \item{title_slide_text_color}{Title Slide Text Color. Defaults to
  165. \code{inverse_text_color}. Modifies the \code{.title-slide} class. The value of this
  166. variable is also stored as a CSS variable that can be referenced with
  167. \code{var(--title-slide-text-color)} in any argument of a style function or in
  168. custom CSS.}
  169. \item{title_slide_background_color}{Title Slide Background Color. Defaults
  170. to \code{inverse_background_color}. Modifies the \code{.title-slide} class. The
  171. value of this variable is also stored as a CSS variable that can be
  172. referenced with \code{var(--title-slide-background-color)} in any argument of a
  173. style function or in custom CSS.}
  174. \item{title_slide_background_image}{Title Slide Background Image URL.
  175. Defaults to \code{NULL}. Modifies the \code{.title-slide} class.}
  176. \item{title_slide_background_size}{Title Slide Background Image Size,
  177. defaults to "cover" if background image is set. Defaults to \code{NULL}.
  178. Modifies the \code{.title-slide} class. Accepts CSS
  179. \href{https://developer.mozilla.org/en-US/docs/Web/CSS/background-size}{background-size}
  180. property values.}
  181. \item{title_slide_background_position}{Title Slide Background Image
  182. Position. Defaults to \code{NULL}. Modifies the \code{.title-slide} class. Accepts
  183. CSS
  184. \href{https://developer.mozilla.org/en-US/docs/Web/CSS/background-position}{background-position}
  185. property values.}
  186. \item{footnote_color}{Footnote text color (if \code{NA}, then it will be the same
  187. color as \code{text_color}). Defaults to \code{NULL}. Modifies the \code{.footnote}
  188. class.}
  189. \item{footnote_font_size}{Footnote font size. Defaults to 0.9em. Modifies
  190. the \code{.footnote} class. Accepts CSS
  191. \href{https://developer.mozilla.org/en-US/docs/Web/CSS/font-size}{font-size}
  192. property values.}
  193. \item{footnote_position_bottom}{Footnote location from bottom of screen.
  194. Defaults to 60px. Modifies the \code{.footnote} class. Accepts CSS
  195. \href{https://developer.mozilla.org/en-US/docs/Web/CSS/position_value}{position}
  196. property values.}
  197. \item{left_column_subtle_color}{Left Column Text (not last). Defaults to
  198. #777. Modifies the \verb{.left-column h2, .left-column h3} classes.}
  199. \item{left_column_selected_color}{Left Column Current Selection. Defaults to
  200. #000. Modifies the
  201. \verb{.left-column h2:last-of-type, .left-column h3:last-child} classes.}
  202. \item{blockquote_left_border_color}{Blockquote Left Border Color. Defaults
  203. to lightgray. Modifies the \code{blockquote} element.}
  204. \item{table_border_color}{Table top/bottom border. Defaults to #666.
  205. Modifies the \verb{table: border-top, border-bottom} elements.}
  206. \item{table_row_border_color}{Table row inner bottom border. Defaults to
  207. #ddd. Modifies the \verb{table thead th: border-bottom} elements.}
  208. \item{table_row_even_background_color}{Table Even Row Background Color.
  209. Defaults to #eee. Modifies the \verb{thead, tfoot, tr:nth-child(even)}
  210. elements.}
  211. \item{base_font_size}{Base Font Size for All Slide Elements (must be \code{px}).
  212. Defaults to 20px. Modifies the \code{html} element. The value of this variable
  213. is also stored as a CSS variable that can be referenced with
  214. \code{var(--base-font-size)} in any argument of a style function or in custom
  215. CSS.}
  216. \item{text_font_size}{Slide Body Text Font Size. Defaults to 1rem. Modifies
  217. the \code{.remark-slide-content} class. Accepts CSS
  218. \href{https://developer.mozilla.org/en-US/docs/Web/CSS/font-size}{font-size}
  219. property values. The value of this variable is also stored as a CSS
  220. variable that can be referenced with \code{var(--text-font-size)} in any
  221. argument of a style function or in custom CSS.}
  222. \item{header_h1_font_size}{h1 Header Text Font Size. Defaults to 2.75rem.
  223. Modifies the \verb{.remark-slide-content h1} class. Accepts CSS
  224. \href{https://developer.mozilla.org/en-US/docs/Web/CSS/font-size}{font-size}
  225. property values. The value of this variable is also stored as a CSS
  226. variable that can be referenced with \code{var(--header-h1-font-size)} in any
  227. argument of a style function or in custom CSS.}
  228. \item{header_h2_font_size}{h2 Header Text Font Size. Defaults to 2.25rem.
  229. Modifies the \verb{.remark-slide-content h2} class. Accepts CSS
  230. \href{https://developer.mozilla.org/en-US/docs/Web/CSS/font-size}{font-size}
  231. property values. The value of this variable is also stored as a CSS
  232. variable that can be referenced with \code{var(--header-h2-font-size)} in any
  233. argument of a style function or in custom CSS.}
  234. \item{header_h3_font_size}{h3 Header Text Font Size. Defaults to 1.75rem.
  235. Modifies the \verb{.remark-slide-content h3} class. Accepts CSS
  236. \href{https://developer.mozilla.org/en-US/docs/Web/CSS/font-size}{font-size}
  237. property values. The value of this variable is also stored as a CSS
  238. variable that can be referenced with \code{var(--header-h3-font-size)} in any
  239. argument of a style function or in custom CSS.}
  240. \item{header_background_auto}{Add background under slide title automatically
  241. for h1 header elements. If not enabled, use \code{class: header_background} to
  242. enable. Defaults to \code{FALSE}.}
  243. \item{header_background_color}{Background Color for h1 Header with
  244. Background. Defaults to \code{header_color}. Modifies the
  245. \verb{.remark-slide-content h1} class. The value of this variable is also
  246. stored as a CSS variable that can be referenced with
  247. \code{var(--header-background-color)} in any argument of a style function or in
  248. custom CSS.}
  249. \item{header_background_text_color}{Text Color for h1 Header with
  250. Background. Defaults to \code{background_color}. Modifies the
  251. \verb{.remark-slide-content h1} class. The value of this variable is also
  252. stored as a CSS variable that can be referenced with
  253. \code{var(--header-background-text-color)} in any argument of a style function
  254. or in custom CSS.}
  255. \item{header_background_padding}{Padding for h1 Header with Background.
  256. Defaults to \code{NULL}. Modifies the \verb{.remark-slide-content h1} class. Accepts
  257. CSS \href{https://developer.mozilla.org/en-US/docs/Web/CSS/padding}{padding}
  258. property values.}
  259. \item{header_background_content_padding_top}{Top Padding for Content in
  260. Slide with Header with Background. Defaults to 7rem. Modifies the
  261. \code{.remark-slide-content} class.}
  262. \item{header_background_ignore_classes}{Slide Classes Where Header with
  263. Background will not be Applied. Defaults to
  264. \code{c('normal', 'inverse', 'title', 'middle', 'bottom')}. Modifies the
  265. \code{.remark-slide-content} class.}
  266. \item{text_slide_number_font_size}{Slide Number Text Font Size. Defaults to
  267. 0.9rem. Modifies the \code{.remark-slide-number} class. Accepts CSS
  268. \href{https://developer.mozilla.org/en-US/docs/Web/CSS/font-size}{font-size}
  269. property values.}
  270. \item{text_font_google}{Use \code{google_font()} to specify body font. Defaults
  271. to \code{NULL}. Modifies the \code{body} element.}
  272. \item{text_font_family}{Body Text Font Family (xaringan default is
  273. \code{'Droid Serif'}). Defaults to
  274. \code{xaringanthemer_font_default("text_font_family")}. Modifies the \code{body}
  275. element. The value of this variable is also stored as a CSS variable that
  276. can be referenced with \code{var(--text-font-family)} in any argument of a
  277. style function or in custom CSS.}
  278. \item{text_font_weight}{Body Text Font Weight. Defaults to
  279. \code{xaringanthemer_font_default("text_font_weight")}. Modifies the \code{body}
  280. element. Accepts CSS
  281. \href{https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight}{font-weight}
  282. property values.}
  283. \item{text_bold_font_weight}{Body Bold Text Font Weight. Defaults to bold.
  284. Modifies the \code{strong} element.}
  285. \item{text_font_url}{Body Text Font URL(s). Defaults to
  286. \code{xaringanthemer_font_default("text_font_url")}. Modifies the
  287. \verb{@import url()} elements.}
  288. \item{text_font_family_fallback}{Body Text Font Fallbacks. Defaults to
  289. \code{xaringanthemer_font_default("text_font_family_fallback")}. Modifies the
  290. \code{body} element. The value of this variable is also stored as a CSS
  291. variable that can be referenced with \code{var(--text-font-family-fallback)} in
  292. any argument of a style function or in custom CSS.}
  293. \item{text_font_base}{Body Text Base Font (Total Failure Fallback). Defaults
  294. to sans-serif. Modifies the \code{body} element. The value of this variable is
  295. also stored as a CSS variable that can be referenced with
  296. \code{var(--text-font-base)} in any argument of a style function or in custom
  297. CSS.}
  298. \item{header_font_google}{Use \code{google_font()} to specify header font.
  299. Defaults to \code{NULL}. Modifies the \code{body} element.}
  300. \item{header_font_family}{Header Font Family (xaringan default is
  301. \code{'Yanone Kaffeesatz'}). Defaults to
  302. \code{xaringanthemer_font_default("header_font_family")}. Modifies the
  303. \verb{h1, h2, h3} elements. The value of this variable is also stored as a CSS
  304. variable that can be referenced with \code{var(--header-font-family)} in any
  305. argument of a style function or in custom CSS.}
  306. \item{header_font_weight}{Header Font Weight. Defaults to
  307. \code{xaringanthemer_font_default("header_font_weight")}. Modifies the
  308. \verb{h1, h2, h3} elements. Accepts CSS
  309. \href{https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight}{font-weight}
  310. property values.}
  311. \item{header_font_family_fallback}{Header Font Family Fallback. Defaults to
  312. Georgia, serif. Modifies the \verb{h1, h2, h3} elements. The value of this
  313. variable is also stored as a CSS variable that can be referenced with
  314. \code{var(--header-font-family-fallback)} in any argument of a style function
  315. or in custom CSS.}
  316. \item{header_font_url}{Header Font URL. Defaults to
  317. \code{xaringanthemer_font_default("header_font_url")}. Modifies the
  318. \verb{@import url} elements.}
  319. \item{code_font_google}{Use \code{google_font()} to specify code font. Defaults
  320. to \code{NULL}. Modifies the \code{body} element.}
  321. \item{code_font_family}{Code Font Family. Defaults to
  322. \code{xaringanthemer_font_default("code_font_family")}. Modifies the
  323. \verb{.remark-code, .remark-inline-code} classes. The value of this variable is
  324. also stored as a CSS variable that can be referenced with
  325. \code{var(--code-font-family)} in any argument of a style function or in custom
  326. CSS.}
  327. \item{code_font_size}{Code Text Font Size. Defaults to 0.9rem. Modifies the
  328. \code{.remark-inline} class. Accepts CSS
  329. \href{https://developer.mozilla.org/en-US/docs/Web/CSS/font-size}{font-size}
  330. property values. The value of this variable is also stored as a CSS
  331. variable that can be referenced with \code{var(--code-font-size)} in any
  332. argument of a style function or in custom CSS.}
  333. \item{code_font_url}{Code Font URL. Defaults to
  334. \code{xaringanthemer_font_default("code_font_url")}. Modifies the \verb{@import url}
  335. elements.}
  336. \item{code_font_family_fallback}{Code Font Fallback. Defaults to
  337. \code{xaringanthemer_font_default("code_font_family_fallback")}. Modifies the
  338. \verb{.remark-code, .remark-inline-code} classes.}
  339. \item{link_decoration}{Text decoration of links. Defaults to none. Modifies
  340. the \verb{a, a > code} elements. Accepts CSS
  341. \href{https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration}{text-decoration}
  342. property values.}
  343. \item{colors}{A named vector of custom colors. The names of the colors
  344. become CSS variables and classes that can be used within your slides.
  345. For example, \code{colors = c(blue = "#bad4ed")} adds a CSS variable
  346. \code{--blue}, a \code{.blue} CSS class that applies the color to the text or
  347. foreground color, and a \code{.bg-blue} CSS class that applies the color
  348. to the background.}
  349. \item{extra_css}{A named list of CSS definitions each containing a named list
  350. of CSS property-value pairs, i.e.
  351. \code{list(".class-id" = list("css-property" = "value"))}.}
  352. \item{extra_fonts}{A list of additional fonts to import, each list element
  353. can be either a URL as a character string or a call to
  354. \code{\link{google_font}()}. To use a font imported in \code{extra_fonts}, you
  355. will need to write custom CSS rules that apply the font to an element or
  356. class with the \code{font-family} property. See the \strong{Fonts} section of
  357. \code{vignette("xaringanthemer")} for an example.}
  358. \item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"}
  359. }
  360. \value{
  361. The CSS styles are written to the file path provided in \code{outfile}
  362. (by default to \code{xaringan-themer.css}). If \code{outfile} is \code{NULL}, the CSS is
  363. returned directly as a character string.
  364. }
  365. \description{
  366. Creates a customized Xaringan theme CSS file.
  367. }
  368. \section{Functions}{
  369. \itemize{
  370. \item \code{xaringanthemer_font_default}: Default values for font family, weight, URLs and
  371. font fallbacks.
  372. }}
  373. \section{Usage}{
  374. To use the styles created by this theme function, make sure
  375. that you use \code{xaringan-themer.css} as your CSS file in your slides' YAML
  376. header. If you change the name of the output file using the \code{outfile}
  377. argument, use that name instead of the default file name.\if{html}{\out{<div class="yaml">}}\preformatted{output:
  378. xaringan::moon_reader:
  379. css: xaringan-themer.css
  380. }\if{html}{\out{</div>}}
  381. }
  382. \examples{
  383. # Create a xaringan style in a temporary file
  384. xaringan_themer_css <- tempfile("xaringan-themer-", fileext = ".css")
  385. style_xaringan(
  386. text_color = "#002b3",
  387. inverse_background_color = "#31b09e",
  388. inverse_text_color = "#002b3",
  389. outfile = xaringan_themer_css # omit in your slides to write the
  390. # styles to xaringan-themer.css
  391. )
  392. # View the CSS:
  393. # file.edit(xaringan_themer_css)
  394. }
  395. \seealso{
  396. Other themes:
  397. \code{\link{style_duo_accent_inverse}()},
  398. \code{\link{style_duo_accent}()},
  399. \code{\link{style_duo}()},
  400. \code{\link{style_mono_accent_inverse}()},
  401. \code{\link{style_mono_accent}()},
  402. \code{\link{style_mono_dark}()},
  403. \code{\link{style_mono_light}()},
  404. \code{\link{style_solarized_dark}()},
  405. \code{\link{style_solarized_light}()}
  406. }
  407. \concept{themes}