😎 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.

462 lines
21KB

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