😎 Give your xaringan slides some style
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

475 satır
22KB

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