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

427 rindas
19KB

  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/style_duo.R
  3. \name{style_duo}
  4. \alias{style_duo}
  5. \title{Duotone Theme}
  6. \usage{
  7. style_duo(
  8. primary_color = "#1F4257",
  9. secondary_color = "#F97B64",
  10. text_color = choose_dark_or_light(primary_color, darken_color(primary_color, 0.9),
  11. lighten_color(secondary_color, 0.99)),
  12. header_color = secondary_color,
  13. background_color = primary_color,
  14. link_color = secondary_color,
  15. text_bold_color = secondary_color,
  16. text_slide_number_color = text_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 = secondary_color,
  23. code_inline_background_color = NULL,
  24. code_inline_font_size = "1em",
  25. inverse_background_color = secondary_color,
  26. inverse_text_color = primary_color,
  27. inverse_text_shadow = FALSE,
  28. inverse_header_color = primary_color,
  29. title_slide_text_color = secondary_color,
  30. title_slide_background_color = primary_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(secondary_color, 0.6),
  38. left_column_selected_color = secondary_color,
  39. blockquote_left_border_color = apply_alpha(secondary_color, 0.5),
  40. table_border_color = "#666",
  41. table_row_border_color = "#ddd",
  42. table_row_even_background_color = lighten_color(primary_color, 0.9),
  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 = "Noto Sans",
  57. text_font_weight = "normal",
  58. text_font_url = "https://fonts.googleapis.com/css?family=Noto+Sans:400,400i,700,700i&display=swap",
  59. text_font_family_fallback = "-apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, Ubuntu, roboto, noto, segoe ui, arial",
  60. text_font_base = "sans-serif",
  61. header_font_google = NULL,
  62. header_font_family = "Cabin",
  63. header_font_weight = "600",
  64. header_font_url = "https://fonts.googleapis.com/css?family=Cabin:600,600i&display=swap",
  65. code_font_google = NULL,
  66. code_font_family = "Source Code Pro",
  67. code_font_size = "0.9rem",
  68. code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700&display=swap",
  69. code_font_family_fallback = "Menlo, Consolas, Monaco, Liberation Mono, Lucida Console",
  70. colors = NULL,
  71. extra_css = NULL,
  72. extra_fonts = NULL,
  73. outfile = "xaringan-themer.css"
  74. )
  75. }
  76. \arguments{
  77. \item{primary_color}{Duotone Primary Color. Defaults to #1F4257. Used in
  78. multiple CSS rules. The value of this variable is also stored as a CSS
  79. variable that can be referenced with \code{var(--primary)} in any argument of a
  80. style function or in custom CSS.}
  81. \item{secondary_color}{Duotone Secondary Color. Defaults to #F97B64. 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(--secondary)} in any argument of
  84. a style function or in custom CSS.}
  85. \item{text_color}{Text Color. Defaults to
  86. \code{choose_dark_or_light(primary_color, darken_color(primary_color, 0.9), lighten_color(secondary_color, 0.99))}.
  87. Modifies the \code{body} element. The value of this variable is also stored as
  88. a CSS variable that can be referenced with \code{var(--text_color)} in any
  89. argument of a style function or in custom CSS.}
  90. \item{header_color}{Header Color. Defaults to \code{secondary_color}. Modifies
  91. the \verb{h1, h2, h3} elements. The value of this variable is also stored as a
  92. CSS variable that can be referenced with \code{var(--header-color)} in any
  93. argument of a style function or in custom CSS.}
  94. \item{background_color}{Slide Background Color. Defaults to \code{primary_color}.
  95. Modifies the \code{.remark-slide-content} class. The value of this variable is
  96. also stored as a CSS variable that can be referenced with
  97. \code{var(--background-color)} in any argument of a style function or in custom
  98. CSS.}
  99. \item{link_color}{Link Color. Defaults to \code{secondary_color}. Modifies the
  100. \verb{a, a > code} elements. The value of this variable is also stored as a CSS
  101. variable that can be referenced with \code{var(--link-color)} in any argument
  102. of a style function or in custom CSS.}
  103. \item{text_bold_color}{Bold Text Color. Defaults to \code{secondary_color}.
  104. Modifies the \code{strong} element. The value of this variable is also stored
  105. as a CSS variable that can be referenced with \code{var(--text-bold-color)} in
  106. any argument of a style function or in custom CSS.}
  107. \item{text_slide_number_color}{Slide Number Color. Defaults to \code{text_color}.
  108. Modifies the \code{.remark-slide-number} class.}
  109. \item{padding}{Slide Padding in \verb{top right [bottom left]} format. Defaults
  110. to 16px 64px 16px 64px. Modifies the \code{.remark-slide-content} class.}
  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 backround 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.}
  120. \item{background_position}{Background image position, requires
  121. \code{background_image} to be set, and it is recommended to adjust
  122. \code{background_size}. Defaults to \code{NULL}. Modifies the
  123. \code{.remark-slide-content} class.}
  124. \item{code_highlight_color}{Code Line Highlight. Defaults to
  125. rgba(255,255,0,0.5). Modifies the \code{.remark-code-line-highlighted} class.
  126. The value of this variable is also stored as a CSS variable that can be
  127. referenced with \code{var(--code-highlight-color)} in any argument of a style
  128. function or in custom CSS.}
  129. \item{code_inline_color}{Inline Code Color. Defaults to \code{secondary_color}.
  130. Modifies the \code{.remark-inline-code} class.}
  131. \item{code_inline_background_color}{Inline Code Background Color. Defaults
  132. to \code{NULL}. Modifies the \code{.remark-inline-code} class.}
  133. \item{code_inline_font_size}{Inline Code Text Font Size. Defaults to 1em.
  134. Modifies the \code{.remark-inline-code} class. The value of this variable is
  135. also stored as a CSS variable that can be referenced with
  136. \code{var(--code-inline-font-size)} in any argument of a style function or in
  137. custom CSS.}
  138. \item{inverse_background_color}{Inverse Background Color. Defaults to
  139. \code{secondary_color}. Modifies the \code{.inverse} class. The value of this
  140. variable is also stored as a CSS variable that can be referenced with
  141. \code{var(--inverse-background-color)} in any argument of a style function or
  142. in custom CSS.}
  143. \item{inverse_text_color}{Inverse Text Color. Defaults to \code{primary_color}.
  144. Modifies the \code{.inverse} class. The value of this variable is also stored
  145. as a CSS variable that can be referenced with \code{var(--inverse-text-color)}
  146. in any argument of a style function or in custom CSS.}
  147. \item{inverse_text_shadow}{Enables Shadow on text of inverse slides.
  148. Defaults to \code{FALSE}. Modifies the \code{.inverse} class.}
  149. \item{inverse_header_color}{Inverse Header Color. Defaults to
  150. \code{primary_color}. Modifies the \verb{.inverse h1, .inverse h2, .inverse h3}
  151. classes. The value of this variable is also stored as a CSS variable that
  152. can be referenced with \code{var(--inverse-header-color)} in any argument of a
  153. style function or in custom CSS.}
  154. \item{title_slide_text_color}{Title Slide Text Color. Defaults to
  155. \code{secondary_color}. Modifies the \code{.title-slide} class. The value of this
  156. variable is also stored as a CSS variable that can be referenced with
  157. \code{var(--title-slide-text-color)} in any argument of a style function or in
  158. custom CSS.}
  159. \item{title_slide_background_color}{Title Slide Background Color. Defaults
  160. to \code{primary_color}. Modifies the \code{.title-slide} class. The value of this
  161. variable is also stored as a CSS variable that can be referenced with
  162. \code{var(--title-slide-background-color)} in any argument of a style function
  163. or in custom CSS.}
  164. \item{title_slide_background_image}{Title Slide Background Image URL.
  165. Defaults to \code{NULL}. Modifies the \code{.title-slide} class.}
  166. \item{title_slide_background_size}{Title Slide Background Image Size,
  167. defaults to "cover" if background image is set. Defaults to \code{NULL}.
  168. Modifies the \code{.title-slide} class.}
  169. \item{title_slide_background_position}{Title Slide Background Image
  170. Position. Defaults to \code{NULL}. Modifies the \code{.title-slide} class.}
  171. \item{footnote_color}{Footnote text color (if \code{NA}, then it will be the same
  172. color as \code{text_color}). Defaults to \code{NULL}. Modifies the \code{.footnote}
  173. class.}
  174. \item{footnote_font_size}{Footnote font size. Defaults to 0.9em. Modifies
  175. the \code{.footnote} class.}
  176. \item{footnote_position_bottom}{Footnote location from bottom of screen.
  177. Defaults to 60px. Modifies the \code{.footnote} class.}
  178. \item{left_column_subtle_color}{Left Column Text (not last). Defaults to
  179. \code{apply_alpha(secondary_color, 0.6)}. Modifies the
  180. \verb{.left-column h2, .left-column h3} classes.}
  181. \item{left_column_selected_color}{Left Column Current Selection. Defaults to
  182. \code{secondary_color}. Modifies the
  183. \verb{.left-column h2:last-of-type, .left-column h3:last-child} classes.}
  184. \item{blockquote_left_border_color}{Blockquote Left Border Color. Defaults
  185. to \code{apply_alpha(secondary_color, 0.5)}. Modifies the \code{blockquote} element.}
  186. \item{table_border_color}{Table top/bottom border. Defaults to #666.
  187. Modifies the \verb{table: border-top, border-bottom} elements.}
  188. \item{table_row_border_color}{Table row inner bottom border. Defaults to
  189. #ddd. Modifies the \verb{table thead th: border-bottom} elements.}
  190. \item{table_row_even_background_color}{Table Even Row Background Color.
  191. Defaults to \code{lighten_color(primary_color, 0.9)}. Modifies the
  192. \verb{thead, tfoot, tr:nth-child(even)} elements.}
  193. \item{base_font_size}{Base Font Size for All Slide Elements (must be \code{px}).
  194. Defaults to 20px. Modifies the \code{html} element. The value of this variable
  195. is also stored as a CSS variable that can be referenced with
  196. \code{var(--base-font-size)} in any argument of a style function or in custom
  197. CSS.}
  198. \item{text_font_size}{Slide Body Text Font Size. Defaults to 1rem. Modifies
  199. the \code{.remark-slide-content} class. The value of this variable is also
  200. stored as a CSS variable that can be referenced with
  201. \code{var(--text-font-size)} in any argument of a style function or in custom
  202. CSS.}
  203. \item{header_h1_font_size}{h1 Header Text Font Size. Defaults to 2.75rem.
  204. Modifies the \verb{.remark-slide-content h1} class. The value of this variable
  205. is also stored as a CSS variable that can be referenced with
  206. \code{var(--header-h1-font-size)} in any argument of a style function or in
  207. custom CSS.}
  208. \item{header_h2_font_size}{h2 Header Text Font Size. Defaults to 2.25rem.
  209. Modifies the \verb{.remark-slide-content h2} class. The value of this variable
  210. is also stored as a CSS variable that can be referenced with
  211. \code{var(--header-h2-font-size)} in any argument of a style function or in
  212. custom CSS.}
  213. \item{header_h3_font_size}{h3 Header Text Font Size. Defaults to 1.75rem.
  214. Modifies the \verb{.remark-slide-content h3} class. The value of this variable
  215. is also stored as a CSS variable that can be referenced with
  216. \code{var(--header-h3-font-size)} in any argument of a style function or in
  217. custom CSS.}
  218. \item{header_background_auto}{Add background under slide title automatically
  219. for h1 header elements. If not enabled, use \code{class: header_background} to
  220. enable. Defaults to \code{FALSE}.}
  221. \item{header_background_color}{Background Color for h1 Header with
  222. Background. Defaults to \code{header_color}. Modifies the
  223. \verb{.remark-slide-content h1} class. The value of this variable is also
  224. stored as a CSS variable that can be referenced with
  225. \code{var(--header-background-color)} in any argument of a style function or in
  226. custom CSS.}
  227. \item{header_background_text_color}{Text Color for h1 Header with
  228. Background. Defaults to \code{background_color}. Modifies the
  229. \verb{.remark-slide-content h1} class. The value of this variable is also
  230. stored as a CSS variable that can be referenced with
  231. \code{var(--header-background-text-color)} in any argument of a style function
  232. or in custom CSS.}
  233. \item{header_background_padding}{Padding for h1 Header with Background.
  234. Defaults to \code{NULL}. Modifies the \verb{.remark-slide-content h1} class.}
  235. \item{header_background_content_padding_top}{Top Padding for Content in
  236. Slide with Header with Background. Defaults to 7rem. Modifies the
  237. \code{.remark-slide-content} class.}
  238. \item{header_background_ignore_classes}{Slide Classes Where Header with
  239. Background will not be Applied. Defaults to
  240. \code{c('normal', 'inverse', 'title', 'middle', 'bottom')}. Modifies the
  241. \code{.remark-slide-content} class.}
  242. \item{text_slide_number_font_size}{Slide Number Text Font Size. Defaults to
  243. 0.9em. Modifies the \code{.remark-slide-number} class.}
  244. \item{text_font_google}{Use \code{google_font()} to specify body font. Defaults
  245. to \code{NULL}. Modifies the \code{body} element.}
  246. \item{text_font_family}{Body Text Font Family (xaringan default is
  247. \code{'Droid Serif'}). Defaults to Noto Sans. Modifies the \code{body} element. The
  248. value of this variable is also stored as a CSS variable that can be
  249. referenced with \code{var(--text-font-family)} in any argument of a style
  250. function or in custom CSS.}
  251. \item{text_font_weight}{Body Text Font Weight. Defaults to normal. Modifies
  252. the \code{body} element.}
  253. \item{text_font_url}{Body Text Font URL(s). Defaults to
  254. https://fonts.googleapis.com/css?family=Noto+Sans:400,400i,700,700i&display=swap.
  255. Modifies the \verb{@import url()} elements.}
  256. \item{text_font_family_fallback}{Body Text Font Fallbacks. Defaults to
  257. -apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue,
  258. helvetica, Ubuntu, roboto, noto, segoe ui, arial. Modifies the \code{body}
  259. element. The value of this variable is also stored as a CSS variable that
  260. can be referenced with \code{var(--text-font-family-fallback)} in any argument
  261. of a style function or in custom CSS.}
  262. \item{text_font_base}{Body Text Base Font (Total Failure Fallback). Defaults
  263. to sans-serif. Modifies the \code{body} element. The value of this variable is
  264. also stored as a CSS variable that can be referenced with
  265. \code{var(--text-font-base)} in any argument of a style function or in custom
  266. CSS.}
  267. \item{header_font_google}{Use \code{google_font()} to specify header font.
  268. Defaults to \code{NULL}. Modifies the \code{body} element.}
  269. \item{header_font_family}{Header Font Family (xaringan default is
  270. \code{'Yanone Kaffeesatz'}). Defaults to Cabin. Modifies the \verb{h1, h2, h3}
  271. elements. The value of this variable is also stored as a CSS variable that
  272. can be referenced with \code{var(--header-font-family)} in any argument of a
  273. style function or in custom CSS.}
  274. \item{header_font_weight}{Header Font Weight. Defaults to 600. Modifies the
  275. \verb{h1, h2, h3} elements.}
  276. \item{header_font_url}{Header Font URL. Defaults to
  277. https://fonts.googleapis.com/css?family=Cabin:600,600i&display=swap.
  278. Modifies the \verb{@import url} elements.}
  279. \item{code_font_google}{Use \code{google_font()} to specify code font. Defaults
  280. to \code{NULL}. Modifies the \code{body} element.}
  281. \item{code_font_family}{Code Font Family. Defaults to Source Code Pro.
  282. Modifies the \verb{.remark-code, .remark-inline-code} classes. The value of
  283. this variable is also stored as a CSS variable that can be referenced with
  284. \code{var(--code-font-family)} in any argument of a style function or in custom
  285. CSS.}
  286. \item{code_font_size}{Code Text Font Size. Defaults to 0.9rem. Modifies the
  287. \code{.remark-inline} class. The value of this variable is also stored as a CSS
  288. variable that can be referenced with \code{var(--code-font-size)} in any
  289. argument of a style function or in custom CSS.}
  290. \item{code_font_url}{Code Font URL. Defaults to
  291. https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700&display=swap.
  292. Modifies the \verb{@import url} elements.}
  293. \item{code_font_family_fallback}{Code Font Fallback. Defaults to Menlo,
  294. Consolas, Monaco, Liberation Mono, Lucida Console. Modifies the
  295. \verb{.remark-code, .remark-inline-code} classes.}
  296. \item{colors}{A named vector of custom colors. The names of the colors
  297. become CSS variables and classes that can be used within your slides.
  298. For example, \code{colors = c(blue = "#bad4ed")} adds a CSS variable
  299. \code{--blue}, a \code{.blue} CSS class that applies the color to the text or
  300. foreground color, and a \code{.bg-blue} CSS class that applies the color
  301. to the background.}
  302. \item{extra_css}{A named list of CSS definitions each containing a named list
  303. of CSS property-value pairs, i.e.
  304. \code{list(".class-id" = list("css-property" = "value"))}.}
  305. \item{extra_fonts}{A list of additional fonts to import, each list element
  306. can be either a URL as a character string or a call to
  307. \code{\link{google_font}()}. To use a font imported in \code{extra_fonts}, you
  308. will need to write custom CSS rules that apply the font to an element or
  309. class with the \code{font-family} property. See the \strong{Fonts} section of
  310. \code{vignette("xaringanthemer")} for an example.}
  311. \item{outfile}{Customized xaringan CSS output file name, default is "xaringan-themer.css"}
  312. }
  313. \description{
  314. A duotone theme designed to work well with two complementary
  315. colors.
  316. }
  317. \section{Usage}{
  318. To use the styles created by this theme function, make sure
  319. that you use \code{xaringan-themer.css} as your CSS file in your slides' YAML
  320. header. If you change the name of the output file using the \code{outfile}
  321. argument, use that name instead of the default file name.\if{html}{\out{<div class="yaml">}}\preformatted{output:
  322. xaringan::moon_reader:
  323. css: xaringan-themer.css`
  324. }\if{html}{\out{</div>}}
  325. }
  326. \examples{
  327. # Create a xaringan style in a temporary file
  328. xaringan_themer_css <- tempfile("xaringan-themer-", fileext = ".css")
  329. style_duo(
  330. primary_color = "#1f4257",
  331. secondary_color = "#f97b64",
  332. outfile = xaringan_themer_css # omit in your slides to write the
  333. # styles to xaringan-themer.css
  334. )
  335. # View the CSS:
  336. # file.edit(xaringan_themer_css)
  337. }
  338. \seealso{
  339. Other themes:
  340. \code{\link{style_duo_accent_inverse}()},
  341. \code{\link{style_duo_accent}()},
  342. \code{\link{style_mono_accent_inverse}()},
  343. \code{\link{style_mono_accent}()},
  344. \code{\link{style_mono_dark}()},
  345. \code{\link{style_mono_light}()},
  346. \code{\link{style_solarized_dark}()},
  347. \code{\link{style_solarized_light}()},
  348. \code{\link{style_xaringan}()}
  349. Other Duotone themes:
  350. \code{\link{style_duo_accent_inverse}()},
  351. \code{\link{style_duo_accent}()}
  352. }
  353. \concept{Duotone themes}
  354. \concept{themes}