Showing preview only (822K chars total). Download the full file or copy to clipboard to get everything.
Repository: gadenbuie/xaringanthemer
Branch: main
Commit: 5c8035bb8562
Files: 124
Total size: 781.5 KB
Directory structure:
gitextract_unwrwvs4/
├── .Rbuildignore
├── .github/
│ ├── .gitignore
│ └── workflows/
│ ├── R-CMD-check.yaml
│ ├── pkg-maintenance.yaml
│ └── pkgdown.yaml
├── .gitignore
├── DESCRIPTION
├── LICENSE
├── LICENSE.md
├── NAMESPACE
├── NEWS.md
├── R/
│ ├── color.R
│ ├── css.R
│ ├── ggplot2.R
│ ├── style_duo.R
│ ├── style_duo_accent.R
│ ├── style_duo_accent_inverse.R
│ ├── style_extra_css.R
│ ├── style_font_default.R
│ ├── style_mono_accent.R
│ ├── style_mono_accent_inverse.R
│ ├── style_mono_dark.R
│ ├── style_mono_light.R
│ ├── style_solarized_dark.R
│ ├── style_solarized_light.R
│ ├── style_xaringan.R
│ ├── sysdata.rda
│ ├── utils.R
│ ├── utils_theme-gen.R
│ ├── xaringanthemer-deprecated.R
│ ├── xaringanthemer-package.R
│ └── zzz.R
├── README.Rmd
├── README.md
├── cran-comments.md
├── data-raw/
│ └── theme_template_variables.R
├── index.Rmd
├── index.md
├── inst/
│ ├── fonts/
│ │ └── OFL.txt
│ ├── resources/
│ │ ├── template.css
│ │ └── template_title-slide.css
│ ├── rmarkdown/
│ │ └── templates/
│ │ └── xaringanthemer/
│ │ ├── skeleton/
│ │ │ └── skeleton.Rmd
│ │ └── template.yaml
│ └── scripts/
│ ├── generate_theme_functions.R
│ └── style_xaringan_body.R
├── make.R
├── man/
│ ├── apply_alpha.Rd
│ ├── choose_dark_or_light.Rd
│ ├── fragments/
│ │ ├── _colors.Rmd
│ │ ├── _fonts.Rmd
│ │ ├── _installation.Rmd
│ │ ├── _quick-intro.Rmd
│ │ ├── _tagline-gif.Rmd
│ │ ├── _thanks.Rmd
│ │ └── _themes.Rmd
│ ├── google_font.Rd
│ ├── google_language_codes.Rd
│ ├── lighten_darken_color.Rd
│ ├── scale_xaringan.Rd
│ ├── style_duo.Rd
│ ├── style_duo_accent.Rd
│ ├── style_duo_accent_inverse.Rd
│ ├── style_extra_css.Rd
│ ├── style_mono_accent.Rd
│ ├── style_mono_accent_inverse.Rd
│ ├── style_mono_dark.Rd
│ ├── style_mono_light.Rd
│ ├── style_solarized_dark.Rd
│ ├── style_solarized_light.Rd
│ ├── style_xaringan.Rd
│ ├── theme_xaringan.Rd
│ ├── theme_xaringan_base.Rd
│ ├── theme_xaringan_get_value.Rd
│ ├── theme_xaringan_inverse.Rd
│ ├── theme_xaringan_set_defaults.Rd
│ ├── xaringanthemer-deprecated.Rd
│ └── xaringanthemer-package.Rd
├── man-roxygen/
│ ├── style-usage.R
│ ├── style_duo.R
│ ├── style_duo_accent.R
│ ├── style_duo_accent_inverse.R
│ ├── style_mono_accent.R
│ ├── style_mono_accent_inverse.R
│ ├── style_mono_dark.R
│ ├── style_mono_light.R
│ ├── style_solarized_dark.R
│ ├── style_solarized_light.R
│ ├── style_xaringan.R
│ └── theme_params.R
├── pkgdown/
│ ├── _pkgdown.yml
│ └── extra.css
├── tests/
│ ├── testthat/
│ │ ├── _snaps/
│ │ │ └── utils.md
│ │ ├── css/
│ │ │ ├── duo-header_bg.css
│ │ │ ├── duo.css
│ │ │ ├── duo_accent.css
│ │ │ ├── duo_accent_inverse.css
│ │ │ ├── google_fonts.css
│ │ │ ├── mono_accent.css
│ │ │ ├── mono_accent_inverse.css
│ │ │ ├── mono_dark.css
│ │ │ ├── mono_light-header_bg.css
│ │ │ ├── mono_light.css
│ │ │ ├── solarized_dark-header_bg.css
│ │ │ ├── solarized_dark.css
│ │ │ ├── solarized_light.css
│ │ │ └── xaringan.css
│ │ ├── helper-session.R
│ │ ├── test-color.R
│ │ ├── test-css.R
│ │ ├── test-ggplot2.R
│ │ ├── test-helpers.R
│ │ ├── test-style_extra_css.R
│ │ ├── test-style_xaringan.R
│ │ ├── test-themes.R
│ │ ├── test-utils.R
│ │ └── test-xaringanthemer-deprecated.R
│ └── testthat.R
├── vignettes/
│ ├── .gitignore
│ ├── fonts.Rmd
│ ├── ggplot2-themes.Rmd
│ ├── template-variables.Rmd
│ ├── themes.Rmd
│ └── xaringanthemer.Rmd
└── xaringanthemer.Rproj
================================================
FILE CONTENTS
================================================
================================================
FILE: .Rbuildignore
================================================
^.*\.Rproj$
^\.Rproj\.user$
^README\.Rmd$
^LICENSE\.md$
^make\.R$
^vignettes/singles$
^tests_$
^_.+$
^docs$
^index\.Rmd$
^man-roxygen$
^tic\.R$
^appveyor\.yml$
^\.travis\.yml$
^pkgdown$
^vignettes/fonts\.Rmd$
^vignettes/themes\.Rmd$
^data-raw$
^.history$
^doc$
^Meta$
^index\.md$
^\.ccache$
^\.github$
^clang-.*
^gfortran.*
^cran-comments\.md$
^CRAN-RELEASE$
^CRAN-SUBMISSION$
================================================
FILE: .github/.gitignore
================================================
r-depends.rds
*.html
================================================
FILE: .github/workflows/R-CMD-check.yaml
================================================
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
name: R-CMD-check
jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
================================================
FILE: .github/workflows/pkg-maintenance.yaml
================================================
on:
pull_request:
push:
branches: main
name: Package Maintenance
jobs:
auto-pkg-maintenance:
uses: rstudio/education-workflows/.github/workflows/auto-pkg-maintenance.yaml@v1
with:
extra-packages: any::showtext, any::sysfonts, any::ggplot2
================================================
FILE: .github/workflows/pkgdown.yaml
================================================
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:
name: pkgdown
jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website
- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}
- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
clean: false
branch: gh-pages
folder: docs
================================================
FILE: .gitignore
================================================
.Rproj.user
.Rhistory
.RData
.Ruserdata
inst/doc
_tests
_stuff
.DS_Store
README.html
# vscode
.history/
# Directories that start with _
/_*/
## https://github.com/github/gitignore/blob/master/R.gitignore
# History files
.Rhistory
.Rapp.history
# Session Data files
.RData
# Example code in package build process
*-Ex.R
# Output files from R CMD build
/*.tar.gz
# Output files from R CMD check
/*.Rcheck/
# RStudio files
.Rproj.user/
# produced vignettes
vignettes/*.html
vignettes/*.pdf
# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
.httr-oauth
# knitr and R markdown default cache directories
/*_cache/
/cache/
# Temporary files created by R markdown
*.utf8.md
*.knit.md
# Shiny token, see https://shiny.rstudio.com/articles/shinyapps.html
rsconnect/
## https://github.com/github/gitignore/blob/master/Global/macOS.gitignore
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
doc
Meta
docs/
================================================
FILE: DESCRIPTION
================================================
Type: Package
Package: xaringanthemer
Title: Custom 'xaringan' CSS Themes
Version: 0.4.4.9000
Authors@R:
person("Garrick", "Aden-Buie", , "garrick@adenbuie.com", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-7111-0077"))
Description: Create beautifully color-coordinated and customized themes
for your 'xaringan' slides, without writing any CSS. Complete your
slide theme with 'ggplot2' themes that match the font and colors used
in your slides. Customized styles can be created directly in your
slides' 'R Markdown' source file or in a separate external script.
License: MIT + file LICENSE
URL: https://pkg.garrickadenbuie.com/xaringanthemer/,
https://github.com/gadenbuie/xaringanthemer
BugReports: https://github.com/gadenbuie/xaringanthemer/issues
Depends:
R (>= 2.10)
Imports:
colorspace,
glue,
methods,
purrr,
utils,
whisker
Suggests:
callr,
ggplot2,
knitr,
mockery,
rmarkdown,
scales,
showtext,
sysfonts,
testthat (>= 2.1.0),
xaringan
VignetteBuilder:
knitr
Config/Needs/website: gadenbuie/grkgdown, pkgdown
Config/testthat/edition: 3
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
================================================
FILE: LICENSE
================================================
YEAR: 2025
COPYRIGHT HOLDER: Garrick Aden-Buie
================================================
FILE: LICENSE.md
================================================
# MIT License
Copyright (c) 2020 Garrick Aden-Buie
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: NAMESPACE
================================================
# Generated by roxygen2: do not edit by hand
S3method(print,google_font)
S3method(print,xaringanthemer_default)
export(apply_alpha)
export(choose_dark_or_light)
export(darken_color)
export(duo)
export(duo_accent)
export(duo_accent_inverse)
export(google_font)
export(google_language_codes)
export(lighten_color)
export(mono_accent)
export(mono_accent_inverse)
export(mono_dark)
export(mono_light)
export(scale_xaringan_color_continuous)
export(scale_xaringan_color_discrete)
export(scale_xaringan_colour_continuous)
export(scale_xaringan_colour_discrete)
export(scale_xaringan_continuous)
export(scale_xaringan_discrete)
export(scale_xaringan_fill_continuous)
export(scale_xaringan_fill_discrete)
export(solarized_dark)
export(solarized_light)
export(style_duo)
export(style_duo_accent)
export(style_duo_accent_inverse)
export(style_extra_css)
export(style_mono_accent)
export(style_mono_accent_inverse)
export(style_mono_dark)
export(style_mono_light)
export(style_solarized_dark)
export(style_solarized_light)
export(style_xaringan)
export(theme_xaringan)
export(theme_xaringan_base)
export(theme_xaringan_get_value)
export(theme_xaringan_inverse)
export(theme_xaringan_restore_defaults)
export(theme_xaringan_set_defaults)
export(write_extra_css)
export(write_xaringan_theme)
export(xaringanthemer_font_default)
importFrom(grDevices,col2rgb)
importFrom(grDevices,hsv)
importFrom(grDevices,rgb)
importFrom(grDevices,rgb2hsv)
================================================
FILE: NEWS.md
================================================
# xaringanthemer (development version)
# xaringanthemer 0.4.4
- `scale_xaringan_continuous()` and `scale_xaringan_discrete()` now set
`na.value = "grey50"` by default for compatibility with ggplot2 > 3.5.2
(thanks @teunbrand, #82).
# xaringanthemer 0.4.3
- Update the spelling of `colour` for compatibility with ggplot2 >= 3.5.1 (@teunbrand #79).
# xaringanthemer 0.4.2
- Use `.table-unshaded` class on a tables to prevent xaringanthemer's table heading and row shading (thanks @dragonattheend, #74)
- Use `inverse_text_color` as the default for `inverse_header_color` in most places (#60)
- Fixed a bug that happened when providing named values for key theme colors (#62)
- Re-document for CRAN
# xaringanthemer 0.4.1
* Text alignment in code blocks in `left`, `center`, or `right` aligned slides
no longer matches the slide text. Instead, the code block width is reduced,
if possible, and the block is pushed to the left, center, or right using
margins (#68).
* The style functions are now more permissive about color names in the `color`
argument. Color names should be valid CSS classes that can also be used as CSS
variable names, but the `style_` function only stops with an error if the
color name contains spaces. (@jdlom #69)
* Fixed an issue that caused problems rendering the xaringanthemer R Markdown
template if the showtext package isn't installed (thanks @beatrizmilz, #65).
# xaringanthemer 0.4.0
* Added `text_bold_font_weight` argument to xaringanthemer style functions with
a corresponding CSS rule setting the `font-weight` property of `<strong>`
elements (thanks @matiasandina, #50).
* The style functions gain a `link_decoration` argument to set the
[`text-decoration`](https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration)
property for links (#57).
* Set slide number font size in `rem` so that increasing the font size at the
slide level doesn't result in giant slide numbers (#53).
* The xaringanthemer slide skeleton (R Markdown template) will now render when
packages that are used in the template but not in xaringanthemer's Imports are
not installed (#52).
* xaringanthemer no longer sets the `fig.showtext` chunk option when the
showtext package isn't installed and also when `fig.showtext = FALSE`
(thanks @mikedecr #36, #56).
# xaringanthemes 0.3.4
* Maintenance release to avoid issues with upcoming R 4.1.0 (#49)
# xaringanthemer 0.3.3
* Add `inverse_link_color` to control color of links on inverse slides
(thanks @dmi3kno, #44)
* .pull-right[] now clears floats just for its immediate sibling
* Add `header_font_family_fallback` to control fallback fonts for headings
(thanks @mattwarkentin, #41)
* New xaringanthemer presentation skeleton with a kitchen sink of typical
slide elements with the goal of making it easier to preview new themes
during development.
# xaringanthemer 0.3.0
* Adds `theme_xaringan()`, a ggplot2 theme that automatically uses the colors
and font styles of your xaringanthemer style. Also adds
`scale_xaringan_discrete()` and `scale_xaringan_continuous()` functions that
use your slides' primary colors for the color or fill aesthetics. These theme
functions can recover the primary colors used in a xaringanthemer (>= 0.3.0)
CSS file even if you don't call the style function directly in your slides.
* Renamed all xaringanthemer functions that create CSS styles to use the
prefix "`style_`". For example, `mono_light()` is now `style_mono_light()`.
Additionally, `write_xaringan_theme()` is now `style_xaringan()` and
`write_extra_css()` is `style_extra_css()`. Overall, this change makes the
xarignanthemer API much cleaner and easier to navigate. Previous function
names are deprecated but still work.
* Added `background_header_auto` parameter that adds a background under the
first `h1` element (i.e. `# Slide Title`) on a slide. When enabled, the
background is added automatically to slides, as long as they aren't
`inverse`, `center`, `middle`, or `bottom`-styled slides. When disabled,
you can still enable slide title headers by adding the `header_background`
class to a slide. (thanks, @Btibert3, #10)
* The underlying template now uses the `whisker` package.
* xaringanthemer styles now use CSS variables throughout. Most of the settings
used in defining a style are stored in CSS variables. The variable names are
documented in their corresponding arguments. For example, the color selected
for `background_color` is stored in the variable `--background-color`. These
variables can be used in custom CSS rules or in other arguments in any style
functions, for example as `var(--background-color)`.
* xaringanthemer now uses a different set of default fonts for heading and body
fonts. The new defaults use [Cabin](https://fonts.google.com/specimen/Cabin)
for headings and [Noto Sans](https://fonts.google.com/specimen/Noto+Sans) for
body text. These fonts are easier to read on screens and at a distance during
presentations, and they support a wide variety of languages and weights.
Another reason for the change is that the xaringan (remarkjs) default body
font, _Droid Serif_, is no longer officially included in Google Fonts.
* Additional colors can be provided in the `colors` argument, which takes a
named vector of colors. The names become both CSS classes and CSS variables
that can be used throughout your slide styles. For example,
`colors = c(red = "#d34213")` creates a `.red` CSS class for red foreground
text, a `.bg-red` CSS class for a red background, and a `--red` CSS variable
that can be referenced as `var(--red)` in any `_color` argument of your style
function.
## Bugfixes and Improvements
* Better handling of multiple `extra_fonts`, including improved error messages.
(Thanks @pat-s, #19).
* `style_extra_css()` (previously `write_extra_css()`) gained an `append`
argument so that it can append to or overwrite an existing file (thanks @pat-s, #17).
* The underlying tibble holding the theme template variables was updated to
work with `tibble 3.0.0` (thanks @techisdead, @SymbolixAU, #32).
* The `css-help` vignette was removed and may be re-written in the future.
* Style function arguments that accept CSS property values are now documented in
the argument documentation, including a link to the MDN web docs page for the
CSS property or value (#33, thanks @TrashBirdEcology #18).
* Style functions return the CSS text directly when `outfile = NULL`.
================================================
FILE: R/color.R
================================================
#' @title Generate lighter or darker version of a color
#' @description Produces a linear blend of the color with white or black.
#' @param color_hex A character string representing a hex color
#' @param strength The "strength" of the blend with white or black,
#' where 0 is entirely the original color and 1 is entirely white
#' (`lighten_color()`) or black (`darken_color()`).
#' @examples
#' blue <- "#0e6ba8"
#' blue_light <- lighten_color(blue, strength = 0.33)
#' blue_dark <- darken_color(blue, strength = 0.33)
#'
#' if (requireNamespace("scales", quietly = TRUE)) {
#' scales::show_col(c(blue_light, blue, blue_dark))
#' }
#' @return A character string with the lightened or darkened color in
#' hexadecimal format.
#' @name lighten_darken_color
NULL
#' @rdname lighten_darken_color
#' @export
lighten_color <- function(color_hex, strength = 0.7) {
stopifnot(strength >= 0 && strength <= 1)
color_rgb <- col2rgb(color_hex)[, 1]
color_rgb <- (1 - strength) * color_rgb + strength * 255
rgb(color_rgb[1], color_rgb[2], color_rgb[3], maxColorValue = 255)
}
#' @rdname lighten_darken_color
#' @export
darken_color <- function(color_hex, strength = 0.8) {
stopifnot(strength >= 0 && strength <= 1)
color_rgb <- col2rgb(color_hex)[, 1]
color_rgb <- (1 - strength) * color_rgb
rgb(color_rgb[1], color_rgb[2], color_rgb[3], maxColorValue = 255)
}
#' @title Add alpha to hex color
#' @description Applies alpha (or opacity) to a color in hexadecimal form by
#' converting opacity in the `[0, 1]` range to hex in the `[0, 255]` range
#' and appending to the hex color.
#' @inheritParams lighten_darken_color
#' @param opacity Desired opacity of the output color
#' @examples
#' blue <- "#0e6ba8"
#' blue_transparent <- apply_alpha(blue)
#'
#' if (requireNamespace("scales", quietly = TRUE)) {
#' scales::show_col(c(blue, blue_transparent))
#' }
#' @return A character string with added opacity level as hexadecimal characters.
#' @export
apply_alpha <- function(color_hex, opacity = 0.5) {
paste0(color_hex, as.hexmode(round(255 * opacity, 0)))
}
adjust_value_color <- function(color_hex, strength = 0.5) {
color_hsv <- rgb2hsv(col2rgb(color_hex))[, 1]
color_hsv["v"] <- strength
hsv(color_hsv[1], color_hsv[2], color_hsv[3])
}
#' Choose dark or light color
#'
#' Takes a color input as `x` and returns either the black or white color (or
#' expression) if dark or light text should be used over the input color for
#' best contrast. Follows W3C Recommendations.
#'
#' @references <https://stackoverflow.com/a/3943023/2022615>
#' @param x The background color (hex)
#' @param black Text or foreground color, e.g. "#222" or
#' `substitute(darken_color(x, 0.8))`, if black text provides the best contrast.
#' @param white Text or foreground color or expression, e.g. "#EEE" or
#' `substitute(lighten_color(x, 0.8))`, if white text provides the best contrast.
#' @examples
#' light_green <- "#c4d6b0"
#' contrast_green <- choose_dark_or_light(light_green)
#' dark_purple <- "#381d2a"
#' contrast_purple <- choose_dark_or_light(dark_purple)
#'
#' if (requireNamespace("scales", quietly = TRUE)) {
#' scales::show_col(c(light_green, contrast_green, dark_purple, contrast_purple))
#' }
#' @return The `black` color or `white` color according to which color provides
#' the greates contrast with the input color.
#'
#' @export
choose_dark_or_light <- function(x, black = "#000000", white = "#FFFFFF") {
if (is_light_color(x)) eval(black) else eval(white)
}
is_light_color <- function(x) {
# this function returns TRUE if the given color
# is light-colored and requires dark text
color_rgb <- col2rgb(x)[, 1]
# from https://stackoverflow.com/a/3943023/2022615
color_rgb <- color_rgb / 255
color_rgb[color_rgb <= 0.03928] <- color_rgb[color_rgb <= 0.03928] / 12.92
color_rgb[color_rgb > 0.03928] <- ((color_rgb[color_rgb > 0.03928] + 0.055) / 1.055)^2.4
lum <- t(c(0.2126, 0.7152, 0.0722)) %*% color_rgb
lum[1, 1] > 0.179
}
prepare_colors <- function(colors = NULL) {
if (is.null(colors) || length(colors) < 1) return(NULL)
if (is.null(names(colors))) {
stop(
"`colors` must have names corresponding to valid CSS classes",
call. = FALSE
)
}
if (any(grepl("\\s", names(colors)))) {
stop(
"Color names in `colors` must be valid CSS classes",
" and cannot contain spaces",
call. = FALSE)
}
maybe_bad_css <- unique(grep("^[_-]|[ .>~*:|+}/]", names(colors), value = TRUE))
if (length(maybe_bad_css) > 0) {
warning(
"Color names in `colors` should be valid CSS classes: ",
paste0("'", maybe_bad_css, "'", collapse = ", "),
call. = FALSE
)
}
whisker::iteratelist(colors, "color_name")
}
full_length_hex <- function(x) {
varname <- substitute(x)
bad_hex_msg <- str_wrap(
"`", deparse(varname), "` is not a hexadecimal color: \"", x, "\". ",
"theme_xaringan() requires colors to be specified in hexadecimal format.",
" If you used valid CSS colors in your xaringan theme, please convert ",
"these colors to hex format, e.g. \"#1a2b3c\"."
)
check_color_is_hex(x, stop, bad_hex_msg)
x <- sub("^#", "", x)
if (nchar(x) == 3) {
x <- strsplit(x, character(0))[[1]]
x <- rep(x, each = 2)
x <- paste(x, collapse = "")
}
paste0("#", x)
}
check_color_is_hex <- function(
color,
throw = warning,
msg = "{color} is not a hexadecimal color"
) {
is_probably_hex <- grepl("^#", color) &&
!grepl("[^#0-9a-fA-F]", color) &&
nchar(sub("^#", "", color)) %in% c(3, 6)
if (!is_probably_hex) {
msg <- glue::glue(msg)
if (!is.null(throw)) throw(str_wrap(msg), call. = FALSE)
}
is_probably_hex
}
================================================
FILE: R/css.R
================================================
read_css_vars <- function(file = NULL) {
if (is.null(file)) {
css_candidates <- find_xaringan_themer_css()
file <- choose_xaringan_themer_css(css_candidates)
}
css_get_root(file)
}
find_xaringan_themer_css <- function() {
# finds xaringan themer files within or below current working directory
# and is only ever intended to be called in that situation
css_files <- list.files(pattern = "css$", recursive = TRUE, full.names = TRUE)
css_files_head <- purrr::map(css_files, readLines, n = 5)
is_xt <- grepl(pattern = "generated by xaringanthemer", css_files_head, fixed = TRUE)
css_files[is_xt]
}
choose_xaringan_themer_css <- function(css_candidates = character(0)) {
if (!length(css_candidates)) {
stop("Unable to locate a xaringanthemer css file.", call. = FALSE)
} else if (length(css_candidates) == 1) {
file <- css_candidates
} else if (length(css_candidates) > 1) {
is_xaringan_themer_css <- grepl("xaringan-themer.css", css_candidates, fixed = TRUE)
if (any(is_xaringan_themer_css)) {
file <- css_candidates[is_xaringan_themer_css][1]
} else {
file <- css_candidates[1]
message(glue::glue("Using xaringanthemer theme in {file}"))
}
}
file
}
css_get_root <- function(file) {
x <- readLines(file, warn = FALSE)
x <- paste(x, collapse = "\n")
where <- regexpr(":root\\s*\\{[^}]+\\}", x)
if (where < 0) return(NULL)
x <- substr(x, where, where + attr(where, "match.length"))
x <- strsplit(x, "\n")[[1]]
m <- regexec("--(.+):\\s*(.+?);", x)
x <- regmatches(x, m)
x <- purrr::compact(x)
vars <- gsub("-", "_", purrr::map_chr(x, `[`, 2))
values <- purrr::map(x, `[`, 3)
names(values) <- vars
for (font_type in c("text", "header", "code")) {
font_is_google <- paste0(font_type, "_font_is_google")
values[[font_is_google]] <- if (!is.null(values[[font_is_google]])) {
values[[font_is_google]] %in% c("1", "TRUE", "true", "yes")
} else FALSE
}
values
}
css_get_padding <- function(x) {
stopifnot(length(x) == 1)
x <- trimws(x)
x <- as.list(strsplit(x, " ")[[1]])
stopifnot(length(x) %in% c(1, 2, 4))
names(x) <- c("top", "right", "bottom", "left")[seq_along(x)]
list(
top = x$top,
right = x$right %||% x$top,
bottom = x$bottom %||% x$top,
left = x$left %||% x$right %||% x$top
)
}
================================================
FILE: R/ggplot2.R
================================================
#' A Plot Theme for ggplot2 by xaringanthemer
#'
#' @description
#'
#' `r lifecycle::badge("maturing")`
#'
#' Creates \pkg{ggplot2} themes to match the xaringanthemer theme used in the
#' \pkg{xaringan} slides that seamlessly matches the "normal" slide colors and
#' styles. See `vignette("ggplot2-themes")` for more information and examples.
#'
#' @param text_color Color for text and foreground, inherits from `text_color`
#' @param background_color Color for background, inherits from
#' `background_color`
#' @param accent_color Color for titles and accents, inherits from
#' `header_color`
#' @param accent_secondary_color Color for secondary accents, inherits from
#' `text_bold_color`
#' @param css_file Path to a \pkg{xaringanthemer} CSS file, from which the
#' theme variables and values will be inferred. In general, if you use the
#' \pkg{xaringathemer} defaults, you will not need to set this. This feature
#' lets you create a \pkg{ggplot2} theme for your \pkg{xaringan} slides, even
#' if you have only saved your theme CSS file and you aren't creating your
#' CSS theme with \pkg{xaringanthemer} in your slides' source file.
#' @inheritParams theme_xaringan_base
#'
#' @examples
#' # Requires ggplot2
#' has_ggplot2 <- requireNamespace("ggplot2", quietly = TRUE)
#'
#' if (has_ggplot2) {
#' # Because this is an example, we'll save the CSS to a temp file
#' path_to_css_file <- tempfile(fileext = ".css")
#'
#' # Create the xaringan theme: dark blue background with teal green accents
#' style_duo(
#' primary_color = "#002b36",
#' secondary_color = "#31b09e",
#' # Using basic fonts for this example, but the plot theme will
#' # automatically use your theme font if you use Google fonts
#' text_font_family = "sans",
#' header_font_family = "serif",
#' outfile = path_to_css_file
#' )
#'
#' library(ggplot2)
#' ggplot(mpg) +
#' aes(cty, hwy) +
#' geom_point() +
#' ggtitle("Fuel Efficiency of Various Cars") +
#' theme_xaringan()
#' }
#' @return A ggplot2 theme
#' @family xaringanthemer ggplot2 themes
#' @export
theme_xaringan <- function(
text_color = NULL,
background_color = NULL,
accent_color = NULL,
accent_secondary_color = NULL,
css_file = NULL,
set_ggplot_defaults = TRUE,
text_font = NULL,
text_font_use_google = NULL,
text_font_size = NULL,
title_font = NULL,
title_font_use_google = NULL,
title_font_size = NULL,
use_showtext = NULL
) {
requires_xaringanthemer_env(css_file = css_file, try_css = TRUE)
requires_package(fn = "xaringan_theme")
background_color <- background_color %||% xaringanthemer_env$background_color
text_color <- text_color %||% xaringanthemer_env$text_color
accent_color <- accent_color %||% xaringanthemer_env$header_color
accent_secondary_color <- accent_secondary_color %||% xaringanthemer_env$text_bold_color %||% accent_color
theme_xaringan_base(
text_color,
background_color,
accent_color = accent_color,
accent_secondary_color = accent_secondary_color,
set_ggplot_defaults = set_ggplot_defaults,
text_font = text_font,
text_font_use_google = text_font_use_google,
text_font_size = text_font_size,
title_font = title_font,
title_font_use_google = title_font_use_google,
title_font_size = title_font_size,
use_showtext = use_showtext
)
}
#' An Inverse Plot Theme for ggplot2 by xaringanthemer
#'
#' @description
#'
#' `r lifecycle::badge("maturing")`
#'
#' A \pkg{ggplot2} xaringanthemer plot theme to seamlessly match the "inverse"
#' \pkg{xaringan} slide colors and styles as styled by [xaringanthemer]. See
#' `vignette("ggplot2-themes")` for more information and examples.
#'
#' @param text_color Color for text and foreground, inherits from `text_color`
#' @param background_color Color for background, inherits from
#' `background_color`
#' @param accent_color Color for titles and accents, inherits from
#' `header_color`
#' @param accent_secondary_color Color for secondary accents, inherits from
#' `text_bold_color`
#' @inheritParams theme_xaringan
#' @inheritParams theme_xaringan_base
#'
#' @examples
#' # Requires ggplot2
#' has_ggplot2 <- requireNamespace("ggplot2", quietly = TRUE)
#'
#' if (has_ggplot2) {
#' # Because this is an example, we'll save the CSS to a temp file
#' path_to_css_file <- tempfile(fileext = ".css")
#'
#' # Create the xaringan theme: dark blue background with teal green accents
#' style_duo(
#' primary_color = "#002b36",
#' secondary_color = "#31b09e",
#' # Using basic fonts for this example, but the plot theme will
#' # automatically use your theme font if you use Google fonts
#' text_font_family = "sans",
#' header_font_family = "serif",
#' outfile = path_to_css_file
#' )
#'
#' library(ggplot2)
#' ggplot(mpg) +
#' aes(cty, hwy) +
#' geom_point() +
#' ggtitle("Fuel Efficiency of Various Cars") +
#' # themed to match the inverse slides: teal background with dark blue text
#' theme_xaringan_inverse()
#' }
#' @return A ggplot2 theme
#' @family xaringanthemer ggplot2 themes
#' @export
theme_xaringan_inverse <- function(
text_color = NULL,
background_color = NULL,
accent_color = NULL,
accent_secondary_color = NULL,
css_file = NULL,
set_ggplot_defaults = TRUE,
text_font = NULL,
text_font_use_google = NULL,
text_font_size = NULL,
title_font = NULL,
title_font_use_google = NULL,
title_font_size = NULL,
use_showtext = NULL
) {
requires_xaringanthemer_env(css_file = css_file, try_css = TRUE)
requires_package(fn = "xaringan_theme")
background_color <- background_color %||% xaringanthemer_env$inverse_background_color
text_color <- text_color %||% xaringanthemer_env$inverse_text_color
accent_color <- accent_color %||% xaringanthemer_env$inverse_header_color
accent_secondary_color <- accent_secondary_color %||% accent_color
theme_xaringan_base(
text_color,
background_color,
accent_color = accent_color,
accent_secondary_color = accent_secondary_color,
set_ggplot_defaults = set_ggplot_defaults,
text_font = text_font,
text_font_use_google = text_font_use_google,
text_font_size = text_font_size,
title_font = title_font,
title_font_use_google = title_font_use_google,
title_font_size = title_font_size,
use_showtext = use_showtext
)
}
#' The ggplot2 xaringanthemer base plot theme
#'
#' @description
#'
#' `r lifecycle::badge("maturing")`
#'
#' Provides a base plot theme for \pkg{ggplot2} to match the \pkg{xaringan}
#' slide theme created by [xaringanthemer]. The theme is designed to create a
#' general plot style from two colors, a `background_color` and a `text_color`
#' (or foreground color). Also accepts an `accent_color` and an
#' `accent_secondary_color` that are [xaringanthemer] is not required for the
#' base theme. Use [theme_xaringan()] or [theme_xaringan_inverse()] in xaringan
#' slides styled by xaringanthemer for a plot theme that matches the slide
#' style. See `vignette("ggplot2-themes")` for more information and examples.
#'
#' @param text_color Color for text and foreground
#' @param background_color Color for background
#' @param accent_color Color for titles and accents, inherits from
#' `header_color` or `text_color`. Used for the `title` base setting in
#' [ggplot2::theme()], and additionally for setting the `color` or `fill` of
#' \pkg{ggplot2} geom defaults.
#' @param accent_secondary_color Color for secondary accents, inherits from
#' `text_bold_color` or `accent_color`. Used only when setting \pkg{ggplot2} geom
#' defaults.
#' @param set_ggplot_defaults Should defaults be set for \pkg{ggplot2} _geoms_?
#' Defaults to TRUE. To restore ggplot's defaults, or the previously set geom
#' defaults, see [theme_xaringan_restore_defaults()].
#' @param text_font Font to use for text elements, passed to
#' [sysfonts::font_add_google()], if available and `text_font_use_google` is
#' `TRUE`. Inherits from `text_font_family`. If manually specified, can be a
#' [google_font()].
#' @param text_font_use_google Is `text_font` available on [Google
#' Fonts](https://fonts.google.com)?
#' @param text_font_size Base text font size, inherits from `text_font_size`, or
#' defaults to 11.
#' @param title_font Font to use for title elements, passed to
#' [sysfonts::font_add_google()], if available and `title_font_use_google` is
#' `TRUE`. Inherits from `title_font_family`. If manually specified, can be a
#' [google_font()].
#' @param title_font_use_google Is `title_font` available on [Google
#' Fonts](https://fonts.google.com)?
#' @param title_font_size Base text font size, inherits from `title_font_size`,
#' or defaults to 14.
#' @param use_showtext If `TRUE` the \pkg{showtext} package will be
#' used to register Google fonts. Set to `FALSE` to disable this feature
#' entirely, which may result in errors during plotting if the fonts used are
#' not available locally. The default is `TRUE` when the \pkg{showtext}
#' package is installed.
#' @param ... Ignored
#'
#' @examples
#' # Requires ggplot2
#' has_ggplot2 <- requireNamespace("ggplot2", quietly = TRUE)
#'
#' if (has_ggplot2) {
#' library(ggplot2)
#'
#' plot1 <- ggplot(mpg) +
#' aes(cty, hwy) +
#' geom_point() +
#' theme_xaringan_base(
#' text_color = "#602f6b", # imperial
#' background_color = "#f8f8f8", # light gray
#' accent_color = "#317873", # myrtle green
#' title_font = "sans",
#' text_font = "serif",
#' set_ggplot_defaults = TRUE
#' ) +
#' labs(
#' title = "Fuel Efficiency of Various Cars",
#' subtitle = "+ theme_xaringan_base()",
#' caption = "xaringanthemer"
#' )
#'
#' print(plot1)
#'
#' plot2 <- ggplot(mpg) +
#' aes(hwy) +
#' geom_histogram(binwidth = 2) +
#' theme_xaringan_base(
#' text_color = "#a8a9c8", # light purple
#' background_color = "#303163", # deep slate purple
#' accent_color = "#ffff99", # canary yellow
#' title_font = "sans",
#' text_font = "serif",
#' set_ggplot_defaults = TRUE
#' ) +
#' labs(
#' title = "Highway Fuel Efficiency",
#' subtitle = "+ theme_xaringan_base()",
#' caption = "xaringanthemer"
#' )
#'
#' print(plot2)
#' }
#' @return A ggplot2 theme
#' @family xaringanthemer ggplot2 themes
#' @export
theme_xaringan_base <- function(
text_color,
background_color,
...,
set_ggplot_defaults = TRUE,
accent_color = NULL,
accent_secondary_color = NULL,
text_font = NULL,
text_font_use_google = NULL,
text_font_size = NULL,
title_font = NULL,
title_font_use_google = NULL,
title_font_size = NULL,
use_showtext = NULL
) {
text_color <- full_length_hex(text_color)
background_color <- full_length_hex(background_color)
blend <- color_blender(text_color, background_color)
text_font_size <- text_font_size %||% web_to_point(xaringanthemer_env$text_font_size, scale = 1.25) %||% 11
title_font_size <- title_font_size %||% web_to_point(xaringanthemer_env$header_h3_font_size, scale = 0.8) %||% 14
text_font_use_google <- text_font_use_google %||% is_google_font(text_font)
title_font_use_google <- title_font_use_google %||% is_google_font(title_font)
if (is.null(use_showtext)) {
use_showtext <- requires_package("showtext", "theme_xaringan", required = FALSE)
}
text_font <- if (!is.null(text_font)) {
register_font(text_font, identical(text_font_use_google, TRUE) && use_showtext)
} else {
get_theme_font("text")
}
title_font <- if (!is.null(title_font)) {
register_font(title_font, identical(title_font_use_google, TRUE) && use_showtext)
} else {
get_theme_font("header")
}
text_font <- text_font %||% "sans"
title_font <- title_font %||% "sans"
if (set_ggplot_defaults) {
accent_color <- accent_color %||% xaringanthemer_env$header_color %||% text_color
accent_secondary_color <- accent_secondary_color %||% xaringanthemer_env$text_bold_color %||% accent_color
accent_color <- full_length_hex(accent_color)
accent_secondary_color <- full_length_hex(accent_secondary_color)
theme_xaringan_set_defaults(
text_color = text_color,
background_color = background_color,
accent_color = accent_color,
accent_secondary_color = accent_secondary_color,
text_font = text_font
)
}
theme <- ggplot2::theme(
line = ggplot2::element_line(color = blend(0.2)),
rect = ggplot2::element_rect(fill = background_color),
text = ggplot2::element_text(
color = blend(0.1),
family = text_font,
size = text_font_size
),
title = ggplot2::element_text(
color = accent_color,
family = title_font,
size = title_font_size
),
plot.background = ggplot2::element_rect(
fill = background_color,
color = background_color
),
panel.background = ggplot2::element_rect(
fill = background_color,
color = background_color
),
panel.grid.major = ggplot2::element_line(
color = blend(0.8),
inherit.blank = TRUE
),
panel.grid.minor = ggplot2::element_line(
color = blend(0.9),
inherit.blank = TRUE
),
axis.title = ggplot2::element_text(size = title_font_size * 0.8),
axis.ticks = ggplot2::element_line(color = blend(0.8)),
axis.text = ggplot2::element_text(color = blend(0.4)),
legend.key = ggplot2::element_rect(fill = "transparent", colour = NA),
plot.caption = ggplot2::element_text(
size = text_font_size * 0.8,
color = blend(0.3)
)
)
if (utils::packageVersion("ggplot2") >= package_version("3.3.0")) {
theme + ggplot2::theme(plot.title.position = "plot")
} else theme
}
#' Set and Restore ggplot2 geom Defaults
#'
#' @description
#'
#' `r lifecycle::badge("maturing")`
#'
#' Set \pkg{ggplot2} _geom_ defaults to match [theme_xaringan()] with
#' `theme_xaringan_set_defaults()` and restore the standard or previously-set
#' defaults with `theme_xaringan_restore_defaults()`. By default,
#' `theme_xaringan_set_defaults()` is run with [theme_xaringan()] or
#' [theme_xaringan_inverse()].
#'
#' @family xaringanthemer ggplot2 themes
#' @param text_font Font to use for text elements, passed to
#' [sysfonts::font_add_google()], if available and `text_font_use_google` is
#' `TRUE`. Inherits from `text_font_family`. Must be a length-one character.
#' @inheritParams theme_xaringan
#' @inheritParams theme_xaringan_base
#' @return Invisibly returns a list of the current ggplot2 geom defaults
#' @export
theme_xaringan_set_defaults <- function(
text_color = NULL,
background_color = NULL,
accent_color = text_color,
accent_secondary_color = accent_color,
text_font = NULL
) {
requires_package("ggplot2")
blend <- color_blender(text_color, background_color)
xaringan_theme_defaults <- list(
"line" = list(color = text_color),
"vline" = list(color = accent_secondary_color),
"hline" = list(color = accent_secondary_color),
"abline" = list(color = accent_secondary_color),
"segment" = list(color = text_color),
"bar" = list(fill = accent_color),
"col" = list(fill = accent_color),
"boxplot" = list(color = text_color),
"contour" = list(color = text_color),
"density" = list(color = text_color,
fill = text_color,
alpha = 0.1),
"dotplot" = list(color = accent_color),
"errorbarh" = list(color = text_color),
"crossbar" = list(color = text_color),
"errorbar" = list(color = text_color),
"linerange" = list(color = text_color),
"pointrange" = list(color = text_color),
"map" = list(color = text_color),
"path" = list(color = text_color),
"line" = list(color = text_color),
"step" = list(color = text_color),
"point" = list(color = accent_color),
"polygon" = list(color = accent_color,
fill = accent_color),
"quantile" = list(color = text_color),
"rug" = list(color = blend(0.5)),
"segment" = list(color = text_color),
"smooth" = list(fill = blend(0.75),
color = accent_secondary_color),
"spoke" = list(color = text_color),
"label" = list(color = text_color,
family= text_font %||% get_theme_font("text")),
"text" = list(color = text_color,
family= text_font %||% get_theme_font("text")),
"rect" = list(fill = text_color),
"tile" = list(fill = text_color),
"violin" = list(fill = text_color),
"sf" = list(color = text_color)
)
geom_names <- purrr::set_names(names(xaringan_theme_defaults))
previous_defaults <- lapply(
geom_names,
function(geom) safely_set_geom(geom, xaringan_theme_defaults[[geom]])
)
if (is.null(xaringanthemer_env$old_ggplot_defaults)) {
xaringanthemer_env$old_ggplot_defaults <- previous_defaults
}
invisible(previous_defaults)
}
#' @describeIn theme_xaringan_set_defaults Restore previous or standard
#' \pkg{ggplot2} _geom_ defaults.
#' @return Invisibly returns a list of the current ggplot2 geom defaults
#' @export
theme_xaringan_restore_defaults <- function() {
requires_package("ggplot2")
requires_xaringanthemer_env(try_css = FALSE, requires_theme = FALSE)
if (is.null(xaringanthemer_env$old_ggplot_defaults)) {
return(invisible())
}
old_default <- xaringanthemer_env$old_ggplot_defaults
old_default_not_std <- vapply(old_default, function(x) length(x) > 0, logical(1))
old_default <- old_default[old_default_not_std]
restore_default <- utils::modifyList(xaringanthemer_env$std_ggplot_defaults, old_default)
geom_names <- purrr::set_names(names(restore_default))
previous_defaults <- lapply(
geom_names,
function(geom) safely_set_geom(geom, restore_default[[geom]])
)
invisible(previous_defaults)
}
safely_set_geom <- function(geom, new) {
warn <- function(x) {
warning(x$message, call. = TRUE, immediate. = TRUE)
invisible()
}
tryCatch(
{
ggplot2::update_geom_defaults(geom, new)
},
error = warn,
warning = warn
)
}
# Color Scales ------------------------------------------------------------
#' Themed ggplot2 Scales
#'
#' @description
#'
#' `r lifecycle::badge("maturing")`
#'
#' Color and fill single-color scales for discrete and continuous values,
#' created using the primary accent color of the xaringanthemer styles. See
#' `vignette("ggplot2-themes")` for more information and examples of
#' \pkg{xaringanthemer}'s \pkg{ggplot2}-related functions.
#'
#' @param ... Arguments passed on to either the \pkg{colorspace} scale
#' functions — one of [colorspace::scale_color_discrete_sequential()],
#' [colorspace::scale_color_continuous_sequential()],
#' [colorspace::scale_fill_discrete_sequential()], or
#' [colorspace::scale_fill_continuous_sequential()] — or to
#' [ggplot2::continuous_scale] or [ggplot2::discrete_scale].
#' @param color A color value, in hex, to override the default color. Otherwise,
#' the primary color of the resulting scale is chosen from the xaringanthemer
#' slide styles.
#' @param inverse If `color` is not supplied and `inverse = TRUE`, a primary
#' color is chosen to work well with the inverse slide styles, namely the
#' value of `inverse_header_color`
#' @param direction Direction of the discrete scale. Use values less than 0 to
#' reverse the direction, e.g. `direction = -1`.
#' @inheritParams colorspace::scale_color_continuous_sequential
#' @param aes_type The type of aesthetic to which the scale is being applied.
#' One of "color", "colour", or "fill".
#'
#'
#' @examples
#' # Requires ggplot2
#' has_ggplot2 <- requireNamespace("ggplot2", quietly = TRUE)
#'
#' if (has_ggplot2) {
#' library(ggplot2)
#' # Saving the theme to a temp file because this is an example
#' path_to_css_file <- tempfile(fileext = ".css")
#'
#' # Create the xaringan theme: dark blue background with teal green accents
#' style_duo(
#' primary_color = "#002b36",
#' secondary_color = "#31b09e",
#' # Using basic fonts for this example, but the plot theme will
#' # automatically use your theme font if you use Google fonts
#' text_font_family = "sans",
#' header_font_family = "serif",
#' outfile = path_to_css_file
#' )
#'
#' # Here's some very basic example data
#' ex <- data.frame(
#' name = c("Couple", "Few", "Lots", "Many"),
#' n = c(2, 3, 5, 7)
#' )
#'
#' # Fill color scales demo
#' ggplot(ex) +
#' aes(name, n, fill = n) +
#' geom_col() +
#' ggtitle("Matching fill scales") +
#' # themed to match the slides: dark blue background with teal text
#' theme_xaringan() +
#' # Fill color matches teal text
#' scale_xaringan_fill_continuous()
#'
#' # Color scales demo
#' ggplot(ex) +
#' aes(name, y = 1, color = name) +
#' geom_point(size = 10) +
#' ggtitle("Matching color scales") +
#' # themed to match the slides: dark blue background with teal text
#' theme_xaringan() +
#' # Fill color matches teal text
#' scale_xaringan_color_discrete(direction = -1)
#' }
#' @name scale_xaringan
NULL
#' @rdname scale_xaringan
#' @export
scale_xaringan_discrete <- function(
aes_type = c("color", "colour", "fill"),
...,
color = NULL,
direction = 1,
inverse = FALSE,
na.value = "grey50"
) {
requires_package("ggplot2", "scale_xaringan_discrete")
aes_type <- match.arg(aes_type)
color <- hex2HCL(get_theme_accent_color(color, inverse))
pal <- function(n) {
colors <- colorspace::sequential_hcl(
n = n,
c1 = color[1, "C"],
l1 = color[1, "L"],
h1 = color[1, "H"],
rev = direction >= 1
)
}
ggplot2::discrete_scale(aes_type, "manual", pal, ..., na.value = na.value)
}
#' @rdname scale_xaringan
#' @export
scale_xaringan_fill_discrete <- function(
...,
color = NULL,
direction = 1,
inverse = FALSE
) {
scale_xaringan_discrete(
"fill",
...,
color = color,
direction = direction,
inverse = inverse
)
}
#' @rdname scale_xaringan
#' @export
scale_xaringan_color_discrete <- function(
...,
color = NULL,
direction = 1,
inverse = FALSE
) {
scale_xaringan_discrete(
"color",
...,
color = color,
direction = direction,
inverse = inverse
)
}
#' @rdname scale_xaringan
#' @export
scale_xaringan_colour_discrete <- scale_xaringan_color_discrete
#' @rdname scale_xaringan
#' @export
scale_xaringan_continuous <- function(
aes_type = c("color", "colour", "fill"),
...,
color = NULL,
begin = 0,
end = 1,
inverse = FALSE,
na.value = "grey50"
) {
requires_package("ggplot2", "scale_xaringan_continuous")
requires_package("scales", "scale_xaringan_continuous")
aes_type <- match.arg(aes_type)
color <- hex2HCL(get_theme_accent_color(color, inverse))
colors <- suppressWarnings(colorspace::sequential_hcl(
n = 12,
c1 = color[1, "C"],
l1 = color[1, "L"],
h1 = color[1, "H"],
rev = TRUE
))
rescaler <- function(x, ...) {
scales::rescale(x, to = c(begin, end), from = range(x, na.rm = TRUE))
}
ggplot2::continuous_scale(
aes_type,
"continuous_sequential",
palette = scales::gradient_n_pal(colors, values = NULL),
rescaler = rescaler,
oob = scales::censor,
na.value = na.value,
...
)
}
#' @rdname scale_xaringan
#' @export
scale_xaringan_fill_continuous <- function(
...,
color = NULL,
begin = 0,
end = 1,
inverse = FALSE
) {
scale_xaringan_continuous(
"fill",
...,
color = color,
begin = begin,
end = end,
inverse = inverse
)
}
#' @rdname scale_xaringan
#' @export
scale_xaringan_color_continuous <- function(
...,
color = NULL,
begin = 0,
end = 1,
inverse = FALSE
) {
scale_xaringan_continuous(
"color",
...,
color = color,
begin = begin,
end = end,
inverse = inverse
)
}
#' @rdname scale_xaringan
#' @export
scale_xaringan_colour_continuous <- scale_xaringan_color_continuous
get_theme_accent_color <- function(color = NULL, inverse = FALSE) {
color <-
if (!inverse) {
color %||%
xaringanthemer_env[["header_color"]] %||%
xaringanthemer_env[["text_color"]]
} else {
color %||% xaringanthemer_env[["inverse_header_color"]]
}
if (is.null(color)) {
stop(
call. = FALSE,
"No color provided and no default available. ",
"Have you forgotten to use a style function to set the xaringan theme?"
)
}
color
}
blend_colors <- function(x, y, alpha = 0.5) {
x <- colorspace::hex2RGB(x)
y <- colorspace::hex2RGB(y)
z <- colorspace::mixcolor(alpha, x, y)
colorspace::hex(z)
}
color_blender <- function(x, y) function(alpha = 0.5) blend_colors(x, y, alpha)
hex2HCL <- function(x) {
colorspace::coords(methods::as(colorspace::hex2RGB(x), "polarLUV"))
}
# Fonts -------------------------------------------------------------------
get_theme_font <- function(element = c("text", "header", "code"), use_showtext = TRUE) {
element <- match.arg(element)
element_family <- paste0(element, "_font_family")
element_google <- paste0(element, "_font_google")
element_is_google <- paste0(element, "_font_is_google")
element_url <- paste0(element, "_font_url")
family <- xaringanthemer_env[[element_family]]
is_google_font <- xaringanthemer_env[[element_is_google]]
if (is.null(is_google_font)) {
is_google_font <- !is.null(xaringanthemer_env[[element_google]]) ||
grepl("fonts.google", xaringanthemer_env[[element_url]], fixed = TRUE)
}
register_font(
family,
google = is_google_font,
fn = sys.calls()[[max(1, sys.nframe() - 1)]][[1]],
use_showtext = use_showtext
)
}
register_font <- function(
family,
google = TRUE,
fn = sys.calls()[[max(1, sys.nframe() - 1)]][[1]],
...,
use_showtext = TRUE
) {
if (is.null(family) || !use_showtext) {
return(NULL)
}
if (is_google_font(family)) family <- family$family
family <- gsub("['\"]", "", family)
if (!identical(xaringanthemer_env$showtext_auto, TRUE)) {
if (!requires_package(pkg = "showtext", fn, required = FALSE)) {
return(family)
}
showtext::showtext_auto()
xaringanthemer_env$showtext_auto <- TRUE
}
if (family %in% xaringanthemer_env[["registered_font_families"]] %||% "") {
return(family)
}
if (!requires_package(pkg = "sysfonts", fn, required = FALSE)) {
return(family)
} else if (family == "Droid Serif") {
dstmp <- download_tmp_droid_serif()
if (!is.null(dstmp)) {
sysfonts::font_add(
family = "Droid Serif",
regular = dstmp
)
}
} else if (!family %in% sysfonts::font_families()) {
is_default_font <- family %in% c(
"Roboto",
"Source Code Pro",
"Yanone Kaffeesatz"
)
font_found <- family %in% sysfonts::font_families()
is_google_font <- identical(google, TRUE) || (missing(google) && is_default_font)
if (is_google_font) {
tryCatch(
{
sysfonts::font_add_google(family, ...)
font_found <- TRUE
},
error = function(e) {},
warning = function(w) {}
)
}
if (!font_found) { # warn user if font still not found
msg <- if (is_google_font) glue::glue(
"Font '{family}' not found in Google Fonts. ",
"Please manually register the font using `sysfonts::font_add()`."
) else {
glue::glue(
"Font '{family}' must be manually registered using `sysfonts::font_add()`."
)
}
warning(str_wrap(msg), call. = FALSE)
} else {
verify_fig_showtext(fn)
}
}
xaringanthemer_env[["registered_font_families"]] <- c(
xaringanthemer_env[["registered_font_families"]],
family
)
family
}
download_tmp_droid_serif <- function() {
if (isTRUE(xaringanthemer_env[["declined_droid_serif"]])) return(NULL)
message(
"Using 'Droid Serif' in `theme_xaringan()` requires downloading the font from Google Fonts into a temporary file. "
)
ok_to_download <- utils::askYesNo("Do you want to try to download this font now?")
if (identical(ok_to_download, FALSE)) {
xaringanthemer_env[["declined_droid_serif"]] <- TRUE
}
if (!isTRUE(ok_to_download)) {
return(NULL)
}
dstmp <- tempfile("droid-serif", fileext = "ttf")
utils::download.file(
"https://github.com/google/fonts/raw/feb15862e0c66ec0e7531ca4c3ef2607071ea700/apache/droidserif/DroidSerif-Regular.ttf",
dstmp,
quiet = TRUE
)
dstmp
}
verify_fig_showtext <- function(fn = "theme_xaringan_base") {
if (is.null(knitr::current_input())) return()
# Try to set fig.showtext automatically
if (isTRUE(knitr::opts_current$get("fig.showtext"))) {
return()
}
stop(str_wrap(
"To use ", fn, "() with knitr, you need to set the chunk option ",
"`fig.showtext = TRUE` for this chunk. Or you can set this option ",
"globally with `knitr::opts_chunk$set(fig.showtext = TRUE)`."
))
}
set_fig_showtext <- function() {
if (!requireNamespace("showtext", quietly = TRUE)) {
return(invisible())
}
curr_fst_chunk <- knitr::opts_current$get("fig.showtext")
curr_fst <- curr_fst_chunk %||% knitr::opts_chunk$get("fig.showtext")
if (!is.null(curr_fst) && identical(curr_fst, FALSE)) {
return(invisible())
}
knitr::opts_chunk$set(fig.showtext = TRUE)
}
requires_xaringanthemer_env <- function(
css_file = NULL,
try_css = TRUE,
requires_theme = TRUE
) {
reload <- !is.null(css_file) && isTRUE(try_css)
pkg_env_exists <- exists("xaringanthemer_env")
missing_theme <- requires_theme && pkg_env_exists && is.null(xaringanthemer_env$header_color)
if (reload || !pkg_env_exists || missing_theme) {
if (try_css) {
css_vars <- read_css_vars(css_file)
for (css_var in names(css_vars)) {
xaringanthemer_env[[css_var]] <- css_vars[[css_var]]
}
return(requires_xaringanthemer_env(try_css = FALSE))
} else {
stop("Please call a xaringanthemer theme function first.")
}
}
}
#' Get the Value of xaringanthemer Style Setting
#'
#' A helper function to retrieve the value of style settings as set by a
#' xaringanthemer style function, for use in plotting and other circumstances.
#'
#' @section Style Settings:
#' Style settings used by xaringanthemer include:
#'
#' - `background_color`
#' - `background_image`
#' - `background_position`
#' - `background_size`
#' - `blockquote_left_border_color`
#' - `code_font_family`
#' - `code_font_family_fallback`
#' - `code_font_google`
#' - `code_font_is_google`
#' - `code_font_size`
#' - `code_font_url`
#' - `code_highlight_color`
#' - `code_inline_background_color`
#' - `code_inline_color`
#' - `code_inline_font_size`
#' - `extra_css`
#' - `extra_fonts`
#' - `footnote_color`
#' - `footnote_font_size`
#' - `footnote_position_bottom`
#' - `header_background_auto`
#' - `header_background_color`
#' - `header_background_content_padding_top`
#' - `header_background_ignore_classes`
#' - `header_background_padding`
#' - `header_background_text_color`
#' - `header_color`
#' - `header_font_family`
#' - `header_font_google`
#' - `header_font_is_google`
#' - `header_font_url`
#' - `header_font_weight`
#' - `header_h1_font_size`
#' - `header_h2_font_size`
#' - `header_h3_font_size`
#' - `inverse_background_color`
#' - `inverse_header_color`
#' - `inverse_text_color`
#' - `inverse_text_shadow`
#' - `left_column_selected_color`
#' - `left_column_subtle_color`
#' - `link_color`
#' - `padding`
#' - `table_border_color`
#' - `table_row_border_color`
#' - `table_row_even_background_color`
#' - `text_bold_color`
#' - `text_color`
#' - `text_font_base`
#' - `text_font_family`
#' - `text_font_family_fallback`
#' - `text_font_google`
#' - `text_font_is_google`
#' - `text_font_size`
#' - `text_font_url`
#' - `text_font_weight`
#' - `text_slide_number_color`
#' - `text_slide_number_font_size`
#' - `title_slide_background_color`
#' - `title_slide_background_image`
#' - `title_slide_background_position`
#' - `title_slide_background_size`
#' - `title_slide_text_color`
#'
#' @param setting A xaringanthemer style setting
#' @inheritParams theme_xaringan
#' @examples
#' # Create a xaringanthemer style in a temporary file for this example
#' xaringan_themer_css <- tempfile("xaringan-themer", fileext = ".css")
#'
#' style_solarized_light(outfile = xaringan_themer_css)
#'
#' theme_xaringan_get_value("text_color")
#' theme_xaringan_get_value("background_color")
#' theme_xaringan_get_value("header_color")
#' theme_xaringan_get_value("text_bold_color")
#' @return The value of the xaringanthemer style parameter.
#' @export
theme_xaringan_get_value <- function(setting, css_file = NULL) {
requires_xaringanthemer_env(css_file = css_file)
if (length(setting) > 1) {
ret <- list()
for (var in setting) {
ret[[var]] <- xaringanthemer_env[[var]]
}
return(ret)
}
xaringanthemer_env[[setting]]
}
web_to_point <- function(x, px_per_em = NULL, scale = 0.75) {
if (is.null(x)) {
return(NULL)
}
px_per_em <- px_per_em %||% get_base_font_size()
if (grepl("pt$", x)) {
return(as.numeric(sub("pt$", "", x)))
} else if (grepl("px$", x)) {
x <- as.numeric(sub("px$", "", x))
return(x * scale)
} else if (grepl("r?em$", x)) {
x <- as.numeric(sub("r?em$", "", x))
return(x * px_per_em * scale)
} else {
return()
}
}
get_base_font_size <- function() {
base_size <- xaringanthemer_env[["base_font_size"]] %||%
xaringanthemer_env[["text_font_size"]]
if (!grepl("px", base_size)) {
# assume 16px base font size
16
} else {
as.numeric(sub("px", "", base_size))
}
}
================================================
FILE: R/style_duo.R
================================================
# Generated by inst/scripts/generate_theme_functions.R: do not edit by hand
#' @param primary_color Duotone Primary Color. Defaults to #1F4257. Used in
#' multiple CSS rules. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--primary)` in any argument of a
#' style function or in custom CSS.
#' @param secondary_color Duotone Secondary Color. Defaults to #F97B64. Used in
#' multiple CSS rules. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--secondary)` in any argument of
#' a style function or in custom CSS.
#' @param text_color Text Color. Defaults to
#' `choose_dark_or_light(primary_color, darken_color(primary_color, 0.9), lighten_color(secondary_color, 0.99))`.
#' Modifies the `body` element. The value of this variable is also stored as
#' a CSS variable that can be referenced with `var(--text_color)` in any
#' argument of a style function or in custom CSS.
#' @param header_color Header Color. Defaults to `secondary_color`. Modifies
#' the `h1, h2, h3` elements. The value of this variable is also stored as a
#' CSS variable that can be referenced with `var(--header-color)` in any
#' argument of a style function or in custom CSS.
#' @param background_color Slide Background Color. Defaults to `primary_color`.
#' Modifies the `.remark-slide-content` class. The value of this variable is
#' also stored as a CSS variable that can be referenced with
#' `var(--background-color)` in any argument of a style function or in custom
#' CSS.
#' @param link_color Link Color. Defaults to `secondary_color`. Modifies the
#' `a, a > code` elements. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--link-color)` in any argument
#' of a style function or in custom CSS.
#' @param text_bold_color Bold Text Color. Defaults to `secondary_color`.
#' Modifies the `strong` element. The value of this variable is also stored
#' as a CSS variable that can be referenced with `var(--text-bold-color)` in
#' any argument of a style function or in custom CSS.
#' @param text_slide_number_color Slide Number Color. Defaults to `text_color`.
#' Modifies the `.remark-slide-number` class.
#' @param padding Slide Padding in `top right [bottom left]` format. Defaults
#' to 16px 64px 16px 64px. Modifies the `.remark-slide-content` class.
#' Accepts CSS
#' [padding](https://developer.mozilla.org/en-US/docs/Web/CSS/padding)
#' property values.
#' @param background_image Background image applied to each *and every* slide.
#' Set `title_slide_background_image = "none"` to remove the background image
#' from the title slide. Defaults to `NULL`. Modifies the
#' `.remark-slide-content` class.
#' @param background_size Background image size, requires `background_image` to
#' be set. If `background_image` is set, `background_size` will default to
#' `cover` so the background fills the screen. If both `background_image` and
#' `background_position` are set, will default to 100 percent. Defaults to
#' `NULL`. Modifies the `.remark-slide-content` class. Accepts CSS
#' [background-size](https://developer.mozilla.org/en-US/docs/Web/CSS/background-size)
#' property values.
#' @param background_position Background image position, requires
#' `background_image` to be set, and it is recommended to adjust
#' `background_size`. Defaults to `NULL`. Modifies the
#' `.remark-slide-content` class. Accepts CSS
#' [background-position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position)
#' property values.
#' @param code_highlight_color Code Line Highlight. Defaults to
#' rgba(255,255,0,0.5). Modifies the `.remark-code-line-highlighted` class.
#' The value of this variable is also stored as a CSS variable that can be
#' referenced with `var(--code-highlight-color)` in any argument of a style
#' function or in custom CSS.
#' @param code_inline_color Inline Code Color. Defaults to `secondary_color`.
#' Modifies the `.remark-inline-code` class.
#' @param code_inline_background_color Inline Code Background Color. Defaults
#' to `NULL`. Modifies the `.remark-inline-code` class.
#' @param code_inline_font_size Inline Code Text Font Size. Defaults to 1em.
#' Modifies the `.remark-inline-code` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--code-inline-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param inverse_background_color Inverse Background Color. Defaults to
#' `secondary_color`. Modifies the `.inverse` class. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--inverse-background-color)` in any argument of a style function or
#' in custom CSS.
#' @param inverse_text_color Inverse Text Color. Defaults to `primary_color`.
#' Modifies the `.inverse` class. The value of this variable is also stored
#' as a CSS variable that can be referenced with `var(--inverse-text-color)`
#' in any argument of a style function or in custom CSS.
#' @param inverse_text_shadow Enables Shadow on text of inverse slides.
#' Defaults to `FALSE`. Modifies the `.inverse` class.
#' @param inverse_header_color Inverse Header Color. Defaults to
#' `inverse_text_color`. Modifies the `.inverse h1, .inverse h2, .inverse h3`
#' classes. The value of this variable is also stored as a CSS variable that
#' can be referenced with `var(--inverse-header-color)` in any argument of a
#' style function or in custom CSS.
#' @param inverse_link_color Inverse Link Color. Defaults to `link_color`.
#' Modifies the `.inverse a, .inverse a > code` classes. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--inverse-link-color)` in any argument of a style function or in
#' custom CSS.
#' @param title_slide_text_color Title Slide Text Color. Defaults to
#' `secondary_color`. Modifies the `.title-slide` class. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--title-slide-text-color)` in any argument of a style function or in
#' custom CSS.
#' @param title_slide_background_color Title Slide Background Color. Defaults
#' to `primary_color`. Modifies the `.title-slide` class. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--title-slide-background-color)` in any argument of a style function
#' or in custom CSS.
#' @param title_slide_background_image Title Slide Background Image URL.
#' Defaults to `NULL`. Modifies the `.title-slide` class.
#' @param title_slide_background_size Title Slide Background Image Size,
#' defaults to "cover" if background image is set. Defaults to `NULL`.
#' Modifies the `.title-slide` class. Accepts CSS
#' [background-size](https://developer.mozilla.org/en-US/docs/Web/CSS/background-size)
#' property values.
#' @param title_slide_background_position Title Slide Background Image
#' Position. Defaults to `NULL`. Modifies the `.title-slide` class. Accepts
#' CSS
#' [background-position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position)
#' property values.
#' @param footnote_color Footnote text color (if `NA`, then it will be the same
#' color as `text_color`). Defaults to `NULL`. Modifies the `.footnote`
#' class.
#' @param footnote_font_size Footnote font size. Defaults to 0.9em. Modifies
#' the `.footnote` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values.
#' @param footnote_position_bottom Footnote location from bottom of screen.
#' Defaults to 60px. Modifies the `.footnote` class. Accepts CSS
#' [position](https://developer.mozilla.org/en-US/docs/Web/CSS/position_value)
#' property values.
#' @param left_column_subtle_color Left Column Text (not last). Defaults to
#' `apply_alpha(secondary_color, 0.6)`. Modifies the
#' `.left-column h2, .left-column h3` classes.
#' @param left_column_selected_color Left Column Current Selection. Defaults to
#' `secondary_color`. Modifies the
#' `.left-column h2:last-of-type, .left-column h3:last-child` classes.
#' @param blockquote_left_border_color Blockquote Left Border Color. Defaults
#' to `apply_alpha(secondary_color, 0.5)`. Modifies the `blockquote` element.
#' @param table_border_color Table top/bottom border. Defaults to #666.
#' Modifies the `table: border-top, border-bottom` elements.
#' @param table_row_border_color Table row inner bottom border. Defaults to
#' #ddd. Modifies the `table thead th: border-bottom` elements.
#' @param table_row_even_background_color Table Even Row Background Color.
#' Defaults to `lighten_color(primary_color, 0.9)`. Modifies the
#' `thead, tfoot, tr:nth-child(even)` elements.
#' @param base_font_size Base Font Size for All Slide Elements (must be `px`).
#' Defaults to 20px. Modifies the `html` element. The value of this variable
#' is also stored as a CSS variable that can be referenced with
#' `var(--base-font-size)` in any argument of a style function or in custom
#' CSS.
#' @param text_font_size Slide Body Text Font Size. Defaults to 1rem. Modifies
#' the `.remark-slide-content` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--text-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_h1_font_size h1 Header Text Font Size. Defaults to 2.75rem.
#' Modifies the `.remark-slide-content h1` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-h1-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_h2_font_size h2 Header Text Font Size. Defaults to 2.25rem.
#' Modifies the `.remark-slide-content h2` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-h2-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_h3_font_size h3 Header Text Font Size. Defaults to 1.75rem.
#' Modifies the `.remark-slide-content h3` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-h3-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_background_auto Add background under slide title automatically
#' for h1 header elements. If not enabled, use `class: header_background` to
#' enable. Defaults to `FALSE`.
#' @param header_background_color Background Color for h1 Header with
#' Background. Defaults to `header_color`. Modifies the
#' `.remark-slide-content h1` class. The value of this variable is also
#' stored as a CSS variable that can be referenced with
#' `var(--header-background-color)` in any argument of a style function or in
#' custom CSS.
#' @param header_background_text_color Text Color for h1 Header with
#' Background. Defaults to `background_color`. Modifies the
#' `.remark-slide-content h1` class. The value of this variable is also
#' stored as a CSS variable that can be referenced with
#' `var(--header-background-text-color)` in any argument of a style function
#' or in custom CSS.
#' @param header_background_padding Padding for h1 Header with Background.
#' Defaults to `NULL`. Modifies the `.remark-slide-content h1` class. Accepts
#' CSS [padding](https://developer.mozilla.org/en-US/docs/Web/CSS/padding)
#' property values.
#' @param header_background_content_padding_top Top Padding for Content in
#' Slide with Header with Background. Defaults to 7rem. Modifies the
#' `.remark-slide-content` class.
#' @param header_background_ignore_classes Slide Classes Where Header with
#' Background will not be Applied. Defaults to
#' `c('normal', 'inverse', 'title', 'middle', 'bottom')`. Modifies the
#' `.remark-slide-content` class.
#' @param text_slide_number_font_size Slide Number Text Font Size. Defaults to
#' 0.9rem. Modifies the `.remark-slide-number` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values.
#' @param text_font_google Use `google_font()` to specify body font. Defaults
#' to `NULL`. Modifies the `body` element.
#' @param text_font_family Body Text Font Family (xaringan default is
#' `'Droid Serif'`). Defaults to
#' `xaringanthemer_font_default("text_font_family")`. Modifies the `body`
#' element. The value of this variable is also stored as a CSS variable that
#' can be referenced with `var(--text-font-family)` in any argument of a
#' style function or in custom CSS.
#' @param text_font_weight Body Text Font Weight. Defaults to
#' `xaringanthemer_font_default("text_font_weight")`. Modifies the `body`
#' element. Accepts CSS
#' [font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight)
#' property values.
#' @param text_bold_font_weight Body Bold Text Font Weight. Defaults to bold.
#' Modifies the `strong` element.
#' @param text_font_url Body Text Font URL(s). Defaults to
#' `xaringanthemer_font_default("text_font_url")`. Modifies the
#' `@import url()` elements.
#' @param text_font_family_fallback Body Text Font Fallbacks. Defaults to
#' `xaringanthemer_font_default("text_font_family_fallback")`. Modifies the
#' `body` element. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--text-font-family-fallback)` in
#' any argument of a style function or in custom CSS.
#' @param text_font_base Body Text Base Font (Total Failure Fallback). Defaults
#' to sans-serif. Modifies the `body` element. The value of this variable is
#' also stored as a CSS variable that can be referenced with
#' `var(--text-font-base)` in any argument of a style function or in custom
#' CSS.
#' @param header_font_google Use `google_font()` to specify header font.
#' Defaults to `NULL`. Modifies the `body` element.
#' @param header_font_family Header Font Family (xaringan default is
#' `'Yanone Kaffeesatz'`). Defaults to
#' `xaringanthemer_font_default("header_font_family")`. Modifies the
#' `h1, h2, h3` elements. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-font-family)` in any
#' argument of a style function or in custom CSS.
#' @param header_font_weight Header Font Weight. Defaults to
#' `xaringanthemer_font_default("header_font_weight")`. Modifies the
#' `h1, h2, h3` elements. Accepts CSS
#' [font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight)
#' property values.
#' @param header_font_family_fallback Header Font Family Fallback. Defaults to
#' Georgia, serif. Modifies the `h1, h2, h3` elements. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--header-font-family-fallback)` in any argument of a style function
#' or in custom CSS.
#' @param header_font_url Header Font URL. Defaults to
#' `xaringanthemer_font_default("header_font_url")`. Modifies the
#' `@import url` elements.
#' @param code_font_google Use `google_font()` to specify code font. Defaults
#' to `NULL`. Modifies the `body` element.
#' @param code_font_family Code Font Family. Defaults to
#' `xaringanthemer_font_default("code_font_family")`. Modifies the
#' `.remark-code, .remark-inline-code` classes. The value of this variable is
#' also stored as a CSS variable that can be referenced with
#' `var(--code-font-family)` in any argument of a style function or in custom
#' CSS.
#' @param code_font_size Code Text Font Size. Defaults to 0.9rem. Modifies the
#' `.remark-inline` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--code-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param code_font_url Code Font URL. Defaults to
#' `xaringanthemer_font_default("code_font_url")`. Modifies the `@import url`
#' elements.
#' @param code_font_family_fallback Code Font Fallback. Defaults to
#' `xaringanthemer_font_default("code_font_family_fallback")`. Modifies the
#' `.remark-code, .remark-inline-code` classes.
#' @param link_decoration Text decoration of links. Defaults to none. Modifies
#' the `a, a > code` elements. Accepts CSS
#' [text-decoration](https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration)
#' property values.
#' @template theme_params
#' @template style-usage
#' @template style_duo
#' @family Duotone themes
#' @export
style_duo <- function(
primary_color = "#1F4257",
secondary_color = "#F97B64",
text_color = choose_dark_or_light(primary_color, darken_color(primary_color, 0.9), lighten_color(secondary_color, 0.99)),
header_color = secondary_color,
background_color = primary_color,
link_color = secondary_color,
text_bold_color = secondary_color,
text_slide_number_color = text_color,
padding = "16px 64px 16px 64px",
background_image = NULL,
background_size = NULL,
background_position = NULL,
code_highlight_color = "rgba(255,255,0,0.5)",
code_inline_color = secondary_color,
code_inline_background_color = NULL,
code_inline_font_size = "1em",
inverse_background_color = secondary_color,
inverse_text_color = primary_color,
inverse_text_shadow = FALSE,
inverse_header_color = inverse_text_color,
inverse_link_color = link_color,
title_slide_text_color = secondary_color,
title_slide_background_color = primary_color,
title_slide_background_image = NULL,
title_slide_background_size = NULL,
title_slide_background_position = NULL,
footnote_color = NULL,
footnote_font_size = "0.9em",
footnote_position_bottom = "60px",
left_column_subtle_color = apply_alpha(secondary_color, 0.6),
left_column_selected_color = secondary_color,
blockquote_left_border_color = apply_alpha(secondary_color, 0.5),
table_border_color = "#666",
table_row_border_color = "#ddd",
table_row_even_background_color = lighten_color(primary_color, 0.9),
base_font_size = "20px",
text_font_size = "1rem",
header_h1_font_size = "2.75rem",
header_h2_font_size = "2.25rem",
header_h3_font_size = "1.75rem",
header_background_auto = FALSE,
header_background_color = header_color,
header_background_text_color = background_color,
header_background_padding = NULL,
header_background_content_padding_top = "7rem",
header_background_ignore_classes = c('normal', 'inverse', 'title', 'middle', 'bottom'),
text_slide_number_font_size = "0.9rem",
text_font_google = NULL,
text_font_family = xaringanthemer_font_default("text_font_family"),
text_font_weight = xaringanthemer_font_default("text_font_weight"),
text_bold_font_weight = "bold",
text_font_url = xaringanthemer_font_default("text_font_url"),
text_font_family_fallback = xaringanthemer_font_default("text_font_family_fallback"),
text_font_base = "sans-serif",
header_font_google = NULL,
header_font_family = xaringanthemer_font_default("header_font_family"),
header_font_weight = xaringanthemer_font_default("header_font_weight"),
header_font_family_fallback = "Georgia, serif",
header_font_url = xaringanthemer_font_default("header_font_url"),
code_font_google = NULL,
code_font_family = xaringanthemer_font_default("code_font_family"),
code_font_size = "0.9rem",
code_font_url = xaringanthemer_font_default("code_font_url"),
code_font_family_fallback = xaringanthemer_font_default("code_font_family_fallback"),
link_decoration = "none",
colors = NULL,
extra_css = NULL,
extra_fonts = NULL,
outfile = "xaringan-themer.css"
) {
# DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R
primary_color <- unname(primary_color)
secondary_color <- unname(secondary_color)
colors <- c(primary = primary_color, secondary = secondary_color, colors)
eval(parse(text = call_style_xaringan()))
}
================================================
FILE: R/style_duo_accent.R
================================================
# Generated by inst/scripts/generate_theme_functions.R: do not edit by hand
#' @param primary_color Duotone Primary Color. Defaults to #035AA6. Used in
#' multiple CSS rules. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--primary)` in any argument of a
#' style function or in custom CSS.
#' @param secondary_color Duotone Secondary Color. Defaults to #03A696. Used in
#' multiple CSS rules. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--secondary)` in any argument of
#' a style function or in custom CSS.
#' @param white_color Brightest color used. Defaults to #FFFFFF. Used in
#' multiple CSS rules. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--white)` in any argument of a
#' style function or in custom CSS.
#' @param black_color Darkest color used. Defaults to #000000. Used in multiple
#' CSS rules. The value of this variable is also stored as a CSS variable
#' that can be referenced with `var(--black)` in any argument of a style
#' function or in custom CSS.
#' @param text_color Text Color. Defaults to `black_color`. Modifies the `body`
#' element. The value of this variable is also stored as a CSS variable that
#' can be referenced with `var(--text_color)` in any argument of a style
#' function or in custom CSS.
#' @param header_color Header Color. Defaults to `primary_color`. Modifies the
#' `h1, h2, h3` elements. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-color)` in any argument
#' of a style function or in custom CSS.
#' @param background_color Slide Background Color. Defaults to `white_color`.
#' Modifies the `.remark-slide-content` class. The value of this variable is
#' also stored as a CSS variable that can be referenced with
#' `var(--background-color)` in any argument of a style function or in custom
#' CSS.
#' @param link_color Link Color. Defaults to
#' `choose_dark_or_light(secondary_color, primary_color, secondary_color)`.
#' Modifies the `a, a > code` elements. The value of this variable is also
#' stored as a CSS variable that can be referenced with `var(--link-color)`
#' in any argument of a style function or in custom CSS.
#' @param text_bold_color Bold Text Color. Defaults to
#' `choose_dark_or_light(secondary_color, primary_color, secondary_color)`.
#' Modifies the `strong` element. The value of this variable is also stored
#' as a CSS variable that can be referenced with `var(--text-bold-color)` in
#' any argument of a style function or in custom CSS.
#' @param text_slide_number_color Slide Number Color. Defaults to
#' `primary_color`. Modifies the `.remark-slide-number` class.
#' @param padding Slide Padding in `top right [bottom left]` format. Defaults
#' to 16px 64px 16px 64px. Modifies the `.remark-slide-content` class.
#' Accepts CSS
#' [padding](https://developer.mozilla.org/en-US/docs/Web/CSS/padding)
#' property values.
#' @param background_image Background image applied to each *and every* slide.
#' Set `title_slide_background_image = "none"` to remove the background image
#' from the title slide. Defaults to `NULL`. Modifies the
#' `.remark-slide-content` class.
#' @param background_size Background image size, requires `background_image` to
#' be set. If `background_image` is set, `background_size` will default to
#' `cover` so the background fills the screen. If both `background_image` and
#' `background_position` are set, will default to 100 percent. Defaults to
#' `NULL`. Modifies the `.remark-slide-content` class. Accepts CSS
#' [background-size](https://developer.mozilla.org/en-US/docs/Web/CSS/background-size)
#' property values.
#' @param background_position Background image position, requires
#' `background_image` to be set, and it is recommended to adjust
#' `background_size`. Defaults to `NULL`. Modifies the
#' `.remark-slide-content` class. Accepts CSS
#' [background-position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position)
#' property values.
#' @param code_highlight_color Code Line Highlight. Defaults to
#' rgba(255,255,0,0.5). Modifies the `.remark-code-line-highlighted` class.
#' The value of this variable is also stored as a CSS variable that can be
#' referenced with `var(--code-highlight-color)` in any argument of a style
#' function or in custom CSS.
#' @param code_inline_color Inline Code Color. Defaults to
#' `choose_dark_or_light(secondary_color, primary_color, secondary_color)`.
#' Modifies the `.remark-inline-code` class.
#' @param code_inline_background_color Inline Code Background Color. Defaults
#' to `NULL`. Modifies the `.remark-inline-code` class.
#' @param code_inline_font_size Inline Code Text Font Size. Defaults to 1em.
#' Modifies the `.remark-inline-code` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--code-inline-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param inverse_background_color Inverse Background Color. Defaults to
#' `secondary_color`. Modifies the `.inverse` class. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--inverse-background-color)` in any argument of a style function or
#' in custom CSS.
#' @param inverse_text_color Inverse Text Color. Defaults to
#' `choose_dark_or_light(secondary_color, black_color, white_color)`.
#' Modifies the `.inverse` class. The value of this variable is also stored
#' as a CSS variable that can be referenced with `var(--inverse-text-color)`
#' in any argument of a style function or in custom CSS.
#' @param inverse_text_shadow Enables Shadow on text of inverse slides.
#' Defaults to `FALSE`. Modifies the `.inverse` class.
#' @param inverse_header_color Inverse Header Color. Defaults to
#' `inverse_text_color`. Modifies the `.inverse h1, .inverse h2, .inverse h3`
#' classes. The value of this variable is also stored as a CSS variable that
#' can be referenced with `var(--inverse-header-color)` in any argument of a
#' style function or in custom CSS.
#' @param inverse_link_color Inverse Link Color. Defaults to `link_color`.
#' Modifies the `.inverse a, .inverse a > code` classes. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--inverse-link-color)` in any argument of a style function or in
#' custom CSS.
#' @param title_slide_text_color Title Slide Text Color. Defaults to
#' `choose_dark_or_light(primary_color, black_color, white_color)`. Modifies
#' the `.title-slide` class. The value of this variable is also stored as a
#' CSS variable that can be referenced with `var(--title-slide-text-color)`
#' in any argument of a style function or in custom CSS.
#' @param title_slide_background_color Title Slide Background Color. Defaults
#' to `primary_color`. Modifies the `.title-slide` class. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--title-slide-background-color)` in any argument of a style function
#' or in custom CSS.
#' @param title_slide_background_image Title Slide Background Image URL.
#' Defaults to `NULL`. Modifies the `.title-slide` class.
#' @param title_slide_background_size Title Slide Background Image Size,
#' defaults to "cover" if background image is set. Defaults to `NULL`.
#' Modifies the `.title-slide` class. Accepts CSS
#' [background-size](https://developer.mozilla.org/en-US/docs/Web/CSS/background-size)
#' property values.
#' @param title_slide_background_position Title Slide Background Image
#' Position. Defaults to `NULL`. Modifies the `.title-slide` class. Accepts
#' CSS
#' [background-position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position)
#' property values.
#' @param footnote_color Footnote text color (if `NA`, then it will be the same
#' color as `text_color`). Defaults to `NULL`. Modifies the `.footnote`
#' class.
#' @param footnote_font_size Footnote font size. Defaults to 0.9em. Modifies
#' the `.footnote` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values.
#' @param footnote_position_bottom Footnote location from bottom of screen.
#' Defaults to 60px. Modifies the `.footnote` class. Accepts CSS
#' [position](https://developer.mozilla.org/en-US/docs/Web/CSS/position_value)
#' property values.
#' @param left_column_subtle_color Left Column Text (not last). Defaults to
#' `apply_alpha(primary_color, 0.6)`. Modifies the
#' `.left-column h2, .left-column h3` classes.
#' @param left_column_selected_color Left Column Current Selection. Defaults to
#' `primary_color`. Modifies the
#' `.left-column h2:last-of-type, .left-column h3:last-child` classes.
#' @param blockquote_left_border_color Blockquote Left Border Color. Defaults
#' to `apply_alpha(secondary_color, 0.5)`. Modifies the `blockquote` element.
#' @param table_border_color Table top/bottom border. Defaults to #666.
#' Modifies the `table: border-top, border-bottom` elements.
#' @param table_row_border_color Table row inner bottom border. Defaults to
#' #ddd. Modifies the `table thead th: border-bottom` elements.
#' @param table_row_even_background_color Table Even Row Background Color.
#' Defaults to `lighten_color(secondary_color, 0.8)`. Modifies the
#' `thead, tfoot, tr:nth-child(even)` elements.
#' @param base_font_size Base Font Size for All Slide Elements (must be `px`).
#' Defaults to 20px. Modifies the `html` element. The value of this variable
#' is also stored as a CSS variable that can be referenced with
#' `var(--base-font-size)` in any argument of a style function or in custom
#' CSS.
#' @param text_font_size Slide Body Text Font Size. Defaults to 1rem. Modifies
#' the `.remark-slide-content` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--text-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_h1_font_size h1 Header Text Font Size. Defaults to 2.75rem.
#' Modifies the `.remark-slide-content h1` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-h1-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_h2_font_size h2 Header Text Font Size. Defaults to 2.25rem.
#' Modifies the `.remark-slide-content h2` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-h2-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_h3_font_size h3 Header Text Font Size. Defaults to 1.75rem.
#' Modifies the `.remark-slide-content h3` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-h3-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_background_auto Add background under slide title automatically
#' for h1 header elements. If not enabled, use `class: header_background` to
#' enable. Defaults to `FALSE`.
#' @param header_background_color Background Color for h1 Header with
#' Background. Defaults to `header_color`. Modifies the
#' `.remark-slide-content h1` class. The value of this variable is also
#' stored as a CSS variable that can be referenced with
#' `var(--header-background-color)` in any argument of a style function or in
#' custom CSS.
#' @param header_background_text_color Text Color for h1 Header with
#' Background. Defaults to `background_color`. Modifies the
#' `.remark-slide-content h1` class. The value of this variable is also
#' stored as a CSS variable that can be referenced with
#' `var(--header-background-text-color)` in any argument of a style function
#' or in custom CSS.
#' @param header_background_padding Padding for h1 Header with Background.
#' Defaults to `NULL`. Modifies the `.remark-slide-content h1` class. Accepts
#' CSS [padding](https://developer.mozilla.org/en-US/docs/Web/CSS/padding)
#' property values.
#' @param header_background_content_padding_top Top Padding for Content in
#' Slide with Header with Background. Defaults to 7rem. Modifies the
#' `.remark-slide-content` class.
#' @param header_background_ignore_classes Slide Classes Where Header with
#' Background will not be Applied. Defaults to
#' `c('normal', 'inverse', 'title', 'middle', 'bottom')`. Modifies the
#' `.remark-slide-content` class.
#' @param text_slide_number_font_size Slide Number Text Font Size. Defaults to
#' 0.9rem. Modifies the `.remark-slide-number` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values.
#' @param text_font_google Use `google_font()` to specify body font. Defaults
#' to `NULL`. Modifies the `body` element.
#' @param text_font_family Body Text Font Family (xaringan default is
#' `'Droid Serif'`). Defaults to
#' `xaringanthemer_font_default("text_font_family")`. Modifies the `body`
#' element. The value of this variable is also stored as a CSS variable that
#' can be referenced with `var(--text-font-family)` in any argument of a
#' style function or in custom CSS.
#' @param text_font_weight Body Text Font Weight. Defaults to
#' `xaringanthemer_font_default("text_font_weight")`. Modifies the `body`
#' element. Accepts CSS
#' [font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight)
#' property values.
#' @param text_bold_font_weight Body Bold Text Font Weight. Defaults to bold.
#' Modifies the `strong` element.
#' @param text_font_url Body Text Font URL(s). Defaults to
#' `xaringanthemer_font_default("text_font_url")`. Modifies the
#' `@import url()` elements.
#' @param text_font_family_fallback Body Text Font Fallbacks. Defaults to
#' `xaringanthemer_font_default("text_font_family_fallback")`. Modifies the
#' `body` element. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--text-font-family-fallback)` in
#' any argument of a style function or in custom CSS.
#' @param text_font_base Body Text Base Font (Total Failure Fallback). Defaults
#' to sans-serif. Modifies the `body` element. The value of this variable is
#' also stored as a CSS variable that can be referenced with
#' `var(--text-font-base)` in any argument of a style function or in custom
#' CSS.
#' @param header_font_google Use `google_font()` to specify header font.
#' Defaults to `NULL`. Modifies the `body` element.
#' @param header_font_family Header Font Family (xaringan default is
#' `'Yanone Kaffeesatz'`). Defaults to
#' `xaringanthemer_font_default("header_font_family")`. Modifies the
#' `h1, h2, h3` elements. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-font-family)` in any
#' argument of a style function or in custom CSS.
#' @param header_font_weight Header Font Weight. Defaults to
#' `xaringanthemer_font_default("header_font_weight")`. Modifies the
#' `h1, h2, h3` elements. Accepts CSS
#' [font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight)
#' property values.
#' @param header_font_family_fallback Header Font Family Fallback. Defaults to
#' Georgia, serif. Modifies the `h1, h2, h3` elements. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--header-font-family-fallback)` in any argument of a style function
#' or in custom CSS.
#' @param header_font_url Header Font URL. Defaults to
#' `xaringanthemer_font_default("header_font_url")`. Modifies the
#' `@import url` elements.
#' @param code_font_google Use `google_font()` to specify code font. Defaults
#' to `NULL`. Modifies the `body` element.
#' @param code_font_family Code Font Family. Defaults to
#' `xaringanthemer_font_default("code_font_family")`. Modifies the
#' `.remark-code, .remark-inline-code` classes. The value of this variable is
#' also stored as a CSS variable that can be referenced with
#' `var(--code-font-family)` in any argument of a style function or in custom
#' CSS.
#' @param code_font_size Code Text Font Size. Defaults to 0.9rem. Modifies the
#' `.remark-inline` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--code-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param code_font_url Code Font URL. Defaults to
#' `xaringanthemer_font_default("code_font_url")`. Modifies the `@import url`
#' elements.
#' @param code_font_family_fallback Code Font Fallback. Defaults to
#' `xaringanthemer_font_default("code_font_family_fallback")`. Modifies the
#' `.remark-code, .remark-inline-code` classes.
#' @param link_decoration Text decoration of links. Defaults to none. Modifies
#' the `a, a > code` elements. Accepts CSS
#' [text-decoration](https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration)
#' property values.
#' @template theme_params
#' @template style-usage
#' @template style_duo_accent
#' @family Duotone themes
#' @export
style_duo_accent <- function(
primary_color = "#035AA6",
secondary_color = "#03A696",
white_color = "#FFFFFF",
black_color = "#000000",
text_color = black_color,
header_color = primary_color,
background_color = white_color,
link_color = choose_dark_or_light(secondary_color, primary_color, secondary_color),
text_bold_color = choose_dark_or_light(secondary_color, primary_color, secondary_color),
text_slide_number_color = primary_color,
padding = "16px 64px 16px 64px",
background_image = NULL,
background_size = NULL,
background_position = NULL,
code_highlight_color = "rgba(255,255,0,0.5)",
code_inline_color = choose_dark_or_light(secondary_color, primary_color, secondary_color),
code_inline_background_color = NULL,
code_inline_font_size = "1em",
inverse_background_color = secondary_color,
inverse_text_color = choose_dark_or_light(secondary_color, black_color, white_color),
inverse_text_shadow = FALSE,
inverse_header_color = inverse_text_color,
inverse_link_color = link_color,
title_slide_text_color = choose_dark_or_light(primary_color, black_color, white_color),
title_slide_background_color = primary_color,
title_slide_background_image = NULL,
title_slide_background_size = NULL,
title_slide_background_position = NULL,
footnote_color = NULL,
footnote_font_size = "0.9em",
footnote_position_bottom = "60px",
left_column_subtle_color = apply_alpha(primary_color, 0.6),
left_column_selected_color = primary_color,
blockquote_left_border_color = apply_alpha(secondary_color, 0.5),
table_border_color = "#666",
table_row_border_color = "#ddd",
table_row_even_background_color = lighten_color(secondary_color, 0.8),
base_font_size = "20px",
text_font_size = "1rem",
header_h1_font_size = "2.75rem",
header_h2_font_size = "2.25rem",
header_h3_font_size = "1.75rem",
header_background_auto = FALSE,
header_background_color = header_color,
header_background_text_color = background_color,
header_background_padding = NULL,
header_background_content_padding_top = "7rem",
header_background_ignore_classes = c('normal', 'inverse', 'title', 'middle', 'bottom'),
text_slide_number_font_size = "0.9rem",
text_font_google = NULL,
text_font_family = xaringanthemer_font_default("text_font_family"),
text_font_weight = xaringanthemer_font_default("text_font_weight"),
text_bold_font_weight = "bold",
text_font_url = xaringanthemer_font_default("text_font_url"),
text_font_family_fallback = xaringanthemer_font_default("text_font_family_fallback"),
text_font_base = "sans-serif",
header_font_google = NULL,
header_font_family = xaringanthemer_font_default("header_font_family"),
header_font_weight = xaringanthemer_font_default("header_font_weight"),
header_font_family_fallback = "Georgia, serif",
header_font_url = xaringanthemer_font_default("header_font_url"),
code_font_google = NULL,
code_font_family = xaringanthemer_font_default("code_font_family"),
code_font_size = "0.9rem",
code_font_url = xaringanthemer_font_default("code_font_url"),
code_font_family_fallback = xaringanthemer_font_default("code_font_family_fallback"),
link_decoration = "none",
colors = NULL,
extra_css = NULL,
extra_fonts = NULL,
outfile = "xaringan-themer.css"
) {
# DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R
primary_color <- unname(primary_color)
secondary_color <- unname(secondary_color)
white_color <- unname(white_color)
black_color <- unname(black_color)
colors <- c(primary = primary_color, secondary = secondary_color, white = white_color, black = black_color, colors)
eval(parse(text = call_style_xaringan()))
}
================================================
FILE: R/style_duo_accent_inverse.R
================================================
# Generated by inst/scripts/generate_theme_functions.R: do not edit by hand
#' @param primary_color Duotone Primary Color. Defaults to #035AA6. Used in
#' multiple CSS rules. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--primary)` in any argument of a
#' style function or in custom CSS.
#' @param secondary_color Duotone Secondary Color. Defaults to #03A696. Used in
#' multiple CSS rules. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--secondary)` in any argument of
#' a style function or in custom CSS.
#' @param white_color Brightest color used. Defaults to #FFFFFF. Used in
#' multiple CSS rules. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--white)` in any argument of a
#' style function or in custom CSS.
#' @param black_color Darkest color used. Defaults to #000000. Used in multiple
#' CSS rules. The value of this variable is also stored as a CSS variable
#' that can be referenced with `var(--black)` in any argument of a style
#' function or in custom CSS.
#' @param text_color Text Color. Defaults to `white_color`. Modifies the `body`
#' element. The value of this variable is also stored as a CSS variable that
#' can be referenced with `var(--text_color)` in any argument of a style
#' function or in custom CSS.
#' @param header_color Header Color. Defaults to `primary_color`. Modifies the
#' `h1, h2, h3` elements. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-color)` in any argument
#' of a style function or in custom CSS.
#' @param background_color Slide Background Color. Defaults to `black_color`.
#' Modifies the `.remark-slide-content` class. The value of this variable is
#' also stored as a CSS variable that can be referenced with
#' `var(--background-color)` in any argument of a style function or in custom
#' CSS.
#' @param link_color Link Color. Defaults to
#' `choose_dark_or_light(secondary_color, secondary_color, primary_color)`.
#' Modifies the `a, a > code` elements. The value of this variable is also
#' stored as a CSS variable that can be referenced with `var(--link-color)`
#' in any argument of a style function or in custom CSS.
#' @param text_bold_color Bold Text Color. Defaults to
#' `choose_dark_or_light(secondary_color, secondary_color, primary_color)`.
#' Modifies the `strong` element. The value of this variable is also stored
#' as a CSS variable that can be referenced with `var(--text-bold-color)` in
#' any argument of a style function or in custom CSS.
#' @param text_slide_number_color Slide Number Color. Defaults to
#' `primary_color`. Modifies the `.remark-slide-number` class.
#' @param padding Slide Padding in `top right [bottom left]` format. Defaults
#' to 16px 64px 16px 64px. Modifies the `.remark-slide-content` class.
#' Accepts CSS
#' [padding](https://developer.mozilla.org/en-US/docs/Web/CSS/padding)
#' property values.
#' @param background_image Background image applied to each *and every* slide.
#' Set `title_slide_background_image = "none"` to remove the background image
#' from the title slide. Defaults to `NULL`. Modifies the
#' `.remark-slide-content` class.
#' @param background_size Background image size, requires `background_image` to
#' be set. If `background_image` is set, `background_size` will default to
#' `cover` so the background fills the screen. If both `background_image` and
#' `background_position` are set, will default to 100 percent. Defaults to
#' `NULL`. Modifies the `.remark-slide-content` class. Accepts CSS
#' [background-size](https://developer.mozilla.org/en-US/docs/Web/CSS/background-size)
#' property values.
#' @param background_position Background image position, requires
#' `background_image` to be set, and it is recommended to adjust
#' `background_size`. Defaults to `NULL`. Modifies the
#' `.remark-slide-content` class. Accepts CSS
#' [background-position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position)
#' property values.
#' @param code_highlight_color Code Line Highlight. Defaults to
#' rgba(255,255,0,0.5). Modifies the `.remark-code-line-highlighted` class.
#' The value of this variable is also stored as a CSS variable that can be
#' referenced with `var(--code-highlight-color)` in any argument of a style
#' function or in custom CSS.
#' @param code_inline_color Inline Code Color. Defaults to
#' `choose_dark_or_light(secondary_color, secondary_color, primary_color)`.
#' Modifies the `.remark-inline-code` class.
#' @param code_inline_background_color Inline Code Background Color. Defaults
#' to `NULL`. Modifies the `.remark-inline-code` class.
#' @param code_inline_font_size Inline Code Text Font Size. Defaults to 1em.
#' Modifies the `.remark-inline-code` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--code-inline-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param inverse_background_color Inverse Background Color. Defaults to
#' `secondary_color`. Modifies the `.inverse` class. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--inverse-background-color)` in any argument of a style function or
#' in custom CSS.
#' @param inverse_text_color Inverse Text Color. Defaults to
#' `choose_dark_or_light(secondary_color, black_color, white_color)`.
#' Modifies the `.inverse` class. The value of this variable is also stored
#' as a CSS variable that can be referenced with `var(--inverse-text-color)`
#' in any argument of a style function or in custom CSS.
#' @param inverse_text_shadow Enables Shadow on text of inverse slides.
#' Defaults to `FALSE`. Modifies the `.inverse` class.
#' @param inverse_header_color Inverse Header Color. Defaults to
#' `inverse_text_color`. Modifies the `.inverse h1, .inverse h2, .inverse h3`
#' classes. The value of this variable is also stored as a CSS variable that
#' can be referenced with `var(--inverse-header-color)` in any argument of a
#' style function or in custom CSS.
#' @param inverse_link_color Inverse Link Color. Defaults to `link_color`.
#' Modifies the `.inverse a, .inverse a > code` classes. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--inverse-link-color)` in any argument of a style function or in
#' custom CSS.
#' @param title_slide_text_color Title Slide Text Color. Defaults to
#' `choose_dark_or_light(primary_color, black_color, white_color)`. Modifies
#' the `.title-slide` class. The value of this variable is also stored as a
#' CSS variable that can be referenced with `var(--title-slide-text-color)`
#' in any argument of a style function or in custom CSS.
#' @param title_slide_background_color Title Slide Background Color. Defaults
#' to `primary_color`. Modifies the `.title-slide` class. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--title-slide-background-color)` in any argument of a style function
#' or in custom CSS.
#' @param title_slide_background_image Title Slide Background Image URL.
#' Defaults to `NULL`. Modifies the `.title-slide` class.
#' @param title_slide_background_size Title Slide Background Image Size,
#' defaults to "cover" if background image is set. Defaults to `NULL`.
#' Modifies the `.title-slide` class. Accepts CSS
#' [background-size](https://developer.mozilla.org/en-US/docs/Web/CSS/background-size)
#' property values.
#' @param title_slide_background_position Title Slide Background Image
#' Position. Defaults to `NULL`. Modifies the `.title-slide` class. Accepts
#' CSS
#' [background-position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position)
#' property values.
#' @param footnote_color Footnote text color (if `NA`, then it will be the same
#' color as `text_color`). Defaults to `NULL`. Modifies the `.footnote`
#' class.
#' @param footnote_font_size Footnote font size. Defaults to 0.9em. Modifies
#' the `.footnote` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values.
#' @param footnote_position_bottom Footnote location from bottom of screen.
#' Defaults to 60px. Modifies the `.footnote` class. Accepts CSS
#' [position](https://developer.mozilla.org/en-US/docs/Web/CSS/position_value)
#' property values.
#' @param left_column_subtle_color Left Column Text (not last). Defaults to
#' `apply_alpha(primary_color, 0.6)`. Modifies the
#' `.left-column h2, .left-column h3` classes.
#' @param left_column_selected_color Left Column Current Selection. Defaults to
#' `primary_color`. Modifies the
#' `.left-column h2:last-of-type, .left-column h3:last-child` classes.
#' @param blockquote_left_border_color Blockquote Left Border Color. Defaults
#' to `apply_alpha(secondary_color, 0.5)`. Modifies the `blockquote` element.
#' @param table_border_color Table top/bottom border. Defaults to #666.
#' Modifies the `table: border-top, border-bottom` elements.
#' @param table_row_border_color Table row inner bottom border. Defaults to
#' #ddd. Modifies the `table thead th: border-bottom` elements.
#' @param table_row_even_background_color Table Even Row Background Color.
#' Defaults to
#' `darken_color(choose_dark_or_light(primary_color, secondary_color, primary_color), 0.2)`.
#' Modifies the `thead, tfoot, tr:nth-child(even)` elements.
#' @param base_font_size Base Font Size for All Slide Elements (must be `px`).
#' Defaults to 20px. Modifies the `html` element. The value of this variable
#' is also stored as a CSS variable that can be referenced with
#' `var(--base-font-size)` in any argument of a style function or in custom
#' CSS.
#' @param text_font_size Slide Body Text Font Size. Defaults to 1rem. Modifies
#' the `.remark-slide-content` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--text-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_h1_font_size h1 Header Text Font Size. Defaults to 2.75rem.
#' Modifies the `.remark-slide-content h1` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-h1-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_h2_font_size h2 Header Text Font Size. Defaults to 2.25rem.
#' Modifies the `.remark-slide-content h2` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-h2-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_h3_font_size h3 Header Text Font Size. Defaults to 1.75rem.
#' Modifies the `.remark-slide-content h3` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-h3-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_background_auto Add background under slide title automatically
#' for h1 header elements. If not enabled, use `class: header_background` to
#' enable. Defaults to `FALSE`.
#' @param header_background_color Background Color for h1 Header with
#' Background. Defaults to `header_color`. Modifies the
#' `.remark-slide-content h1` class. The value of this variable is also
#' stored as a CSS variable that can be referenced with
#' `var(--header-background-color)` in any argument of a style function or in
#' custom CSS.
#' @param header_background_text_color Text Color for h1 Header with
#' Background. Defaults to `background_color`. Modifies the
#' `.remark-slide-content h1` class. The value of this variable is also
#' stored as a CSS variable that can be referenced with
#' `var(--header-background-text-color)` in any argument of a style function
#' or in custom CSS.
#' @param header_background_padding Padding for h1 Header with Background.
#' Defaults to `NULL`. Modifies the `.remark-slide-content h1` class. Accepts
#' CSS [padding](https://developer.mozilla.org/en-US/docs/Web/CSS/padding)
#' property values.
#' @param header_background_content_padding_top Top Padding for Content in
#' Slide with Header with Background. Defaults to 7rem. Modifies the
#' `.remark-slide-content` class.
#' @param header_background_ignore_classes Slide Classes Where Header with
#' Background will not be Applied. Defaults to
#' `c('normal', 'inverse', 'title', 'middle', 'bottom')`. Modifies the
#' `.remark-slide-content` class.
#' @param text_slide_number_font_size Slide Number Text Font Size. Defaults to
#' 0.9rem. Modifies the `.remark-slide-number` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values.
#' @param text_font_google Use `google_font()` to specify body font. Defaults
#' to `NULL`. Modifies the `body` element.
#' @param text_font_family Body Text Font Family (xaringan default is
#' `'Droid Serif'`). Defaults to
#' `xaringanthemer_font_default("text_font_family")`. Modifies the `body`
#' element. The value of this variable is also stored as a CSS variable that
#' can be referenced with `var(--text-font-family)` in any argument of a
#' style function or in custom CSS.
#' @param text_font_weight Body Text Font Weight. Defaults to
#' `xaringanthemer_font_default("text_font_weight")`. Modifies the `body`
#' element. Accepts CSS
#' [font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight)
#' property values.
#' @param text_bold_font_weight Body Bold Text Font Weight. Defaults to bold.
#' Modifies the `strong` element.
#' @param text_font_url Body Text Font URL(s). Defaults to
#' `xaringanthemer_font_default("text_font_url")`. Modifies the
#' `@import url()` elements.
#' @param text_font_family_fallback Body Text Font Fallbacks. Defaults to
#' `xaringanthemer_font_default("text_font_family_fallback")`. Modifies the
#' `body` element. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--text-font-family-fallback)` in
#' any argument of a style function or in custom CSS.
#' @param text_font_base Body Text Base Font (Total Failure Fallback). Defaults
#' to sans-serif. Modifies the `body` element. The value of this variable is
#' also stored as a CSS variable that can be referenced with
#' `var(--text-font-base)` in any argument of a style function or in custom
#' CSS.
#' @param header_font_google Use `google_font()` to specify header font.
#' Defaults to `NULL`. Modifies the `body` element.
#' @param header_font_family Header Font Family (xaringan default is
#' `'Yanone Kaffeesatz'`). Defaults to
#' `xaringanthemer_font_default("header_font_family")`. Modifies the
#' `h1, h2, h3` elements. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-font-family)` in any
#' argument of a style function or in custom CSS.
#' @param header_font_weight Header Font Weight. Defaults to
#' `xaringanthemer_font_default("header_font_weight")`. Modifies the
#' `h1, h2, h3` elements. Accepts CSS
#' [font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight)
#' property values.
#' @param header_font_family_fallback Header Font Family Fallback. Defaults to
#' Georgia, serif. Modifies the `h1, h2, h3` elements. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--header-font-family-fallback)` in any argument of a style function
#' or in custom CSS.
#' @param header_font_url Header Font URL. Defaults to
#' `xaringanthemer_font_default("header_font_url")`. Modifies the
#' `@import url` elements.
#' @param code_font_google Use `google_font()` to specify code font. Defaults
#' to `NULL`. Modifies the `body` element.
#' @param code_font_family Code Font Family. Defaults to
#' `xaringanthemer_font_default("code_font_family")`. Modifies the
#' `.remark-code, .remark-inline-code` classes. The value of this variable is
#' also stored as a CSS variable that can be referenced with
#' `var(--code-font-family)` in any argument of a style function or in custom
#' CSS.
#' @param code_font_size Code Text Font Size. Defaults to 0.9rem. Modifies the
#' `.remark-inline` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--code-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param code_font_url Code Font URL. Defaults to
#' `xaringanthemer_font_default("code_font_url")`. Modifies the `@import url`
#' elements.
#' @param code_font_family_fallback Code Font Fallback. Defaults to
#' `xaringanthemer_font_default("code_font_family_fallback")`. Modifies the
#' `.remark-code, .remark-inline-code` classes.
#' @param link_decoration Text decoration of links. Defaults to none. Modifies
#' the `a, a > code` elements. Accepts CSS
#' [text-decoration](https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration)
#' property values.
#' @template theme_params
#' @template style-usage
#' @template style_duo_accent_inverse
#' @family Duotone themes
#' @export
style_duo_accent_inverse <- function(
primary_color = "#035AA6",
secondary_color = "#03A696",
white_color = "#FFFFFF",
black_color = "#000000",
text_color = white_color,
header_color = primary_color,
background_color = black_color,
link_color = choose_dark_or_light(secondary_color, secondary_color, primary_color),
text_bold_color = choose_dark_or_light(secondary_color, secondary_color, primary_color),
text_slide_number_color = primary_color,
padding = "16px 64px 16px 64px",
background_image = NULL,
background_size = NULL,
background_position = NULL,
code_highlight_color = "rgba(255,255,0,0.5)",
code_inline_color = choose_dark_or_light(secondary_color, secondary_color, primary_color),
code_inline_background_color = NULL,
code_inline_font_size = "1em",
inverse_background_color = secondary_color,
inverse_text_color = choose_dark_or_light(secondary_color, black_color, white_color),
inverse_text_shadow = FALSE,
inverse_header_color = inverse_text_color,
inverse_link_color = link_color,
title_slide_text_color = choose_dark_or_light(primary_color, black_color, white_color),
title_slide_background_color = primary_color,
title_slide_background_image = NULL,
title_slide_background_size = NULL,
title_slide_background_position = NULL,
footnote_color = NULL,
footnote_font_size = "0.9em",
footnote_position_bottom = "60px",
left_column_subtle_color = apply_alpha(primary_color, 0.6),
left_column_selected_color = primary_color,
blockquote_left_border_color = apply_alpha(secondary_color, 0.5),
table_border_color = "#666",
table_row_border_color = "#ddd",
table_row_even_background_color = darken_color(choose_dark_or_light(primary_color, secondary_color, primary_color), 0.2),
base_font_size = "20px",
text_font_size = "1rem",
header_h1_font_size = "2.75rem",
header_h2_font_size = "2.25rem",
header_h3_font_size = "1.75rem",
header_background_auto = FALSE,
header_background_color = header_color,
header_background_text_color = background_color,
header_background_padding = NULL,
header_background_content_padding_top = "7rem",
header_background_ignore_classes = c('normal', 'inverse', 'title', 'middle', 'bottom'),
text_slide_number_font_size = "0.9rem",
text_font_google = NULL,
text_font_family = xaringanthemer_font_default("text_font_family"),
text_font_weight = xaringanthemer_font_default("text_font_weight"),
text_bold_font_weight = "bold",
text_font_url = xaringanthemer_font_default("text_font_url"),
text_font_family_fallback = xaringanthemer_font_default("text_font_family_fallback"),
text_font_base = "sans-serif",
header_font_google = NULL,
header_font_family = xaringanthemer_font_default("header_font_family"),
header_font_weight = xaringanthemer_font_default("header_font_weight"),
header_font_family_fallback = "Georgia, serif",
header_font_url = xaringanthemer_font_default("header_font_url"),
code_font_google = NULL,
code_font_family = xaringanthemer_font_default("code_font_family"),
code_font_size = "0.9rem",
code_font_url = xaringanthemer_font_default("code_font_url"),
code_font_family_fallback = xaringanthemer_font_default("code_font_family_fallback"),
link_decoration = "none",
colors = NULL,
extra_css = NULL,
extra_fonts = NULL,
outfile = "xaringan-themer.css"
) {
# DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R
primary_color <- unname(primary_color)
secondary_color <- unname(secondary_color)
white_color <- unname(white_color)
black_color <- unname(black_color)
colors <- c(primary = primary_color, secondary = secondary_color, white = white_color, black = black_color, colors)
eval(parse(text = call_style_xaringan()))
}
================================================
FILE: R/style_extra_css.R
================================================
#' Add Extra CSS Styles
#'
#' Adds css elements to target `outfile`, typically a xaringanthemer css file.
#' The `css` argument takes a list of CSS classes and definitions (see examples below)
#' and appends CSS rules to `outfile`.
#'
#' @section css list:
#' The `css` input must be a named list of css properties and values within a
#' named list of class identifiers, for example
#' `list(".class-id" = list("css-property" = "value"))`.
#'
#' @param css A named list of CSS definitions each containing a named list
#' of CSS property-value pairs, i.e.
#' `list(".class-id" = list("css-property" = "value"))`
#' @param append If `TRUE` output will be appended to `outfile`; otherwise,
#' it will overwrite the contents of `outfile`.
#' @param heading Heading added above extra CSS. Use `NULL` to disable.
#'
#' @examples
#' style_extra_css(
#' outfile = stdout(),
#' css = list(
#' ".red" = list(color = "red"),
#' ".small" = list("font-size" = "90%"),
#' ".full-width" = list(
#' display = "flex",
#' width = "100%",
#' flex = "1 1 auto"
#' )
#' )
#' )
#' @inheritParams style_xaringan
#' @export
style_extra_css <- function(
css,
outfile = "xaringan-themer.css",
append = TRUE,
heading = "Extra CSS"
) {
has_heading <- !is.null(heading)
x <- paste0(
if (has_heading) paste0("/* ", heading, " */\n"),
paste(list2css(css), collapse = "\n")
)
if (append) x <- paste0(if (has_heading) "\n\n" else "\n", x)
if (is.null(outfile)) return(x)
cat(
x,
file = outfile,
append = append,
sep = "\n"
)
invisible(x)
}
#' @inheritParams style_extra_css
#' @keywords internal
list2css <- function(css) {
`%.%` <- function(x, y) paste0(x, y)
error <- NULL
if (is.null(names(css))) {
stop("All elements in `css` list must be named", call. = FALSE)
}
if (purrr::pluck_depth(css) != 3) {
stop(str_wrap(
"`css` list must be a named list within a named list, e.g.:\n",
' list(".class-id" = list("css-property" = "value"))'
))
}
if (any(names(css) == "")) {
not_named <- which(names(css) == "")
if (length(not_named) > 1) {
stop(str_wrap(
call. = FALSE,
"All elements in `css` list must be named. Items ",
paste(not_named, collapse = ", "),
" are unnamed."
))
} else {
stop(str_wrap(
call. = FALSE,
"All elements in `css` list must be named. Item ",
not_named,
" is not named."
))
}
}
child_unnamed <- purrr::map_lgl(purrr::map(css, ~ {
is.null(names(.)) || any(names(.) == "")
}), ~ any(.))
if (any(child_unnamed)) {
has_unnamed <- names(css)[child_unnamed]
msg <- paste(
"All properties of elements in `css` list must be named.",
if (length(has_unnamed) > 1) "Elements" else "Element",
paste(has_unnamed, collapse = ", "),
if (length(has_unnamed) > 1) "have" else "has",
"unnamed property or properties."
)
stop(str_wrap(msg), call. = FALSE)
}
x <- purrr::imap_chr(css, function(rules, selector) {
paste(
sep = "\n",
selector %.% " {",
paste(
purrr::imap_chr(rules, function(value, prop) {
" " %.% prop %.% ": " %.% value %.% ";"
}),
collapse = "\n"
),
"}"
)
})
unname(x)
}
list2fonts <- function(fonts) {
if (
length(setdiff(names(google_font('fam')), names(fonts))) == 0 &&
!inherits(fonts, "google_font")
) {
# concatenating a string and a google_font() provides a wacky list
stop(
"Multiple fonts in `extra_fonts` must be specified inside a `list()`.",
call. = FALSE
)
}
if (inherits(fonts, "google_font")) {
fonts <- list(fonts)
}
fonts <- purrr::map_chr(fonts, function(f) {
if (inherits(f, "google_font")) {
f$url
} else if (inherits(f, "character")) {
f
} else {
NA_character_
}
})
paste0("@import url(", fonts[!is.na(fonts)], ");")
}
================================================
FILE: R/style_font_default.R
================================================
#' @describeIn style_xaringan Default values for font family, weight, URLs and
#' font fallbacks.
#' @param font_arg A font argument from the \pkg{xaringanthemer} `style_`
#' function family.
#' @export
xaringanthemer_font_default <- function(font_arg) {
x <- switch(
font_arg,
text_font_family = "Noto Sans",
text_font_weight = "normal",
text_font_url = "https://fonts.googleapis.com/css?family=Noto+Sans:400,400i,700,700i&display=swap",
text_font_family_fallback = "-apple-system, BlinkMacSystemFont, avenir next, avenir, helvetica neue, helvetica, Ubuntu, roboto, noto, segoe ui, arial",
header_font_family = "Cabin",
header_font_weight = "600",
header_font_url = "https://fonts.googleapis.com/css?family=Cabin:600,600i&display=swap",
code_font_family = "Source Code Pro",
code_font_url = "https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700&display=swap",
code_font_family_fallback = "Menlo, Consolas, Monaco, Liberation Mono, Lucida Console",
stop("unknown font_arg: ", font_arg)
)
class(x) <- c("xaringanthemer_default", class(x))
x
}
#' @export
print.xaringanthemer_default <- function(x, ...) {
print(unclass(x))
}
================================================
FILE: R/style_mono_accent.R
================================================
# Generated by inst/scripts/generate_theme_functions.R: do not edit by hand
#' @param base_color Monotone Base Color, works best with a strong color.
#' Defaults to #43418A. Used in multiple CSS rules. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--base)` in any argument of a style function or in custom CSS.
#' @param white_color Brightest color used. Defaults to #FFFFFF. Used in
#' multiple CSS rules. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--white)` in any argument of a
#' style function or in custom CSS.
#' @param black_color Darkest color used. Defaults to #272822. Used in multiple
#' CSS rules. The value of this variable is also stored as a CSS variable
#' that can be referenced with `var(--black)` in any argument of a style
#' function or in custom CSS.
#' @param text_color Text Color. Defaults to `black_color`. Modifies the `body`
#' element. The value of this variable is also stored as a CSS variable that
#' can be referenced with `var(--text_color)` in any argument of a style
#' function or in custom CSS.
#' @param header_color Header Color. Defaults to `base_color`. Modifies the
#' `h1, h2, h3` elements. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-color)` in any argument
#' of a style function or in custom CSS.
#' @param background_color Slide Background Color. Defaults to `white_color`.
#' Modifies the `.remark-slide-content` class. The value of this variable is
#' also stored as a CSS variable that can be referenced with
#' `var(--background-color)` in any argument of a style function or in custom
#' CSS.
#' @param link_color Link Color. Defaults to `base_color`. Modifies the
#' `a, a > code` elements. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--link-color)` in any argument
#' of a style function or in custom CSS.
#' @param text_bold_color Bold Text Color. Defaults to `base_color`. Modifies
#' the `strong` element. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--text-bold-color)` in any
#' argument of a style function or in custom CSS.
#' @param text_slide_number_color Slide Number Color. Defaults to `base_color`.
#' Modifies the `.remark-slide-number` class.
#' @param padding Slide Padding in `top right [bottom left]` format. Defaults
#' to 16px 64px 16px 64px. Modifies the `.remark-slide-content` class.
#' Accepts CSS
#' [padding](https://developer.mozilla.org/en-US/docs/Web/CSS/padding)
#' property values.
#' @param background_image Background image applied to each *and every* slide.
#' Set `title_slide_background_image = "none"` to remove the background image
#' from the title slide. Defaults to `NULL`. Modifies the
#' `.remark-slide-content` class.
#' @param background_size Background image size, requires `background_image` to
#' be set. If `background_image` is set, `background_size` will default to
#' `cover` so the background fills the screen. If both `background_image` and
#' `background_position` are set, will default to 100 percent. Defaults to
#' `NULL`. Modifies the `.remark-slide-content` class. Accepts CSS
#' [background-size](https://developer.mozilla.org/en-US/docs/Web/CSS/background-size)
#' property values.
#' @param background_position Background image position, requires
#' `background_image` to be set, and it is recommended to adjust
#' `background_size`. Defaults to `NULL`. Modifies the
#' `.remark-slide-content` class. Accepts CSS
#' [background-position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position)
#' property values.
#' @param code_highlight_color Code Line Highlight. Defaults to
#' rgba(255,255,0,0.5). Modifies the `.remark-code-line-highlighted` class.
#' The value of this variable is also stored as a CSS variable that can be
#' referenced with `var(--code-highlight-color)` in any argument of a style
#' function or in custom CSS.
#' @param code_inline_color Inline Code Color. Defaults to `base_color`.
#' Modifies the `.remark-inline-code` class.
#' @param code_inline_background_color Inline Code Background Color. Defaults
#' to `NULL`. Modifies the `.remark-inline-code` class.
#' @param code_inline_font_size Inline Code Text Font Size. Defaults to 1em.
#' Modifies the `.remark-inline-code` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--code-inline-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param inverse_background_color Inverse Background Color. Defaults to
#' `base_color`. Modifies the `.inverse` class. The value of this variable is
#' also stored as a CSS variable that can be referenced with
#' `var(--inverse-background-color)` in any argument of a style function or
#' in custom CSS.
#' @param inverse_text_color Inverse Text Color. Defaults to `white_color`.
#' Modifies the `.inverse` class. The value of this variable is also stored
#' as a CSS variable that can be referenced with `var(--inverse-text-color)`
#' in any argument of a style function or in custom CSS.
#' @param inverse_text_shadow Enables Shadow on text of inverse slides.
#' Defaults to `FALSE`. Modifies the `.inverse` class.
#' @param inverse_header_color Inverse Header Color. Defaults to
#' `inverse_text_color`. Modifies the `.inverse h1, .inverse h2, .inverse h3`
#' classes. The value of this variable is also stored as a CSS variable that
#' can be referenced with `var(--inverse-header-color)` in any argument of a
#' style function or in custom CSS.
#' @param inverse_link_color Inverse Link Color. Defaults to `link_color`.
#' Modifies the `.inverse a, .inverse a > code` classes. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--inverse-link-color)` in any argument of a style function or in
#' custom CSS.
#' @param title_slide_text_color Title Slide Text Color. Defaults to
#' `inverse_text_color`. Modifies the `.title-slide` class. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--title-slide-text-color)` in any argument of a style function or in
#' custom CSS.
#' @param title_slide_background_color Title Slide Background Color. Defaults
#' to `inverse_background_color`. Modifies the `.title-slide` class. The
#' value of this variable is also stored as a CSS variable that can be
#' referenced with `var(--title-slide-background-color)` in any argument of a
#' style function or in custom CSS.
#' @param title_slide_background_image Title Slide Background Image URL.
#' Defaults to `NULL`. Modifies the `.title-slide` class.
#' @param title_slide_background_size Title Slide Background Image Size,
#' defaults to "cover" if background image is set. Defaults to `NULL`.
#' Modifies the `.title-slide` class. Accepts CSS
#' [background-size](https://developer.mozilla.org/en-US/docs/Web/CSS/background-size)
#' property values.
#' @param title_slide_background_position Title Slide Background Image
#' Position. Defaults to `NULL`. Modifies the `.title-slide` class. Accepts
#' CSS
#' [background-position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position)
#' property values.
#' @param footnote_color Footnote text color (if `NA`, then it will be the same
#' color as `text_color`). Defaults to `NULL`. Modifies the `.footnote`
#' class.
#' @param footnote_font_size Footnote font size. Defaults to 0.9em. Modifies
#' the `.footnote` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values.
#' @param footnote_position_bottom Footnote location from bottom of screen.
#' Defaults to 60px. Modifies the `.footnote` class. Accepts CSS
#' [position](https://developer.mozilla.org/en-US/docs/Web/CSS/position_value)
#' property values.
#' @param left_column_subtle_color Left Column Text (not last). Defaults to
#' `apply_alpha(base_color, 0.6)`. Modifies the
#' `.left-column h2, .left-column h3` classes.
#' @param left_column_selected_color Left Column Current Selection. Defaults to
#' `base_color`. Modifies the
#' `.left-column h2:last-of-type, .left-column h3:last-child` classes.
#' @param blockquote_left_border_color Blockquote Left Border Color. Defaults
#' to `apply_alpha(base_color, 0.5)`. Modifies the `blockquote` element.
#' @param table_border_color Table top/bottom border. Defaults to #666.
#' Modifies the `table: border-top, border-bottom` elements.
#' @param table_row_border_color Table row inner bottom border. Defaults to
#' #ddd. Modifies the `table thead th: border-bottom` elements.
#' @param table_row_even_background_color Table Even Row Background Color.
#' Defaults to `lighten_color(base_color, 0.8)`. Modifies the
#' `thead, tfoot, tr:nth-child(even)` elements.
#' @param base_font_size Base Font Size for All Slide Elements (must be `px`).
#' Defaults to 20px. Modifies the `html` element. The value of this variable
#' is also stored as a CSS variable that can be referenced with
#' `var(--base-font-size)` in any argument of a style function or in custom
#' CSS.
#' @param text_font_size Slide Body Text Font Size. Defaults to 1rem. Modifies
#' the `.remark-slide-content` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--text-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_h1_font_size h1 Header Text Font Size. Defaults to 2.75rem.
#' Modifies the `.remark-slide-content h1` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-h1-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_h2_font_size h2 Header Text Font Size. Defaults to 2.25rem.
#' Modifies the `.remark-slide-content h2` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-h2-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_h3_font_size h3 Header Text Font Size. Defaults to 1.75rem.
#' Modifies the `.remark-slide-content h3` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-h3-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_background_auto Add background under slide title automatically
#' for h1 header elements. If not enabled, use `class: header_background` to
#' enable. Defaults to `FALSE`.
#' @param header_background_color Background Color for h1 Header with
#' Background. Defaults to `header_color`. Modifies the
#' `.remark-slide-content h1` class. The value of this variable is also
#' stored as a CSS variable that can be referenced with
#' `var(--header-background-color)` in any argument of a style function or in
#' custom CSS.
#' @param header_background_text_color Text Color for h1 Header with
#' Background. Defaults to `background_color`. Modifies the
#' `.remark-slide-content h1` class. The value of this variable is also
#' stored as a CSS variable that can be referenced with
#' `var(--header-background-text-color)` in any argument of a style function
#' or in custom CSS.
#' @param header_background_padding Padding for h1 Header with Background.
#' Defaults to `NULL`. Modifies the `.remark-slide-content h1` class. Accepts
#' CSS [padding](https://developer.mozilla.org/en-US/docs/Web/CSS/padding)
#' property values.
#' @param header_background_content_padding_top Top Padding for Content in
#' Slide with Header with Background. Defaults to 7rem. Modifies the
#' `.remark-slide-content` class.
#' @param header_background_ignore_classes Slide Classes Where Header with
#' Background will not be Applied. Defaults to
#' `c('normal', 'inverse', 'title', 'middle', 'bottom')`. Modifies the
#' `.remark-slide-content` class.
#' @param text_slide_number_font_size Slide Number Text Font Size. Defaults to
#' 0.9rem. Modifies the `.remark-slide-number` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values.
#' @param text_font_google Use `google_font()` to specify body font. Defaults
#' to `NULL`. Modifies the `body` element.
#' @param text_font_family Body Text Font Family (xaringan default is
#' `'Droid Serif'`). Defaults to
#' `xaringanthemer_font_default("text_font_family")`. Modifies the `body`
#' element. The value of this variable is also stored as a CSS variable that
#' can be referenced with `var(--text-font-family)` in any argument of a
#' style function or in custom CSS.
#' @param text_font_weight Body Text Font Weight. Defaults to
#' `xaringanthemer_font_default("text_font_weight")`. Modifies the `body`
#' element. Accepts CSS
#' [font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight)
#' property values.
#' @param text_bold_font_weight Body Bold Text Font Weight. Defaults to bold.
#' Modifies the `strong` element.
#' @param text_font_url Body Text Font URL(s). Defaults to
#' `xaringanthemer_font_default("text_font_url")`. Modifies the
#' `@import url()` elements.
#' @param text_font_family_fallback Body Text Font Fallbacks. Defaults to
#' `xaringanthemer_font_default("text_font_family_fallback")`. Modifies the
#' `body` element. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--text-font-family-fallback)` in
#' any argument of a style function or in custom CSS.
#' @param text_font_base Body Text Base Font (Total Failure Fallback). Defaults
#' to sans-serif. Modifies the `body` element. The value of this variable is
#' also stored as a CSS variable that can be referenced with
#' `var(--text-font-base)` in any argument of a style function or in custom
#' CSS.
#' @param header_font_google Use `google_font()` to specify header font.
#' Defaults to `NULL`. Modifies the `body` element.
#' @param header_font_family Header Font Family (xaringan default is
#' `'Yanone Kaffeesatz'`). Defaults to
#' `xaringanthemer_font_default("header_font_family")`. Modifies the
#' `h1, h2, h3` elements. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-font-family)` in any
#' argument of a style function or in custom CSS.
#' @param header_font_weight Header Font Weight. Defaults to
#' `xaringanthemer_font_default("header_font_weight")`. Modifies the
#' `h1, h2, h3` elements. Accepts CSS
#' [font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight)
#' property values.
#' @param header_font_family_fallback Header Font Family Fallback. Defaults to
#' Georgia, serif. Modifies the `h1, h2, h3` elements. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--header-font-family-fallback)` in any argument of a style function
#' or in custom CSS.
#' @param header_font_url Header Font URL. Defaults to
#' `xaringanthemer_font_default("header_font_url")`. Modifies the
#' `@import url` elements.
#' @param code_font_google Use `google_font()` to specify code font. Defaults
#' to `NULL`. Modifies the `body` element.
#' @param code_font_family Code Font Family. Defaults to
#' `xaringanthemer_font_default("code_font_family")`. Modifies the
#' `.remark-code, .remark-inline-code` classes. The value of this variable is
#' also stored as a CSS variable that can be referenced with
#' `var(--code-font-family)` in any argument of a style function or in custom
#' CSS.
#' @param code_font_size Code Text Font Size. Defaults to 0.9rem. Modifies the
#' `.remark-inline` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--code-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param code_font_url Code Font URL. Defaults to
#' `xaringanthemer_font_default("code_font_url")`. Modifies the `@import url`
#' elements.
#' @param code_font_family_fallback Code Font Fallback. Defaults to
#' `xaringanthemer_font_default("code_font_family_fallback")`. Modifies the
#' `.remark-code, .remark-inline-code` classes.
#' @param link_decoration Text decoration of links. Defaults to none. Modifies
#' the `a, a > code` elements. Accepts CSS
#' [text-decoration](https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration)
#' property values.
#' @template theme_params
#' @template style-usage
#' @template style_mono_accent
#' @family Monotone themes
#' @export
style_mono_accent <- function(
base_color = "#43418A",
white_color = "#FFFFFF",
black_color = "#272822",
text_color = black_color,
header_color = base_color,
background_color = white_color,
link_color = base_color,
text_bold_color = base_color,
text_slide_number_color = base_color,
padding = "16px 64px 16px 64px",
background_image = NULL,
background_size = NULL,
background_position = NULL,
code_highlight_color = "rgba(255,255,0,0.5)",
code_inline_color = base_color,
code_inline_background_color = NULL,
code_inline_font_size = "1em",
inverse_background_color = base_color,
inverse_text_color = white_color,
inverse_text_shadow = FALSE,
inverse_header_color = inverse_text_color,
inverse_link_color = link_color,
title_slide_text_color = inverse_text_color,
title_slide_background_color = inverse_background_color,
title_slide_background_image = NULL,
title_slide_background_size = NULL,
title_slide_background_position = NULL,
footnote_color = NULL,
footnote_font_size = "0.9em",
footnote_position_bottom = "60px",
left_column_subtle_color = apply_alpha(base_color, 0.6),
left_column_selected_color = base_color,
blockquote_left_border_color = apply_alpha(base_color, 0.5),
table_border_color = "#666",
table_row_border_color = "#ddd",
table_row_even_background_color = lighten_color(base_color, 0.8),
base_font_size = "20px",
text_font_size = "1rem",
header_h1_font_size = "2.75rem",
header_h2_font_size = "2.25rem",
header_h3_font_size = "1.75rem",
header_background_auto = FALSE,
header_background_color = header_color,
header_background_text_color = background_color,
header_background_padding = NULL,
header_background_content_padding_top = "7rem",
header_background_ignore_classes = c('normal', 'inverse', 'title', 'middle', 'bottom'),
text_slide_number_font_size = "0.9rem",
text_font_google = NULL,
text_font_family = xaringanthemer_font_default("text_font_family"),
text_font_weight = xaringanthemer_font_default("text_font_weight"),
text_bold_font_weight = "bold",
text_font_url = xaringanthemer_font_default("text_font_url"),
text_font_family_fallback = xaringanthemer_font_default("text_font_family_fallback"),
text_font_base = "sans-serif",
header_font_google = NULL,
header_font_family = xaringanthemer_font_default("header_font_family"),
header_font_weight = xaringanthemer_font_default("header_font_weight"),
header_font_family_fallback = "Georgia, serif",
header_font_url = xaringanthemer_font_default("header_font_url"),
code_font_google = NULL,
code_font_family = xaringanthemer_font_default("code_font_family"),
code_font_size = "0.9rem",
code_font_url = xaringanthemer_font_default("code_font_url"),
code_font_family_fallback = xaringanthemer_font_default("code_font_family_fallback"),
link_decoration = "none",
colors = NULL,
extra_css = NULL,
extra_fonts = NULL,
outfile = "xaringan-themer.css"
) {
# DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R
base_color <- unname(base_color)
white_color <- unname(white_color)
black_color <- unname(black_color)
colors <- c(base = base_color, white = white_color, black = black_color, colors)
eval(parse(text = call_style_xaringan()))
}
================================================
FILE: R/style_mono_accent_inverse.R
================================================
# Generated by inst/scripts/generate_theme_functions.R: do not edit by hand
#' @param base_color Monotone Base Color, works best with a light color.
#' Defaults to #3C989E. Used in multiple CSS rules. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--base)` in any argument of a style function or in custom CSS.
#' @param white_color Brightest color used, default is a very light version of
#' `base_color`. Defaults to #FFFFFF. Used in multiple CSS rules. The value
#' of this variable is also stored as a CSS variable that can be referenced
#' with `var(--white)` in any argument of a style function or in custom CSS.
#' @param black_color Darkest color used, default is a very dark, version of
#' `base_color`. Defaults to `darken_color(base_color, 0.9)`. Used in
#' multiple CSS rules. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--black)` in any argument of a
#' style function or in custom CSS.
#' @param text_color Text Color. Defaults to `white_color`. Modifies the `body`
#' element. The value of this variable is also stored as a CSS variable that
#' can be referenced with `var(--text_color)` in any argument of a style
#' function or in custom CSS.
#' @param header_color Header Color. Defaults to `base_color`. Modifies the
#' `h1, h2, h3` elements. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-color)` in any argument
#' of a style function or in custom CSS.
#' @param background_color Slide Background Color. Defaults to `black_color`.
#' Modifies the `.remark-slide-content` class. The value of this variable is
#' also stored as a CSS variable that can be referenced with
#' `var(--background-color)` in any argument of a style function or in custom
#' CSS.
#' @param link_color Link Color. Defaults to `base_color`. Modifies the
#' `a, a > code` elements. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--link-color)` in any argument
#' of a style function or in custom CSS.
#' @param text_bold_color Bold Text Color. Defaults to `base_color`. Modifies
#' the `strong` element. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--text-bold-color)` in any
#' argument of a style function or in custom CSS.
#' @param text_slide_number_color Slide Number Color. Defaults to `base_color`.
#' Modifies the `.remark-slide-number` class.
#' @param padding Slide Padding in `top right [bottom left]` format. Defaults
#' to 16px 64px 16px 64px. Modifies the `.remark-slide-content` class.
#' Accepts CSS
#' [padding](https://developer.mozilla.org/en-US/docs/Web/CSS/padding)
#' property values.
#' @param background_image Background image applied to each *and every* slide.
#' Set `title_slide_background_image = "none"` to remove the background image
#' from the title slide. Defaults to `NULL`. Modifies the
#' `.remark-slide-content` class.
#' @param background_size Background image size, requires `background_image` to
#' be set. If `background_image` is set, `background_size` will default to
#' `cover` so the background fills the screen. If both `background_image` and
#' `background_position` are set, will default to 100 percent. Defaults to
#' `NULL`. Modifies the `.remark-slide-content` class. Accepts CSS
#' [background-size](https://developer.mozilla.org/en-US/docs/Web/CSS/background-size)
#' property values.
#' @param background_position Background image position, requires
#' `background_image` to be set, and it is recommended to adjust
#' `background_size`. Defaults to `NULL`. Modifies the
#' `.remark-slide-content` class. Accepts CSS
#' [background-position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position)
#' property values.
#' @param code_highlight_color Code Line Highlight. Defaults to
#' rgba(255,255,0,0.5). Modifies the `.remark-code-line-highlighted` class.
#' The value of this variable is also stored as a CSS variable that can be
#' referenced with `var(--code-highlight-color)` in any argument of a style
#' function or in custom CSS.
#' @param code_inline_color Inline Code Color. Defaults to `base_color`.
#' Modifies the `.remark-inline-code` class.
#' @param code_inline_background_color Inline Code Background Color. Defaults
#' to `NULL`. Modifies the `.remark-inline-code` class.
#' @param code_inline_font_size Inline Code Text Font Size. Defaults to 1em.
#' Modifies the `.remark-inline-code` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--code-inline-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param inverse_background_color Inverse Background Color. Defaults to
#' `base_color`. Modifies the `.inverse` class. The value of this variable is
#' also stored as a CSS variable that can be referenced with
#' `var(--inverse-background-color)` in any argument of a style function or
#' in custom CSS.
#' @param inverse_text_color Inverse Text Color. Defaults to `black_color`.
#' Modifies the `.inverse` class. The value of this variable is also stored
#' as a CSS variable that can be referenced with `var(--inverse-text-color)`
#' in any argument of a style function or in custom CSS.
#' @param inverse_text_shadow Enables Shadow on text of inverse slides.
#' Defaults to `FALSE`. Modifies the `.inverse` class.
#' @param inverse_header_color Inverse Header Color. Defaults to
#' `inverse_text_color`. Modifies the `.inverse h1, .inverse h2, .inverse h3`
#' classes. The value of this variable is also stored as a CSS variable that
#' can be referenced with `var(--inverse-header-color)` in any argument of a
#' style function or in custom CSS.
#' @param inverse_link_color Inverse Link Color. Defaults to `link_color`.
#' Modifies the `.inverse a, .inverse a > code` classes. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--inverse-link-color)` in any argument of a style function or in
#' custom CSS.
#' @param title_slide_text_color Title Slide Text Color. Defaults to
#' `inverse_text_color`. Modifies the `.title-slide` class. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--title-slide-text-color)` in any argument of a style function or in
#' custom CSS.
#' @param title_slide_background_color Title Slide Background Color. Defaults
#' to `inverse_background_color`. Modifies the `.title-slide` class. The
#' value of this variable is also stored as a CSS variable that can be
#' referenced with `var(--title-slide-background-color)` in any argument of a
#' style function or in custom CSS.
#' @param title_slide_background_image Title Slide Background Image URL.
#' Defaults to `NULL`. Modifies the `.title-slide` class.
#' @param title_slide_background_size Title Slide Background Image Size,
#' defaults to "cover" if background image is set. Defaults to `NULL`.
#' Modifies the `.title-slide` class. Accepts CSS
#' [background-size](https://developer.mozilla.org/en-US/docs/Web/CSS/background-size)
#' property values.
#' @param title_slide_background_position Title Slide Background Image
#' Position. Defaults to `NULL`. Modifies the `.title-slide` class. Accepts
#' CSS
#' [background-position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position)
#' property values.
#' @param footnote_color Footnote text color (if `NA`, then it will be the same
#' color as `text_color`). Defaults to `NULL`. Modifies the `.footnote`
#' class.
#' @param footnote_font_size Footnote font size. Defaults to 0.9em. Modifies
#' the `.footnote` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values.
#' @param footnote_position_bottom Footnote location from bottom of screen.
#' Defaults to 60px. Modifies the `.footnote` class. Accepts CSS
#' [position](https://developer.mozilla.org/en-US/docs/Web/CSS/position_value)
#' property values.
#' @param left_column_subtle_color Left Column Text (not last). Defaults to
#' `apply_alpha(base_color, 0.6)`. Modifies the
#' `.left-column h2, .left-column h3` classes.
#' @param left_column_selected_color Left Column Current Selection. Defaults to
#' `base_color`. Modifies the
#' `.left-column h2:last-of-type, .left-column h3:last-child` classes.
#' @param blockquote_left_border_color Blockquote Left Border Color. Defaults
#' to `apply_alpha(base_color, 0.5)`. Modifies the `blockquote` element.
#' @param table_border_color Table top/bottom border. Defaults to #666.
#' Modifies the `table: border-top, border-bottom` elements.
#' @param table_row_border_color Table row inner bottom border. Defaults to
#' #ddd. Modifies the `table thead th: border-bottom` elements.
#' @param table_row_even_background_color Table Even Row Background Color.
#' Defaults to `darken_color(base_color, 0.8)`. Modifies the
#' `thead, tfoot, tr:nth-child(even)` elements.
#' @param base_font_size Base Font Size for All Slide Elements (must be `px`).
#' Defaults to 20px. Modifies the `html` element. The value of this variable
#' is also stored as a CSS variable that can be referenced with
#' `var(--base-font-size)` in any argument of a style function or in custom
#' CSS.
#' @param text_font_size Slide Body Text Font Size. Defaults to 1rem. Modifies
#' the `.remark-slide-content` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--text-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_h1_font_size h1 Header Text Font Size. Defaults to 2.75rem.
#' Modifies the `.remark-slide-content h1` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-h1-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_h2_font_size h2 Header Text Font Size. Defaults to 2.25rem.
#' Modifies the `.remark-slide-content h2` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-h2-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_h3_font_size h3 Header Text Font Size. Defaults to 1.75rem.
#' Modifies the `.remark-slide-content h3` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-h3-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_background_auto Add background under slide title automatically
#' for h1 header elements. If not enabled, use `class: header_background` to
#' enable. Defaults to `FALSE`.
#' @param header_background_color Background Color for h1 Header with
#' Background. Defaults to `header_color`. Modifies the
#' `.remark-slide-content h1` class. The value of this variable is also
#' stored as a CSS variable that can be referenced with
#' `var(--header-background-color)` in any argument of a style function or in
#' custom CSS.
#' @param header_background_text_color Text Color for h1 Header with
#' Background. Defaults to `background_color`. Modifies the
#' `.remark-slide-content h1` class. The value of this variable is also
#' stored as a CSS variable that can be referenced with
#' `var(--header-background-text-color)` in any argument of a style function
#' or in custom CSS.
#' @param header_background_padding Padding for h1 Header with Background.
#' Defaults to `NULL`. Modifies the `.remark-slide-content h1` class. Accepts
#' CSS [padding](https://developer.mozilla.org/en-US/docs/Web/CSS/padding)
#' property values.
#' @param header_background_content_padding_top Top Padding for Content in
#' Slide with Header with Background. Defaults to 7rem. Modifies the
#' `.remark-slide-content` class.
#' @param header_background_ignore_classes Slide Classes Where Header with
#' Background will not be Applied. Defaults to
#' `c('normal', 'inverse', 'title', 'middle', 'bottom')`. Modifies the
#' `.remark-slide-content` class.
#' @param text_slide_number_font_size Slide Number Text Font Size. Defaults to
#' 0.9rem. Modifies the `.remark-slide-number` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values.
#' @param text_font_google Use `google_font()` to specify body font. Defaults
#' to `NULL`. Modifies the `body` element.
#' @param text_font_family Body Text Font Family (xaringan default is
#' `'Droid Serif'`). Defaults to
#' `xaringanthemer_font_default("text_font_family")`. Modifies the `body`
#' element. The value of this variable is also stored as a CSS variable that
#' can be referenced with `var(--text-font-family)` in any argument of a
#' style function or in custom CSS.
#' @param text_font_weight Body Text Font Weight. Defaults to
#' `xaringanthemer_font_default("text_font_weight")`. Modifies the `body`
#' element. Accepts CSS
#' [font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight)
#' property values.
#' @param text_bold_font_weight Body Bold Text Font Weight. Defaults to bold.
#' Modifies the `strong` element.
#' @param text_font_url Body Text Font URL(s). Defaults to
#' `xaringanthemer_font_default("text_font_url")`. Modifies the
#' `@import url()` elements.
#' @param text_font_family_fallback Body Text Font Fallbacks. Defaults to
#' `xaringanthemer_font_default("text_font_family_fallback")`. Modifies the
#' `body` element. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--text-font-family-fallback)` in
#' any argument of a style function or in custom CSS.
#' @param text_font_base Body Text Base Font (Total Failure Fallback). Defaults
#' to sans-serif. Modifies the `body` element. The value of this variable is
#' also stored as a CSS variable that can be referenced with
#' `var(--text-font-base)` in any argument of a style function or in custom
#' CSS.
#' @param header_font_google Use `google_font()` to specify header font.
#' Defaults to `NULL`. Modifies the `body` element.
#' @param header_font_family Header Font Family (xaringan default is
#' `'Yanone Kaffeesatz'`). Defaults to
#' `xaringanthemer_font_default("header_font_family")`. Modifies the
#' `h1, h2, h3` elements. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-font-family)` in any
#' argument of a style function or in custom CSS.
#' @param header_font_weight Header Font Weight. Defaults to
#' `xaringanthemer_font_default("header_font_weight")`. Modifies the
#' `h1, h2, h3` elements. Accepts CSS
#' [font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight)
#' property values.
#' @param header_font_family_fallback Header Font Family Fallback. Defaults to
#' Georgia, serif. Modifies the `h1, h2, h3` elements. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--header-font-family-fallback)` in any argument of a style function
#' or in custom CSS.
#' @param header_font_url Header Font URL. Defaults to
#' `xaringanthemer_font_default("header_font_url")`. Modifies the
#' `@import url` elements.
#' @param code_font_google Use `google_font()` to specify code font. Defaults
#' to `NULL`. Modifies the `body` element.
#' @param code_font_family Code Font Family. Defaults to
#' `xaringanthemer_font_default("code_font_family")`. Modifies the
#' `.remark-code, .remark-inline-code` classes. The value of this variable is
#' also stored as a CSS variable that can be referenced with
#' `var(--code-font-family)` in any argument of a style function or in custom
#' CSS.
#' @param code_font_size Code Text Font Size. Defaults to 0.9rem. Modifies the
#' `.remark-inline` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--code-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param code_font_url Code Font URL. Defaults to
#' `xaringanthemer_font_default("code_font_url")`. Modifies the `@import url`
#' elements.
#' @param code_font_family_fallback Code Font Fallback. Defaults to
#' `xaringanthemer_font_default("code_font_family_fallback")`. Modifies the
#' `.remark-code, .remark-inline-code` classes.
#' @param link_decoration Text decoration of links. Defaults to none. Modifies
#' the `a, a > code` elements. Accepts CSS
#' [text-decoration](https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration)
#' property values.
#' @template theme_params
#' @template style-usage
#' @template style_mono_accent_inverse
#' @family Monotone themes
#' @export
style_mono_accent_inverse <- function(
base_color = "#3C989E",
white_color = "#FFFFFF",
black_color = darken_color(base_color, 0.9),
text_color = white_color,
header_color = base_color,
background_color = black_color,
link_color = base_color,
text_bold_color = base_color,
text_slide_number_color = base_color,
padding = "16px 64px 16px 64px",
background_image = NULL,
background_size = NULL,
background_position = NULL,
code_highlight_color = "rgba(255,255,0,0.5)",
code_inline_color = base_color,
code_inline_background_color = NULL,
code_inline_font_size = "1em",
inverse_background_color = base_color,
inverse_text_color = black_color,
inverse_text_shadow = FALSE,
inverse_header_color = inverse_text_color,
inverse_link_color = link_color,
title_slide_text_color = inverse_text_color,
title_slide_background_color = inverse_background_color,
title_slide_background_image = NULL,
title_slide_background_size = NULL,
title_slide_background_position = NULL,
footnote_color = NULL,
footnote_font_size = "0.9em",
footnote_position_bottom = "60px",
left_column_subtle_color = apply_alpha(base_color, 0.6),
left_column_selected_color = base_color,
blockquote_left_border_color = apply_alpha(base_color, 0.5),
table_border_color = "#666",
table_row_border_color = "#ddd",
table_row_even_background_color = darken_color(base_color, 0.8),
base_font_size = "20px",
text_font_size = "1rem",
header_h1_font_size = "2.75rem",
header_h2_font_size = "2.25rem",
header_h3_font_size = "1.75rem",
header_background_auto = FALSE,
header_background_color = header_color,
header_background_text_color = background_color,
header_background_padding = NULL,
header_background_content_padding_top = "7rem",
header_background_ignore_classes = c('normal', 'inverse', 'title', 'middle', 'bottom'),
text_slide_number_font_size = "0.9rem",
text_font_google = NULL,
text_font_family = xaringanthemer_font_default("text_font_family"),
text_font_weight = xaringanthemer_font_default("text_font_weight"),
text_bold_font_weight = "bold",
text_font_url = xaringanthemer_font_default("text_font_url"),
text_font_family_fallback = xaringanthemer_font_default("text_font_family_fallback"),
text_font_base = "sans-serif",
header_font_google = NULL,
header_font_family = xaringanthemer_font_default("header_font_family"),
header_font_weight = xaringanthemer_font_default("header_font_weight"),
header_font_family_fallback = "Georgia, serif",
header_font_url = xaringanthemer_font_default("header_font_url"),
code_font_google = NULL,
code_font_family = xaringanthemer_font_default("code_font_family"),
code_font_size = "0.9rem",
code_font_url = xaringanthemer_font_default("code_font_url"),
code_font_family_fallback = xaringanthemer_font_default("code_font_family_fallback"),
link_decoration = "none",
colors = NULL,
extra_css = NULL,
extra_fonts = NULL,
outfile = "xaringan-themer.css"
) {
# DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R
base_color <- unname(base_color)
white_color <- unname(white_color)
black_color <- unname(black_color)
colors <- c(base = base_color, white = white_color, black = black_color, colors)
eval(parse(text = call_style_xaringan()))
}
================================================
FILE: R/style_mono_dark.R
================================================
# Generated by inst/scripts/generate_theme_functions.R: do not edit by hand
#' @param base_color Monotone Base Color, works best with a light color..
#' Defaults to #cbf7ed. Used in multiple CSS rules. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--base)` in any argument of a style function or in custom CSS.
#' @param white_color Brightest color used, default is a very light version of
#' `base_color`. Defaults to `lighten_color(base_color, 0.8)`. Used in
#' multiple CSS rules. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--white)` in any argument of a
#' style function or in custom CSS.
#' @param black_color Darkest color used, default is a very dark, version of
#' `base_color`. Defaults to `darken_color(base_color, 0.85)`. Used in
#' multiple CSS rules. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--black)` in any argument of a
#' style function or in custom CSS.
#' @param text_color Text Color. Defaults to `white_color`. Modifies the `body`
#' element. The value of this variable is also stored as a CSS variable that
#' can be referenced with `var(--text_color)` in any argument of a style
#' function or in custom CSS.
#' @param header_color Header Color. Defaults to `base_color`. Modifies the
#' `h1, h2, h3` elements. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-color)` in any argument
#' of a style function or in custom CSS.
#' @param background_color Slide Background Color. Defaults to `black_color`.
#' Modifies the `.remark-slide-content` class. The value of this variable is
#' also stored as a CSS variable that can be referenced with
#' `var(--background-color)` in any argument of a style function or in custom
#' CSS.
#' @param link_color Link Color. Defaults to `base_color`. Modifies the
#' `a, a > code` elements. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--link-color)` in any argument
#' of a style function or in custom CSS.
#' @param text_bold_color Bold Text Color. Defaults to `base_color`. Modifies
#' the `strong` element. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--text-bold-color)` in any
#' argument of a style function or in custom CSS.
#' @param text_slide_number_color Slide Number Color. Defaults to `base_color`.
#' Modifies the `.remark-slide-number` class.
#' @param padding Slide Padding in `top right [bottom left]` format. Defaults
#' to 16px 64px 16px 64px. Modifies the `.remark-slide-content` class.
#' Accepts CSS
#' [padding](https://developer.mozilla.org/en-US/docs/Web/CSS/padding)
#' property values.
#' @param background_image Background image applied to each *and every* slide.
#' Set `title_slide_background_image = "none"` to remove the background image
#' from the title slide. Defaults to `NULL`. Modifies the
#' `.remark-slide-content` class.
#' @param background_size Background image size, requires `background_image` to
#' be set. If `background_image` is set, `background_size` will default to
#' `cover` so the background fills the screen. If both `background_image` and
#' `background_position` are set, will default to 100 percent. Defaults to
#' `NULL`. Modifies the `.remark-slide-content` class. Accepts CSS
#' [background-size](https://developer.mozilla.org/en-US/docs/Web/CSS/background-size)
#' property values.
#' @param background_position Background image position, requires
#' `background_image` to be set, and it is recommended to adjust
#' `background_size`. Defaults to `NULL`. Modifies the
#' `.remark-slide-content` class. Accepts CSS
#' [background-position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position)
#' property values.
#' @param code_highlight_color Code Line Highlight. Defaults to
#' rgba(255,255,0,0.5). Modifies the `.remark-code-line-highlighted` class.
#' The value of this variable is also stored as a CSS variable that can be
#' referenced with `var(--code-highlight-color)` in any argument of a style
#' function or in custom CSS.
#' @param code_inline_color Inline Code Color. Defaults to `base_color`.
#' Modifies the `.remark-inline-code` class.
#' @param code_inline_background_color Inline Code Background Color. Defaults
#' to `NULL`. Modifies the `.remark-inline-code` class.
#' @param code_inline_font_size Inline Code Text Font Size. Defaults to 1em.
#' Modifies the `.remark-inline-code` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--code-inline-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param inverse_background_color Inverse Background Color. Defaults to
#' `base_color`. Modifies the `.inverse` class. The value of this variable is
#' also stored as a CSS variable that can be referenced with
#' `var(--inverse-background-color)` in any argument of a style function or
#' in custom CSS.
#' @param inverse_text_color Inverse Text Color. Defaults to `black_color`.
#' Modifies the `.inverse` class. The value of this variable is also stored
#' as a CSS variable that can be referenced with `var(--inverse-text-color)`
#' in any argument of a style function or in custom CSS.
#' @param inverse_text_shadow Enables Shadow on text of inverse slides.
#' Defaults to `FALSE`. Modifies the `.inverse` class.
#' @param inverse_header_color Inverse Header Color. Defaults to
#' `inverse_text_color`. Modifies the `.inverse h1, .inverse h2, .inverse h3`
#' classes. The value of this variable is also stored as a CSS variable that
#' can be referenced with `var(--inverse-header-color)` in any argument of a
#' style function or in custom CSS.
#' @param inverse_link_color Inverse Link Color. Defaults to `link_color`.
#' Modifies the `.inverse a, .inverse a > code` classes. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--inverse-link-color)` in any argument of a style function or in
#' custom CSS.
#' @param title_slide_text_color Title Slide Text Color. Defaults to
#' `inverse_text_color`. Modifies the `.title-slide` class. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--title-slide-text-color)` in any argument of a style function or in
#' custom CSS.
#' @param title_slide_background_color Title Slide Background Color. Defaults
#' to `inverse_background_color`. Modifies the `.title-slide` class. The
#' value of this variable is also stored as a CSS variable that can be
#' referenced with `var(--title-slide-background-color)` in any argument of a
#' style function or in custom CSS.
#' @param title_slide_background_image Title Slide Background Image URL.
#' Defaults to `NULL`. Modifies the `.title-slide` class.
#' @param title_slide_background_size Title Slide Background Image Size,
#' defaults to "cover" if background image is set. Defaults to `NULL`.
#' Modifies the `.title-slide` class. Accepts CSS
#' [background-size](https://developer.mozilla.org/en-US/docs/Web/CSS/background-size)
#' property values.
#' @param title_slide_background_position Title Slide Background Image
#' Position. Defaults to `NULL`. Modifies the `.title-slide` class. Accepts
#' CSS
#' [background-position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position)
#' property values.
#' @param footnote_color Footnote text color (if `NA`, then it will be the same
#' color as `text_color`). Defaults to `NULL`. Modifies the `.footnote`
#' class.
#' @param footnote_font_size Footnote font size. Defaults to 0.9em. Modifies
#' the `.footnote` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values.
#' @param footnote_position_bottom Footnote location from bottom of screen.
#' Defaults to 60px. Modifies the `.footnote` class. Accepts CSS
#' [position](https://developer.mozilla.org/en-US/docs/Web/CSS/position_value)
#' property values.
#' @param left_column_subtle_color Left Column Text (not last). Defaults to
#' `apply_alpha(base_color, 0.6)`. Modifies the
#' `.left-column h2, .left-column h3` classes.
#' @param left_column_selected_color Left Column Current Selection. Defaults to
#' `base_color`. Modifies the
#' `.left-column h2:last-of-type, .left-column h3:last-child` classes.
#' @param blockquote_left_border_color Blockquote Left Border Color. Defaults
#' to `apply_alpha(base_color, 0.5)`. Modifies the `blockquote` element.
#' @param table_border_color Table top/bottom border. Defaults to #666.
#' Modifies the `table: border-top, border-bottom` elements.
#' @param table_row_border_color Table row inner bottom border. Defaults to
#' #ddd. Modifies the `table thead th: border-bottom` elements.
#' @param table_row_even_background_color Table Even Row Background Color.
#' Defaults to `darken_color(base_color, 0.7)`. Modifies the
#' `thead, tfoot, tr:nth-child(even)` elements.
#' @param base_font_size Base Font Size for All Slide Elements (must be `px`).
#' Defaults to 20px. Modifies the `html` element. The value of this variable
#' is also stored as a CSS variable that can be referenced with
#' `var(--base-font-size)` in any argument of a style function or in custom
#' CSS.
#' @param text_font_size Slide Body Text Font Size. Defaults to 1rem. Modifies
#' the `.remark-slide-content` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--text-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_h1_font_size h1 Header Text Font Size. Defaults to 2.75rem.
#' Modifies the `.remark-slide-content h1` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-h1-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_h2_font_size h2 Header Text Font Size. Defaults to 2.25rem.
#' Modifies the `.remark-slide-content h2` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-h2-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_h3_font_size h3 Header Text Font Size. Defaults to 1.75rem.
#' Modifies the `.remark-slide-content h3` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-h3-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param header_background_auto Add background under slide title automatically
#' for h1 header elements. If not enabled, use `class: header_background` to
#' enable. Defaults to `FALSE`.
#' @param header_background_color Background Color for h1 Header with
#' Background. Defaults to `header_color`. Modifies the
#' `.remark-slide-content h1` class. The value of this variable is also
#' stored as a CSS variable that can be referenced with
#' `var(--header-background-color)` in any argument of a style function or in
#' custom CSS.
#' @param header_background_text_color Text Color for h1 Header with
#' Background. Defaults to `background_color`. Modifies the
#' `.remark-slide-content h1` class. The value of this variable is also
#' stored as a CSS variable that can be referenced with
#' `var(--header-background-text-color)` in any argument of a style function
#' or in custom CSS.
#' @param header_background_padding Padding for h1 Header with Background.
#' Defaults to `NULL`. Modifies the `.remark-slide-content h1` class. Accepts
#' CSS [padding](https://developer.mozilla.org/en-US/docs/Web/CSS/padding)
#' property values.
#' @param header_background_content_padding_top Top Padding for Content in
#' Slide with Header with Background. Defaults to 7rem. Modifies the
#' `.remark-slide-content` class.
#' @param header_background_ignore_classes Slide Classes Where Header with
#' Background will not be Applied. Defaults to
#' `c('normal', 'inverse', 'title', 'middle', 'bottom')`. Modifies the
#' `.remark-slide-content` class.
#' @param text_slide_number_font_size Slide Number Text Font Size. Defaults to
#' 0.9rem. Modifies the `.remark-slide-number` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values.
#' @param text_font_google Use `google_font()` to specify body font. Defaults
#' to `NULL`. Modifies the `body` element.
#' @param text_font_family Body Text Font Family (xaringan default is
#' `'Droid Serif'`). Defaults to
#' `xaringanthemer_font_default("text_font_family")`. Modifies the `body`
#' element. The value of this variable is also stored as a CSS variable that
#' can be referenced with `var(--text-font-family)` in any argument of a
#' style function or in custom CSS.
#' @param text_font_weight Body Text Font Weight. Defaults to
#' `xaringanthemer_font_default("text_font_weight")`. Modifies the `body`
#' element. Accepts CSS
#' [font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight)
#' property values.
#' @param text_bold_font_weight Body Bold Text Font Weight. Defaults to bold.
#' Modifies the `strong` element.
#' @param text_font_url Body Text Font URL(s). Defaults to
#' `xaringanthemer_font_default("text_font_url")`. Modifies the
#' `@import url()` elements.
#' @param text_font_family_fallback Body Text Font Fallbacks. Defaults to
#' `xaringanthemer_font_default("text_font_family_fallback")`. Modifies the
#' `body` element. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--text-font-family-fallback)` in
#' any argument of a style function or in custom CSS.
#' @param text_font_base Body Text Base Font (Total Failure Fallback). Defaults
#' to sans-serif. Modifies the `body` element. The value of this variable is
#' also stored as a CSS variable that can be referenced with
#' `var(--text-font-base)` in any argument of a style function or in custom
#' CSS.
#' @param header_font_google Use `google_font()` to specify header font.
#' Defaults to `NULL`. Modifies the `body` element.
#' @param header_font_family Header Font Family (xaringan default is
#' `'Yanone Kaffeesatz'`). Defaults to
#' `xaringanthemer_font_default("header_font_family")`. Modifies the
#' `h1, h2, h3` elements. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-font-family)` in any
#' argument of a style function or in custom CSS.
#' @param header_font_weight Header Font Weight. Defaults to
#' `xaringanthemer_font_default("header_font_weight")`. Modifies the
#' `h1, h2, h3` elements. Accepts CSS
#' [font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight)
#' property values.
#' @param header_font_family_fallback Header Font Family Fallback. Defaults to
#' Georgia, serif. Modifies the `h1, h2, h3` elements. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--header-font-family-fallback)` in any argument of a style function
#' or in custom CSS.
#' @param header_font_url Header Font URL. Defaults to
#' `xaringanthemer_font_default("header_font_url")`. Modifies the
#' `@import url` elements.
#' @param code_font_google Use `google_font()` to specify code font. Defaults
#' to `NULL`. Modifies the `body` element.
#' @param code_font_family Code Font Family. Defaults to
#' `xaringanthemer_font_default("code_font_family")`. Modifies the
#' `.remark-code, .remark-inline-code` classes. The value of this variable is
#' also stored as a CSS variable that can be referenced with
#' `var(--code-font-family)` in any argument of a style function or in custom
#' CSS.
#' @param code_font_size Code Text Font Size. Defaults to 0.9rem. Modifies the
#' `.remark-inline` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--code-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param code_font_url Code Font URL. Defaults to
#' `xaringanthemer_font_default("code_font_url")`. Modifies the `@import url`
#' elements.
#' @param code_font_family_fallback Code Font Fallback. Defaults to
#' `xaringanthemer_font_default("code_font_family_fallback")`. Modifies the
#' `.remark-code, .remark-inline-code` classes.
#' @param link_decoration Text decoration of links. Defaults to none. Modifies
#' the `a, a > code` elements. Accepts CSS
#' [text-decoration](https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration)
#' property values.
#' @template theme_params
#' @template style-usage
#' @template style_mono_dark
#' @family Monotone themes
#' @export
style_mono_dark <- function(
base_color = "#cbf7ed",
white_color = lighten_color(base_color, 0.8),
black_color = darken_color(base_color, 0.85),
text_color = white_color,
header_color = base_color,
background_color = black_color,
link_color = base_color,
text_bold_color = base_color,
text_slide_number_color = base_color,
padding = "16px 64px 16px 64px",
background_image = NULL,
background_size = NULL,
background_position = NULL,
code_highlight_color = "rgba(255,255,0,0.5)",
code_inline_color = base_color,
code_inline_background_color = NULL,
code_inline_font_size = "1em",
inverse_background_color = base_color,
inverse_text_color = black_color,
inverse_text_shadow = FALSE,
inverse_header_color = inverse_text_color,
inverse_link_color = link_color,
title_slide_text_color = inverse_text_color,
title_slide_background_color = inverse_background_color,
title_slide_background_image = NULL,
title_slide_background_size = NULL,
title_slide_background_position = NULL,
footnote_color = NULL,
footnote_font_size = "0.9em",
footnote_position_bottom = "60px",
left_column_subtle_color = apply_alpha(base_color, 0.6),
left_column_selected_color = base_color,
blockquote_left_border_color = apply_alpha(base_color, 0.5),
table_border_color = "#666",
table_row_border_color = "#ddd",
table_row_even_background_color = darken_color(base_color, 0.7),
base_font_size = "20px",
text_font_size = "1rem",
header_h1_font_size = "2.75rem",
header_h2_font_size = "2.25rem",
header_h3_font_size = "1.75rem",
header_background_auto = FALSE,
header_background_color = header_color,
header_background_text_color = background_color,
header_background_padding = NULL,
header_background_content_padding_top = "7rem",
header_background_ignore_classes = c('normal', 'inverse', 'title', 'middle', 'bottom'),
text_slide_number_font_size = "0.9rem",
text_font_google = NULL,
text_font_family = xaringanthemer_font_default("text_font_family"),
text_font_weight = xaringanthemer_font_default("text_font_weight"),
text_bold_font_weight = "bold",
text_font_url = xaringanthemer_font_default("text_font_url"),
text_font_family_fallback = xaringanthemer_font_default("text_font_family_fallback"),
text_font_base = "sans-serif",
header_font_google = NULL,
header_font_family = xaringanthemer_font_default("header_font_family"),
header_font_weight = xaringanthemer_font_default("header_font_weight"),
header_font_family_fallback = "Georgia, serif",
header_font_url = xaringanthemer_font_default("header_font_url"),
code_font_google = NULL,
code_font_family = xaringanthemer_font_default("code_font_family"),
code_font_size = "0.9rem",
code_font_url = xaringanthemer_font_default("code_font_url"),
code_font_family_fallback = xaringanthemer_font_default("code_font_family_fallback"),
link_decoration = "none",
colors = NULL,
extra_css = NULL,
extra_fonts = NULL,
outfile = "xaringan-themer.css"
) {
# DO NOT EDIT - Generated from inst/scripts/generate_theme_functions.R
base_color <- unname(base_color)
white_color <- unname(white_color)
black_color <- unname(black_color)
colors <- c(base = base_color, white = white_color, black = black_color, colors)
eval(parse(text = call_style_xaringan()))
}
================================================
FILE: R/style_mono_light.R
================================================
# Generated by inst/scripts/generate_theme_functions.R: do not edit by hand
#' @param base_color Monotone base color, works best with a strong color.
#' Defaults to #23395b. Used in multiple CSS rules. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--base)` in any argument of a style function or in custom CSS.
#' @param white_color Brightest color used, default is a very light version of
#' `base_color`. Defaults to `lighten_color(base_color, 0.9)`. Used in
#' multiple CSS rules. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--white)` in any argument of a
#' style function or in custom CSS.
#' @param black_color Darkest color used, default is a very dark, version of
#' `base_color`. Defaults to `darken_color(base_color, 0.3)`. Used in
#' multiple CSS rules. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--black)` in any argument of a
#' style function or in custom CSS.
#' @param text_color Text Color. Defaults to `black_color`. Modifies the `body`
#' element. The value of this variable is also stored as a CSS variable that
#' can be referenced with `var(--text_color)` in any argument of a style
#' function or in custom CSS.
#' @param header_color Header Color. Defaults to `base_color`. Modifies the
#' `h1, h2, h3` elements. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--header-color)` in any argument
#' of a style function or in custom CSS.
#' @param background_color Slide Background Color. Defaults to `white_color`.
#' Modifies the `.remark-slide-content` class. The value of this variable is
#' also stored as a CSS variable that can be referenced with
#' `var(--background-color)` in any argument of a style function or in custom
#' CSS.
#' @param link_color Link Color. Defaults to `base_color`. Modifies the
#' `a, a > code` elements. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--link-color)` in any argument
#' of a style function or in custom CSS.
#' @param text_bold_color Bold Text Color. Defaults to `base_color`. Modifies
#' the `strong` element. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--text-bold-color)` in any
#' argument of a style function or in custom CSS.
#' @param text_slide_number_color Slide Number Color. Defaults to `base_color`.
#' Modifies the `.remark-slide-number` class.
#' @param padding Slide Padding in `top right [bottom left]` format. Defaults
#' to 16px 64px 16px 64px. Modifies the `.remark-slide-content` class.
#' Accepts CSS
#' [padding](https://developer.mozilla.org/en-US/docs/Web/CSS/padding)
#' property values.
#' @param background_image Background image applied to each *and every* slide.
#' Set `title_slide_background_image = "none"` to remove the background image
#' from the title slide. Defaults to `NULL`. Modifies the
#' `.remark-slide-content` class.
#' @param background_size Background image size, requires `background_image` to
#' be set. If `background_image` is set, `background_size` will default to
#' `cover` so the background fills the screen. If both `background_image` and
#' `background_position` are set, will default to 100 percent. Defaults to
#' `NULL`. Modifies the `.remark-slide-content` class. Accepts CSS
#' [background-size](https://developer.mozilla.org/en-US/docs/Web/CSS/background-size)
#' property values.
#' @param background_position Background image position, requires
#' `background_image` to be set, and it is recommended to adjust
#' `background_size`. Defaults to `NULL`. Modifies the
#' `.remark-slide-content` class. Accepts CSS
#' [background-position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position)
#' property values.
#' @param code_highlight_color Code Line Highlight. Defaults to
#' rgba(255,255,0,0.5). Modifies the `.remark-code-line-highlighted` class.
#' The value of this variable is also stored as a CSS variable that can be
#' referenced with `var(--code-highlight-color)` in any argument of a style
#' function or in custom CSS.
#' @param code_inline_color Inline Code Color. Defaults to `base_color`.
#' Modifies the `.remark-inline-code` class.
#' @param code_inline_background_color Inline Code Background Color. Defaults
#' to `NULL`. Modifies the `.remark-inline-code` class.
#' @param code_inline_font_size Inline Code Text Font Size. Defaults to 1em.
#' Modifies the `.remark-inline-code` class. Accepts CSS
#' [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size)
#' property values. The value of this variable is also stored as a CSS
#' variable that can be referenced with `var(--code-inline-font-size)` in any
#' argument of a style function or in custom CSS.
#' @param inverse_background_color Inverse Background Color. Defaults to
#' `base_color`. Modifies the `.inverse` class. The value of this variable is
#' also stored as a CSS variable that can be referenced with
#' `var(--inverse-background-color)` in any argument of a style function or
#' in custom CSS.
#' @param inverse_text_color Inverse Text Color. Defaults to `white_color`.
#' Modifies the `.inverse` class. The value of this variable is also stored
#' as a CSS variable that can be referenced with `var(--inverse-text-color)`
#' in any argument of a style function or in custom CSS.
#' @param inverse_text_shadow Enables Shadow on text of inverse slides.
#' Defaults to `FALSE`. Modifies the `.inverse` class.
#' @param inverse_header_color Inverse Header Color. Defaults to
#' `inverse_text_color`. Modifies the `.inverse h1, .inverse h2, .inverse h3`
#' classes. The value of this variable is also stored as a CSS variable that
#' can be referenced with `var(--inverse-header-color)` in any argument of a
#' style function or in custom CSS.
#' @param inverse_link_color Inverse Link Color. Defaults to `link_color`.
#' Modifies the `.inverse a, .inverse a > code` classes. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--inverse-link-color)` in any argument of a style function or in
#' custom CSS.
#' @param title_slide_text_color Title Slide Text Color. Defaults to
#' `inverse_text_color`. Modifies the `.title-slide` class. The value of this
#' variable is also stored as a CSS variable that can be referenced with
#' `var(--title-slide-text-color)` in any argument of a style function or in
#' custom CSS.
#' @param title_slide_background_color Title Slide Background Color. Defaults
#' to `inverse_background_color`. Modifies the `.title-slide` class. The
#' value of this variable is also stored as a CSS variable that can be
#' referenced with `var(--title-slide-background-color)` in any argument of a
#' style function or in custom CSS.
#' @param title_slide_background_image Title Slide Background Image URL.
#' Defaults to `NULL`. Modifies the `.title-slide` class.
#' @param title_slide_background_size Title Slide Background Image Size,
#' defaults to "cover" if background image is set. Defaults to `NULL`.
#' Modifies the `.title-slide` class. Accepts CSS
#' [background-size](https://developer.mozilla.org/en-US/docs/Web/CSS/background-size)
#' property values.
#' @param title_slide_background_position Title Slide Background Image
#' Position. Defaults to `NULL`. Modifies the `.title-slide` class. Accepts
#' CSS
#' [background-position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position)
#' property values.
#' @param footnote_color Footnote text color (if `NA`, then it will be the same
#' color as `text_color`). Defaults to `NULL`. Modifies the `.footnote`
#' class.
#' @param footnote_font_size Footnote font size. Defaults to 0.9em. Modifies
#' the `.footnote` class. Accep
gitextract_unwrwvs4/ ├── .Rbuildignore ├── .github/ │ ├── .gitignore │ └── workflows/ │ ├── R-CMD-check.yaml │ ├── pkg-maintenance.yaml │ └── pkgdown.yaml ├── .gitignore ├── DESCRIPTION ├── LICENSE ├── LICENSE.md ├── NAMESPACE ├── NEWS.md ├── R/ │ ├── color.R │ ├── css.R │ ├── ggplot2.R │ ├── style_duo.R │ ├── style_duo_accent.R │ ├── style_duo_accent_inverse.R │ ├── style_extra_css.R │ ├── style_font_default.R │ ├── style_mono_accent.R │ ├── style_mono_accent_inverse.R │ ├── style_mono_dark.R │ ├── style_mono_light.R │ ├── style_solarized_dark.R │ ├── style_solarized_light.R │ ├── style_xaringan.R │ ├── sysdata.rda │ ├── utils.R │ ├── utils_theme-gen.R │ ├── xaringanthemer-deprecated.R │ ├── xaringanthemer-package.R │ └── zzz.R ├── README.Rmd ├── README.md ├── cran-comments.md ├── data-raw/ │ └── theme_template_variables.R ├── index.Rmd ├── index.md ├── inst/ │ ├── fonts/ │ │ └── OFL.txt │ ├── resources/ │ │ ├── template.css │ │ └── template_title-slide.css │ ├── rmarkdown/ │ │ └── templates/ │ │ └── xaringanthemer/ │ │ ├── skeleton/ │ │ │ └── skeleton.Rmd │ │ └── template.yaml │ └── scripts/ │ ├── generate_theme_functions.R │ └── style_xaringan_body.R ├── make.R ├── man/ │ ├── apply_alpha.Rd │ ├── choose_dark_or_light.Rd │ ├── fragments/ │ │ ├── _colors.Rmd │ │ ├── _fonts.Rmd │ │ ├── _installation.Rmd │ │ ├── _quick-intro.Rmd │ │ ├── _tagline-gif.Rmd │ │ ├── _thanks.Rmd │ │ └── _themes.Rmd │ ├── google_font.Rd │ ├── google_language_codes.Rd │ ├── lighten_darken_color.Rd │ ├── scale_xaringan.Rd │ ├── style_duo.Rd │ ├── style_duo_accent.Rd │ ├── style_duo_accent_inverse.Rd │ ├── style_extra_css.Rd │ ├── style_mono_accent.Rd │ ├── style_mono_accent_inverse.Rd │ ├── style_mono_dark.Rd │ ├── style_mono_light.Rd │ ├── style_solarized_dark.Rd │ ├── style_solarized_light.Rd │ ├── style_xaringan.Rd │ ├── theme_xaringan.Rd │ ├── theme_xaringan_base.Rd │ ├── theme_xaringan_get_value.Rd │ ├── theme_xaringan_inverse.Rd │ ├── theme_xaringan_set_defaults.Rd │ ├── xaringanthemer-deprecated.Rd │ └── xaringanthemer-package.Rd ├── man-roxygen/ │ ├── style-usage.R │ ├── style_duo.R │ ├── style_duo_accent.R │ ├── style_duo_accent_inverse.R │ ├── style_mono_accent.R │ ├── style_mono_accent_inverse.R │ ├── style_mono_dark.R │ ├── style_mono_light.R │ ├── style_solarized_dark.R │ ├── style_solarized_light.R │ ├── style_xaringan.R │ └── theme_params.R ├── pkgdown/ │ ├── _pkgdown.yml │ └── extra.css ├── tests/ │ ├── testthat/ │ │ ├── _snaps/ │ │ │ └── utils.md │ │ ├── css/ │ │ │ ├── duo-header_bg.css │ │ │ ├── duo.css │ │ │ ├── duo_accent.css │ │ │ ├── duo_accent_inverse.css │ │ │ ├── google_fonts.css │ │ │ ├── mono_accent.css │ │ │ ├── mono_accent_inverse.css │ │ │ ├── mono_dark.css │ │ │ ├── mono_light-header_bg.css │ │ │ ├── mono_light.css │ │ │ ├── solarized_dark-header_bg.css │ │ │ ├── solarized_dark.css │ │ │ ├── solarized_light.css │ │ │ └── xaringan.css │ │ ├── helper-session.R │ │ ├── test-color.R │ │ ├── test-css.R │ │ ├── test-ggplot2.R │ │ ├── test-helpers.R │ │ ├── test-style_extra_css.R │ │ ├── test-style_xaringan.R │ │ ├── test-themes.R │ │ ├── test-utils.R │ │ └── test-xaringanthemer-deprecated.R │ └── testthat.R ├── vignettes/ │ ├── .gitignore │ ├── fonts.Rmd │ ├── ggplot2-themes.Rmd │ ├── template-variables.Rmd │ ├── themes.Rmd │ └── xaringanthemer.Rmd └── xaringanthemer.Rproj
Condensed preview — 124 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (838K chars).
[
{
"path": ".Rbuildignore",
"chars": 377,
"preview": "^.*\\.Rproj$\n^\\.Rproj\\.user$\n^README\\.Rmd$\n^LICENSE\\.md$\n^make\\.R$\n^vignettes/singles$\n^tests_$\n^_.+$\n^docs$\n^index\\.Rmd$"
},
{
"path": ".github/.gitignore",
"chars": 21,
"preview": "r-depends.rds\n*.html\n"
},
{
"path": ".github/workflows/R-CMD-check.yaml",
"chars": 1323,
"preview": "# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples\n# Need help debugging build failures? Start at"
},
{
"path": ".github/workflows/pkg-maintenance.yaml",
"chars": 265,
"preview": "on:\n pull_request:\n push:\n branches: main\n\nname: Package Maintenance\n\njobs:\n auto-pkg-maintenance:\n uses: rstud"
},
{
"path": ".github/workflows/pkgdown.yaml",
"chars": 1261,
"preview": "# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples\n# Need help debugging build failures? Start at"
},
{
"path": ".gitignore",
"chars": 1280,
"preview": ".Rproj.user\n.Rhistory\n.RData\n.Ruserdata\ninst/doc\n_tests\n_stuff\n\n.DS_Store\nREADME.html\n\n# vscode\n.history/\n\n# Directories"
},
{
"path": "DESCRIPTION",
"chars": 1229,
"preview": "Type: Package\nPackage: xaringanthemer\nTitle: Custom 'xaringan' CSS Themes\nVersion: 0.4.4.9000\nAuthors@R: \n person(\"Ga"
},
{
"path": "LICENSE",
"chars": 47,
"preview": "YEAR: 2025\nCOPYRIGHT HOLDER: Garrick Aden-Buie\n"
},
{
"path": "LICENSE.md",
"chars": 1076,
"preview": "# MIT License\n\nCopyright (c) 2020 Garrick Aden-Buie\n\nPermission is hereby granted, free of charge, to any person obtaini"
},
{
"path": "NAMESPACE",
"chars": 1428,
"preview": "# Generated by roxygen2: do not edit by hand\n\nS3method(print,google_font)\nS3method(print,xaringanthemer_default)\nexport("
},
{
"path": "NEWS.md",
"chars": 6525,
"preview": "# xaringanthemer (development version)\n\n# xaringanthemer 0.4.4\n\n- `scale_xaringan_continuous()` and `scale_xaringan_disc"
},
{
"path": "R/color.R",
"chars": 5690,
"preview": "#' @title Generate lighter or darker version of a color\n#' @description Produces a linear blend of the color with white "
},
{
"path": "R/css.R",
"chars": 2339,
"preview": "read_css_vars <- function(file = NULL) {\n if (is.null(file)) {\n css_candidates <- find_xaringan_themer_css()\n fil"
},
{
"path": "R/ggplot2.R",
"chars": 33747,
"preview": "#' A Plot Theme for ggplot2 by xaringanthemer\n#'\n#' @description\n#'\n#' `r lifecycle::badge(\"maturing\")`\n#'\n#' Creates \\p"
},
{
"path": "R/style_duo.R",
"chars": 20752,
"preview": "# Generated by inst/scripts/generate_theme_functions.R: do not edit by hand\n\n#' @param primary_color Duotone Primary Col"
},
{
"path": "R/style_duo_accent.R",
"chars": 21797,
"preview": "# Generated by inst/scripts/generate_theme_functions.R: do not edit by hand\n\n#' @param primary_color Duotone Primary Col"
},
{
"path": "R/style_duo_accent_inverse.R",
"chars": 21920,
"preview": "# Generated by inst/scripts/generate_theme_functions.R: do not edit by hand\n\n#' @param primary_color Duotone Primary Col"
},
{
"path": "R/style_extra_css.R",
"chars": 3992,
"preview": "#' Add Extra CSS Styles\n#'\n#' Adds css elements to target `outfile`, typically a xaringanthemer css file.\n#' The `css` a"
},
{
"path": "R/style_font_default.R",
"chars": 1198,
"preview": "#' @describeIn style_xaringan Default values for font family, weight, URLs and\n#' font fallbacks.\n#' @param font_arg A"
},
{
"path": "R/style_mono_accent.R",
"chars": 20832,
"preview": "# Generated by inst/scripts/generate_theme_functions.R: do not edit by hand\n\n#' @param base_color Monotone Base Color, w"
},
{
"path": "R/style_mono_accent_inverse.R",
"chars": 20992,
"preview": "# Generated by inst/scripts/generate_theme_functions.R: do not edit by hand\n\n#' @param base_color Monotone Base Color, w"
},
{
"path": "R/style_mono_dark.R",
"chars": 21026,
"preview": "# Generated by inst/scripts/generate_theme_functions.R: do not edit by hand\n\n#' @param base_color Monotone Base Color, w"
},
{
"path": "R/style_mono_light.R",
"chars": 21028,
"preview": "# Generated by inst/scripts/generate_theme_functions.R: do not edit by hand\n\n#' @param base_color Monotone base color, w"
},
{
"path": "R/style_solarized_dark.R",
"chars": 19536,
"preview": "# Generated by inst/scripts/generate_theme_functions.R: do not edit by hand\n\n#' @param text_color Text Color. Defaults t"
},
{
"path": "R/style_solarized_light.R",
"chars": 19538,
"preview": "# Generated by inst/scripts/generate_theme_functions.R: do not edit by hand\n\n#' @param text_color Text Color. Defaults t"
},
{
"path": "R/style_xaringan.R",
"chars": 25914,
"preview": "# Generated by inst/scripts/generate_theme_functions.R: do not edit by hand\n\n#' @param text_color Text Color. Defaults t"
},
{
"path": "R/utils.R",
"chars": 3432,
"preview": "`%||%` <- function(x, y) if (is.null(x)) y else x\n\n`%??%` <- function(x, y) if (!is.null(x)) y else NULL\n\nrequires_packa"
},
{
"path": "R/utils_theme-gen.R",
"chars": 1212,
"preview": "# nocov start\n# Theme Generating Helpers ----------------------------------------------\n\nplural_element <- function(css_"
},
{
"path": "R/xaringanthemer-deprecated.R",
"chars": 3620,
"preview": "#' Deprecated or renamed functions\n#'\n#' These functions in xaringanthemer have been deprecated or renamed.\n#'\n#' @param"
},
{
"path": "R/xaringanthemer-package.R",
"chars": 1787,
"preview": "#' @importFrom grDevices col2rgb rgb rgb2hsv hsv\n#' @keywords internal\n\"_PACKAGE\"\n\nxaringanthemer_env <- new.env(parent "
},
{
"path": "R/zzz.R",
"chars": 261,
"preview": "# nocov start\n.onLoad <- function(libname, pkgname, ...) {\n\n if (\"knitr\" %in% loadedNamespaces()) {\n set_fig_showtex"
},
{
"path": "README.Rmd",
"chars": 1449,
"preview": "---\noutput: github_document\n---\n\n<!-- README.md is generated from README.Rmd. Please edit that file -->\n\n```{r setup, in"
},
{
"path": "README.md",
"chars": 1688,
"preview": "\n<!-- README.md is generated from README.Rmd. Please edit that file -->\n\n# xaringanthemer <img src=\"man/figures/logo.png"
},
{
"path": "cran-comments.md",
"chars": 123,
"preview": "## R CMD check results\n\n0 errors | 0 warnings | 0 note\n\nThis is a minor maintenance release to address changes in ggplot"
},
{
"path": "data-raw/theme_template_variables.R",
"chars": 24737,
"preview": "#nocov start\ntemplate_variables <- tibble::tribble(\n ~ variable, ~ default, ~ element, ~ description, ~ css_variable\n "
},
{
"path": "index.Rmd",
"chars": 1669,
"preview": "---\noutput: github_document\n---\n\n<!-- README.md is generated from README.Rmd. Please edit that file -->\n\n```{r setup, in"
},
{
"path": "index.md",
"chars": 4274,
"preview": "\n<!-- README.md is generated from README.Rmd. Please edit that file -->\n\n# xaringanthemer <img src=\"man/figures/logo.png"
},
{
"path": "inst/fonts/OFL.txt",
"chars": 4503,
"preview": "Copyright 2019 Alfredo Marco Pradil (https://hanken.co/), with Reserved Font Name \"Glacial Indifference\".\n\r\n\r\nThis Font "
},
{
"path": "inst/resources/template.css",
"chars": 8987,
"preview": "/* -------------------------------------------------------\n *\n * !! This file was generated by xaringanthemer !!\n *\n"
},
{
"path": "inst/resources/template_title-slide.css",
"chars": 473,
"preview": ".title-slide, .title-slide h1, .title-slide h2, .title-slide h3 {\n background-color: #fff !important;\n color: #222 !im"
},
{
"path": "inst/rmarkdown/templates/xaringanthemer/skeleton/skeleton.Rmd",
"chars": 6417,
"preview": "---\ntitle: \"Presentation Ninja\"\nsubtitle: \"⚔️ xaringan +<br/>😎 xaringanthemer\" \nauthor: \n - \"Yih"
},
{
"path": "inst/rmarkdown/templates/xaringanthemer/template.yaml",
"chars": 184,
"preview": "name: Ninja Themed Presentation\ndescription: >\n Create a themed presentation using the xaringanthemer package, to make "
},
{
"path": "inst/scripts/generate_theme_functions.R",
"chars": 6011,
"preview": "source(here::here(\"R/utils_theme-gen.R\"))\nload(here::here(\"R/sysdata.rda\"))\n# R/theme_settings.R contains element_descri"
},
{
"path": "inst/scripts/style_xaringan_body.R",
"chars": 6159,
"preview": "force(text_font_family)\nforce(text_font_weight)\nforce(text_font_url)\nforce(text_font_family_fallback)\nforce(header_font_"
},
{
"path": "make.R",
"chars": 548,
"preview": "callr::rscript(\"data-raw/theme_template_variables.R\")\nmessage(\"Building theme functions\")\ncallr::rscript(\"generate_theme"
},
{
"path": "man/apply_alpha.Rd",
"chars": 773,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/color.R\n\\name{apply_alpha}\n\\alias{apply_al"
},
{
"path": "man/choose_dark_or_light.Rd",
"chars": 1307,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/color.R\n\\name{choose_dark_or_light}\n\\alias"
},
{
"path": "man/fragments/_colors.Rmd",
"chars": 1274,
"preview": "When designing your xaringan theme,\nyou may have additional colors in your desired color palette\nbeyond those used in th"
},
{
"path": "man/fragments/_fonts.Rmd",
"chars": 4158,
"preview": "<!-- Need to set [adding-custom-css] -->\n\n[google-fonts]: https://fonts.google.com\n\n<link href=\"https://fonts.googleapis"
},
{
"path": "man/fragments/_installation.Rmd",
"chars": 304,
"preview": "You can install **xaringanthemer** from CRAN\n\n```r\ninstall.packages(\"xaringanthemer\")\n```\n\nor you can install the develo"
},
{
"path": "man/fragments/_quick-intro.Rmd",
"chars": 3126,
"preview": "<!-- Set link to theme-settings, template-variables, theme functions -->\n\n```{r include=FALSE}\nIN_PKGDOWN <- identical(S"
},
{
"path": "man/fragments/_tagline-gif.Rmd",
"chars": 308,
"preview": "[xaringan]: https://github.com/yihui/xaringan\n\nGive your [xaringan] slides some style with **xaringanthemer** within you"
},
{
"path": "man/fragments/_thanks.Rmd",
"chars": 553,
"preview": "***\n\n[xaringan]: https://github.com/yihui/xaringan\n[remarkjs]: https://github.com/gnab/remark\n\n**xaringanthemer** was bu"
},
{
"path": "man/fragments/_themes.Rmd",
"chars": 4081,
"preview": "**xaringanthemer** includes a number of functions that provide\nthemed **xaringan** styles.\nAll of the styling functions "
},
{
"path": "man/google_font.Rd",
"chars": 872,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/utils.R\n\\name{google_font}\n\\alias{google_f"
},
{
"path": "man/google_language_codes.Rd",
"chars": 839,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/utils.R\n\\name{google_language_codes}\n\\alia"
},
{
"path": "man/lighten_darken_color.Rd",
"chars": 995,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/color.R\n\\name{lighten_darken_color}\n\\alias"
},
{
"path": "man/scale_xaringan.Rd",
"chars": 4779,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/ggplot2.R\n\\name{scale_xaringan}\n\\alias{sca"
},
{
"path": "man/style_duo.Rd",
"chars": 22903,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/style_duo.R\n\\name{style_duo}\n\\alias{style_"
},
{
"path": "man/style_duo_accent.Rd",
"chars": 23854,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/style_duo_accent.R\n\\name{style_duo_accent}"
},
{
"path": "man/style_duo_accent_inverse.Rd",
"chars": 24003,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/style_duo_accent_inverse.R\n\\name{style_duo"
},
{
"path": "man/style_extra_css.Rd",
"chars": 1453,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/style_extra_css.R\n\\name{style_extra_css}\n\\"
},
{
"path": "man/style_mono_accent.Rd",
"chars": 23016,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/style_mono_accent.R\n\\name{style_mono_accen"
},
{
"path": "man/style_mono_accent_inverse.Rd",
"chars": 23212,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/style_mono_accent_inverse.R\n\\name{style_mo"
},
{
"path": "man/style_mono_dark.Rd",
"chars": 23150,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/style_mono_dark.R\n\\name{style_mono_dark}\n\\"
},
{
"path": "man/style_mono_light.Rd",
"chars": 23155,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/style_mono_light.R\n\\name{style_mono_light}"
},
{
"path": "man/style_solarized_dark.Rd",
"chars": 21894,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/style_solarized_dark.R\n\\name{style_solariz"
},
{
"path": "man/style_solarized_light.Rd",
"chars": 21899,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/style_solarized_light.R\n\\name{style_solari"
},
{
"path": "man/style_xaringan.Rd",
"chars": 22058,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/style_font_default.R, R/style_xaringan.R\n\\"
},
{
"path": "man/theme_xaringan.Rd",
"chars": 4356,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/ggplot2.R\n\\name{theme_xaringan}\n\\alias{the"
},
{
"path": "man/theme_xaringan_base.Rd",
"chars": 4961,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/ggplot2.R\n\\name{theme_xaringan_base}\n\\alia"
},
{
"path": "man/theme_xaringan_get_value.Rd",
"chars": 3576,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/ggplot2.R\n\\name{theme_xaringan_get_value}\n"
},
{
"path": "man/theme_xaringan_inverse.Rd",
"chars": 4459,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/ggplot2.R\n\\name{theme_xaringan_inverse}\n\\a"
},
{
"path": "man/theme_xaringan_set_defaults.Rd",
"chars": 2158,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/ggplot2.R\n\\name{theme_xaringan_set_default"
},
{
"path": "man/xaringanthemer-deprecated.Rd",
"chars": 1961,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/xaringanthemer-deprecated.R\n\\name{xaringan"
},
{
"path": "man/xaringanthemer-package.Rd",
"chars": 1079,
"preview": "% Generated by roxygen2: do not edit by hand\n% Please edit documentation in R/xaringanthemer-package.R\n\\docType{package}"
},
{
"path": "man-roxygen/style-usage.R",
"chars": 592,
"preview": "#' @section Usage: To use the styles created by this theme function, make sure\n#' that you use `xaringan-themer.css` a"
},
{
"path": "man-roxygen/style_duo.R",
"chars": 532,
"preview": "#' @title Duotone Theme\n#' @description A duotone theme designed to work well with two complementary\n#' colors.\n#' @ex"
},
{
"path": "man-roxygen/style_duo_accent.R",
"chars": 591,
"preview": "#' @title Duotone Accent Theme\n#' @description An default xaringan theme with a two colors used for color\n#' accents o"
},
{
"path": "man-roxygen/style_duo_accent_inverse.R",
"chars": 618,
"preview": "#' @title Duotone Accent Inverse Theme\n#' @description An \"inverted\" default xaringan theme with a two colors used\n#' "
},
{
"path": "man-roxygen/style_mono_accent.R",
"chars": 559,
"preview": "#' @title Monotone Accent Theme\n#' @description The default xaringan theme with a single color used for color\n#' accen"
},
{
"path": "man-roxygen/style_mono_accent_inverse.R",
"chars": 585,
"preview": "#' @title Monotone Accent Inverse Theme\n#' @description An \"inverted\" default xaringan theme with a single color used\n#'"
},
{
"path": "man-roxygen/style_mono_dark.R",
"chars": 484,
"preview": "#' @title Monotone Dark Theme\n#' @description A dark monotone theme based around a single color.\n#' @examples\n#' # Creat"
},
{
"path": "man-roxygen/style_mono_light.R",
"chars": 487,
"preview": "#' @title Monotone Light Theme\n#' @description A light monotone theme based around a single color.\n#' @examples\n#' # Cre"
},
{
"path": "man-roxygen/style_solarized_dark.R",
"chars": 637,
"preview": "#' @title Solarized Dark Theme\n#' @description A dark theme based around on the solarized color scheme.\n#' Works well "
},
{
"path": "man-roxygen/style_solarized_light.R",
"chars": 640,
"preview": "#' @title Solarized Light Theme\n#' @description A light theme based around on the solarized color scheme.\n#' Works wel"
},
{
"path": "man-roxygen/style_xaringan.R",
"chars": 570,
"preview": "#' @title Write A Customized Xaringan Theme\n#' @description Creates a customized Xaringan theme CSS file.\n#' @examples\n#"
},
{
"path": "man-roxygen/theme_params.R",
"chars": 1101,
"preview": "#' @param extra_css A named list of CSS definitions each containing a named list\n#' of CSS property-value pairs, i.e.\n"
},
{
"path": "pkgdown/_pkgdown.yml",
"chars": 2453,
"preview": "authors:\n Garrick Aden-Buie:\n href: https://www.garrickadenbuie.com\n\nurl: https://pkg.garrickadenbuie.com/xaringanth"
},
{
"path": "pkgdown/extra.css",
"chars": 553,
"preview": ":root {\n --bs-light-rgb: 249, 250, 250;\n}\n\n.bg-light {\n --bs-bg-opacity: 0.95;\n}\n\npre {\n border: none;\n border-left:"
},
{
"path": "tests/testthat/_snaps/utils.md",
"chars": 277,
"preview": "# printing google_font works\n\n Code\n google_font(\"Josefin Sans\", \"400\", \"400i\", \"600i\", \"700\")\n Output\n "
},
{
"path": "tests/testthat/css/duo-header_bg.css",
"chars": 7277,
"preview": "/* -------------------------------------------------------\n *\n * !! This file was generated by xaringanthemer !!\n *\n"
},
{
"path": "tests/testthat/css/duo.css",
"chars": 7096,
"preview": "/* -------------------------------------------------------\n *\n * !! This file was generated by xaringanthemer !!\n *\n"
},
{
"path": "tests/testthat/css/duo_accent.css",
"chars": 7300,
"preview": "/* -------------------------------------------------------\n *\n * !! This file was generated by xaringanthemer !!\n *\n"
},
{
"path": "tests/testthat/css/duo_accent_inverse.css",
"chars": 7300,
"preview": "/* -------------------------------------------------------\n *\n * !! This file was generated by xaringanthemer !!\n *\n"
},
{
"path": "tests/testthat/css/google_fonts.css",
"chars": 6790,
"preview": "/* -------------------------------------------------------\n *\n * !! This file was generated by xaringanthemer !!\n *\n"
},
{
"path": "tests/testthat/css/mono_accent.css",
"chars": 7163,
"preview": "/* -------------------------------------------------------\n *\n * !! This file was generated by xaringanthemer !!\n *\n"
},
{
"path": "tests/testthat/css/mono_accent_inverse.css",
"chars": 7163,
"preview": "/* -------------------------------------------------------\n *\n * !! This file was generated by xaringanthemer !!\n *\n"
},
{
"path": "tests/testthat/css/mono_dark.css",
"chars": 7163,
"preview": "/* -------------------------------------------------------\n *\n * !! This file was generated by xaringanthemer !!\n *\n"
},
{
"path": "tests/testthat/css/mono_light-header_bg.css",
"chars": 7344,
"preview": "/* -------------------------------------------------------\n *\n * !! This file was generated by xaringanthemer !!\n *\n"
},
{
"path": "tests/testthat/css/mono_light.css",
"chars": 7163,
"preview": "/* -------------------------------------------------------\n *\n * !! This file was generated by xaringanthemer !!\n *\n"
},
{
"path": "tests/testthat/css/solarized_dark-header_bg.css",
"chars": 7038,
"preview": "/* -------------------------------------------------------\n *\n * !! This file was generated by xaringanthemer !!\n *\n"
},
{
"path": "tests/testthat/css/solarized_dark.css",
"chars": 6857,
"preview": "/* -------------------------------------------------------\n *\n * !! This file was generated by xaringanthemer !!\n *\n"
},
{
"path": "tests/testthat/css/solarized_light.css",
"chars": 6857,
"preview": "/* -------------------------------------------------------\n *\n * !! This file was generated by xaringanthemer !!\n *\n"
},
{
"path": "tests/testthat/css/xaringan.css",
"chars": 6914,
"preview": "/* -------------------------------------------------------\n *\n * !! This file was generated by xaringanthemer !!\n *\n"
},
{
"path": "tests/testthat/helper-session.R",
"chars": 453,
"preview": "with_clean_session <- function(.f, args = list()) {\n empty_wd <- tempfile()\n dir.create(empty_wd)\n owd <- setwd(empty"
},
{
"path": "tests/testthat/test-color.R",
"chars": 3133,
"preview": "# test_that()\n\ndescribe(\"prepare_colors()\", {\n it(\"returns NULL if NULL or missing\", {\n expect_null(prepare_colors()"
},
{
"path": "tests/testthat/test-css.R",
"chars": 4025,
"preview": "test_that(\"read theme settings from css variables\", {\n expected_vars <- list(\n background_color = \"#E9EBEE\",\n tex"
},
{
"path": "tests/testthat/test-ggplot2.R",
"chars": 19284,
"preview": "test_that(\"requires_xaringanthemer_env() errors if no style function called\", {\n expect_error(\n with_clean_session(f"
},
{
"path": "tests/testthat/test-helpers.R",
"chars": 370,
"preview": "test_that(\"element_description\", {\n text_in <- c(\"multiple\", NA, \"\", \".remark-slide-content\", \"h1\", \"pre, code\")\n text"
},
{
"path": "tests/testthat/test-style_extra_css.R",
"chars": 6328,
"preview": "# test_that()\n\n\n# style_extra_css() -------------------------------------------------------\n\ndescribe(\"style_extra_css\","
},
{
"path": "tests/testthat/test-style_xaringan.R",
"chars": 482,
"preview": "test_that(\"style_xaringan() writes to specified outfile\", {\n tmpfile <- tempfile(fileext = \".css\")\n expect_equal(style"
},
{
"path": "tests/testthat/test-themes.R",
"chars": 4293,
"preview": "test_theme_file <- function(theme = \"duo\", theme_file = paste0(theme, \".css\"), ...) {\n local_edition(2)\n on.exit(local"
},
{
"path": "tests/testthat/test-utils.R",
"chars": 367,
"preview": "test_that(\"printing google_font works\", {\n expect_snapshot(\n google_font(\"Josefin Sans\", \"400\", \"400i\", \"600i\", \"700"
},
{
"path": "tests/testthat/test-xaringanthemer-deprecated.R",
"chars": 604,
"preview": "test_that(\"deprecation warnings\", {\n expect_warning(write_xaringan_theme(outfile = NULL))\n expect_warning(write_extra_"
},
{
"path": "tests/testthat.R",
"chars": 72,
"preview": "library(testthat)\nlibrary(xaringanthemer)\n\ntest_check(\"xaringanthemer\")\n"
},
{
"path": "vignettes/.gitignore",
"chars": 22,
"preview": "*.html\n*.R\n\n/.quarto/\n"
},
{
"path": "vignettes/fonts.Rmd",
"chars": 221,
"preview": "---\ntitle: Fonts\n---\n\n[adding-custom-css]: xaringanthemer.html#adding-custom-css\n\n```{r, results='asis', echo=FALSE}\ntvv"
},
{
"path": "vignettes/ggplot2-themes.Rmd",
"chars": 14957,
"preview": "---\ntitle: \"ggplot2 Themes\"\noutput: rmarkdown::html_vignette\nvignette: >\n %\\VignetteIndexEntry{ggplot2 Themes}\n %\\Vign"
},
{
"path": "vignettes/template-variables.Rmd",
"chars": 2075,
"preview": "---\ntitle: \"Template Variables\"\noutput: \n rmarkdown::html_vignette: default\nvignette: >\n %\\VignetteIndexEntry{Template"
},
{
"path": "vignettes/themes.Rmd",
"chars": 234,
"preview": "---\ntitle: Themes\n---\n\n```{r include=FALSE}\nlibrary(xaringanthemer)\nknitr::opts_chunk$set(results = \"asis\", echo=FALSE)\n"
},
{
"path": "vignettes/xaringanthemer.Rmd",
"chars": 3640,
"preview": "---\ntitle: \"Xaringan CSS Theme Generator\"\noutput: rmarkdown::html_vignette\nvignette: >\n %\\VignetteIndexEntry{Overview o"
},
{
"path": "xaringanthemer.Rproj",
"chars": 395,
"preview": "Version: 1.0\n\nRestoreWorkspace: Default\nSaveWorkspace: Default\nAlwaysSaveHistory: Default\n\nEnableCodeIndexing: Yes\nUseSp"
}
]
// ... and 1 more files (download for full content)
About this extraction
This page contains the full source code of the gadenbuie/xaringanthemer GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 124 files (781.5 KB), approximately 217.1k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.