From fc0ff801e8a13bdffc084cfc5f47a3b9cf52e755 Mon Sep 17 00:00:00 2001 From: Teun van den Brand <49372158+teunbrand@users.noreply.github.com> Date: Sat, 14 Sep 2024 15:02:07 +0200 Subject: [PATCH] Compatibility with future ggplot2 (#79) * use UK spelling of colour * Increment version number to 0.4.2.9000 * docs: add NEWS item * chore: devtools::document() --------- Co-authored-by: Garrick Aden-Buie --- DESCRIPTION | 4 +-- NEWS.md | 42 +++++++++++----------- R/xaringanthemer-package.R | 56 +++++++++++++++--------------- man/style_duo.Rd | 8 ++--- man/style_duo_accent.Rd | 8 ++--- man/style_duo_accent_inverse.Rd | 8 ++--- man/style_mono_accent.Rd | 4 +-- man/style_mono_accent_inverse.Rd | 4 +-- man/style_mono_dark.Rd | 8 ++--- man/style_mono_light.Rd | 8 ++--- man/style_solarized_dark.Rd | 6 ++-- man/style_solarized_light.Rd | 6 ++-- man/style_xaringan.Rd | 6 ++-- man/theme_xaringan_base.Rd | 4 +-- man/theme_xaringan_inverse.Rd | 4 +-- man/theme_xaringan_set_defaults.Rd | 4 +-- 16 files changed, 91 insertions(+), 89 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index ad8c1813..7cbfc907 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: xaringanthemer Title: Custom 'xaringan' CSS Themes -Version: 0.4.2 +Version: 0.4.2.9000 Authors@R: person("Garrick", "Aden-Buie", , "garrick@adenbuie.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7111-0077")) @@ -40,4 +40,4 @@ Config/Needs/website: gadenbuie/grkgdown, pkgdown Config/testthat/edition: 3 Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.1 +RoxygenNote: 7.3.2 diff --git a/NEWS.md b/NEWS.md index 1bc7a5ad..6f73a2fe 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,6 @@ - +# xaringanthemer (development version) + +- Update the spelling of `colour` for compatibility with ggplot2 >= 3.5.1 (@teunbrand #79). # xaringanthemer 0.4.2 @@ -13,16 +15,16 @@ # xaringanthemer 0.4.1 -* Text alignment in code blocks in `left`, `center`, or `right` aligned slides +* 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). @@ -31,20 +33,20 @@ * Added `text_bold_font_weight` argument to xaringanthemer style functions with a corresponding CSS rule setting the `font-weight` property of `` 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` + showtext package isn't installed and also when `fig.showtext = FALSE` (thanks @mikedecr #36, #56). # xaringanthemes 0.3.4 @@ -60,7 +62,7 @@ * 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. @@ -68,8 +70,8 @@ # 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 + 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. @@ -87,10 +89,10 @@ `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 +* 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 @@ -101,14 +103,14 @@ 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 + 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 + `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. @@ -118,13 +120,13 @@ * 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 +* 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 diff --git a/R/xaringanthemer-package.R b/R/xaringanthemer-package.R index 007280fd..1b6e5113 100644 --- a/R/xaringanthemer-package.R +++ b/R/xaringanthemer-package.R @@ -7,42 +7,42 @@ xaringanthemer_env <- new.env(parent = emptyenv()) # I looked up these ggplot geom aesthetic defaults manually via e.g. # ggplot2::geom_line()$geom$default_aes xaringanthemer_env$std_ggplot_defaults <- list( - "line" = list(color = "black"), - "vline" = list(color = "black"), - "hline" = list(color = "black"), - "abline" = list(color = "black"), - "segment" = list(color = "black"), + "line" = list(colour = "black"), + "vline" = list(colour = "black"), + "hline" = list(colour = "black"), + "abline" = list(colour = "black"), + "segment" = list(colour = "black"), "bar" = list(fill = "grey35"), "col" = list(fill = "grey35"), - "boxplot" = list(color = "grey20", fill = "white"), - "contour" = list(color = "#3366FF"), - "density" = list(color = "black", + "boxplot" = list(colour = "grey20", fill = "white"), + "contour" = list(colour = "#3366FF"), + "density" = list(colour = "black", fill = NA, alpha = NA), - "dotplot" = list(color = "black"), - "errorbarh" = list(color = "black"), - "crossbar" = list(color = "black"), - "errorbar" = list(color = "black"), - "linerange" = list(color = "black"), - "pointrange" = list(color = "black"), - "map" = list(color = "black"), - "path" = list(color = "black"), - "line" = list(color = "black"), - "step" = list(color = "black"), - "point" = list(color = "black"), - "polygon" = list(color = NA, + "dotplot" = list(colour = "black"), + "errorbarh" = list(colour = "black"), + "crossbar" = list(colour = "black"), + "errorbar" = list(colour = "black"), + "linerange" = list(colour = "black"), + "pointrange" = list(colour = "black"), + "map" = list(colour = "black"), + "path" = list(colour = "black"), + "line" = list(colour = "black"), + "step" = list(colour = "black"), + "point" = list(colour = "black"), + "polygon" = list(colour = NA, fill = "grey20"), - "quantile" = list(color = "#3366FF"), - "rug" = list(color = "black"), - "segment" = list(color = "black"), + "quantile" = list(colour = "#3366FF"), + "rug" = list(colour = "black"), + "segment" = list(colour = "black"), "smooth" = list(fill = "grey60", - color = "#3366FF"), - "spoke" = list(color = "black"), - "label" = list(color = "black", + colour = "#3366FF"), + "spoke" = list(colour = "black"), + "label" = list(colour = "black", family = ""), - "text" = list(color = "black", + "text" = list(colour = "black", family = ""), "rect" = list(fill = "grey35"), "tile" = list(fill = "grey20"), - "violin" = list(fill = "white", color = "grey20") + "violin" = list(fill = "white", colour = "grey20") ) diff --git a/man/style_duo.Rd b/man/style_duo.Rd index f1a7ff9a..62375b1e 100644 --- a/man/style_duo.Rd +++ b/man/style_duo.Rd @@ -470,10 +470,10 @@ style_duo( } \seealso{ Other themes: -\code{\link{style_duo_accent_inverse}()}, \code{\link{style_duo_accent}()}, -\code{\link{style_mono_accent_inverse}()}, +\code{\link{style_duo_accent_inverse}()}, \code{\link{style_mono_accent}()}, +\code{\link{style_mono_accent_inverse}()}, \code{\link{style_mono_dark}()}, \code{\link{style_mono_light}()}, \code{\link{style_solarized_dark}()}, @@ -481,8 +481,8 @@ Other themes: \code{\link{xaringanthemer_font_default}()} Other Duotone themes: -\code{\link{style_duo_accent_inverse}()}, -\code{\link{style_duo_accent}()} +\code{\link{style_duo_accent}()}, +\code{\link{style_duo_accent_inverse}()} } \concept{Duotone themes} \concept{themes} diff --git a/man/style_duo_accent.Rd b/man/style_duo_accent.Rd index fcb87793..651b5088 100644 --- a/man/style_duo_accent.Rd +++ b/man/style_duo_accent.Rd @@ -485,10 +485,10 @@ style_duo_accent( } \seealso{ Other themes: -\code{\link{style_duo_accent_inverse}()}, \code{\link{style_duo}()}, -\code{\link{style_mono_accent_inverse}()}, +\code{\link{style_duo_accent_inverse}()}, \code{\link{style_mono_accent}()}, +\code{\link{style_mono_accent_inverse}()}, \code{\link{style_mono_dark}()}, \code{\link{style_mono_light}()}, \code{\link{style_solarized_dark}()}, @@ -496,8 +496,8 @@ Other themes: \code{\link{xaringanthemer_font_default}()} Other Duotone themes: -\code{\link{style_duo_accent_inverse}()}, -\code{\link{style_duo}()} +\code{\link{style_duo}()}, +\code{\link{style_duo_accent_inverse}()} } \concept{Duotone themes} \concept{themes} diff --git a/man/style_duo_accent_inverse.Rd b/man/style_duo_accent_inverse.Rd index cdb34728..91ec800e 100644 --- a/man/style_duo_accent_inverse.Rd +++ b/man/style_duo_accent_inverse.Rd @@ -487,10 +487,10 @@ style_duo_accent_inverse( } \seealso{ Other themes: -\code{\link{style_duo_accent}()}, \code{\link{style_duo}()}, -\code{\link{style_mono_accent_inverse}()}, +\code{\link{style_duo_accent}()}, \code{\link{style_mono_accent}()}, +\code{\link{style_mono_accent_inverse}()}, \code{\link{style_mono_dark}()}, \code{\link{style_mono_light}()}, \code{\link{style_solarized_dark}()}, @@ -498,8 +498,8 @@ Other themes: \code{\link{xaringanthemer_font_default}()} Other Duotone themes: -\code{\link{style_duo_accent}()}, -\code{\link{style_duo}()} +\code{\link{style_duo}()}, +\code{\link{style_duo_accent}()} } \concept{Duotone themes} \concept{themes} diff --git a/man/style_mono_accent.Rd b/man/style_mono_accent.Rd index 28f4d484..c67eacac 100644 --- a/man/style_mono_accent.Rd +++ b/man/style_mono_accent.Rd @@ -473,9 +473,9 @@ style_mono_accent( } \seealso{ Other themes: -\code{\link{style_duo_accent_inverse}()}, -\code{\link{style_duo_accent}()}, \code{\link{style_duo}()}, +\code{\link{style_duo_accent}()}, +\code{\link{style_duo_accent_inverse}()}, \code{\link{style_mono_accent_inverse}()}, \code{\link{style_mono_dark}()}, \code{\link{style_mono_light}()}, diff --git a/man/style_mono_accent_inverse.Rd b/man/style_mono_accent_inverse.Rd index b732ad77..2b63705a 100644 --- a/man/style_mono_accent_inverse.Rd +++ b/man/style_mono_accent_inverse.Rd @@ -474,9 +474,9 @@ style_mono_accent_inverse( } \seealso{ Other themes: -\code{\link{style_duo_accent_inverse}()}, -\code{\link{style_duo_accent}()}, \code{\link{style_duo}()}, +\code{\link{style_duo_accent}()}, +\code{\link{style_duo_accent_inverse}()}, \code{\link{style_mono_accent}()}, \code{\link{style_mono_dark}()}, \code{\link{style_mono_light}()}, diff --git a/man/style_mono_dark.Rd b/man/style_mono_dark.Rd index cd419758..ec4fb7d1 100644 --- a/man/style_mono_dark.Rd +++ b/man/style_mono_dark.Rd @@ -474,19 +474,19 @@ style_mono_dark( } \seealso{ Other themes: -\code{\link{style_duo_accent_inverse}()}, -\code{\link{style_duo_accent}()}, \code{\link{style_duo}()}, -\code{\link{style_mono_accent_inverse}()}, +\code{\link{style_duo_accent}()}, +\code{\link{style_duo_accent_inverse}()}, \code{\link{style_mono_accent}()}, +\code{\link{style_mono_accent_inverse}()}, \code{\link{style_mono_light}()}, \code{\link{style_solarized_dark}()}, \code{\link{style_solarized_light}()}, \code{\link{xaringanthemer_font_default}()} Other Monotone themes: -\code{\link{style_mono_accent_inverse}()}, \code{\link{style_mono_accent}()}, +\code{\link{style_mono_accent_inverse}()}, \code{\link{style_mono_light}()} } \concept{Monotone themes} diff --git a/man/style_mono_light.Rd b/man/style_mono_light.Rd index 007483a6..00da0eb8 100644 --- a/man/style_mono_light.Rd +++ b/man/style_mono_light.Rd @@ -474,19 +474,19 @@ style_mono_light( } \seealso{ Other themes: -\code{\link{style_duo_accent_inverse}()}, -\code{\link{style_duo_accent}()}, \code{\link{style_duo}()}, -\code{\link{style_mono_accent_inverse}()}, +\code{\link{style_duo_accent}()}, +\code{\link{style_duo_accent_inverse}()}, \code{\link{style_mono_accent}()}, +\code{\link{style_mono_accent_inverse}()}, \code{\link{style_mono_dark}()}, \code{\link{style_solarized_dark}()}, \code{\link{style_solarized_light}()}, \code{\link{xaringanthemer_font_default}()} Other Monotone themes: -\code{\link{style_mono_accent_inverse}()}, \code{\link{style_mono_accent}()}, +\code{\link{style_mono_accent_inverse}()}, \code{\link{style_mono_dark}()} } \concept{Monotone themes} diff --git a/man/style_solarized_dark.Rd b/man/style_solarized_dark.Rd index 237e9bdc..e7afa787 100644 --- a/man/style_solarized_dark.Rd +++ b/man/style_solarized_dark.Rd @@ -457,11 +457,11 @@ style_solarized_dark( } \seealso{ Other themes: -\code{\link{style_duo_accent_inverse}()}, -\code{\link{style_duo_accent}()}, \code{\link{style_duo}()}, -\code{\link{style_mono_accent_inverse}()}, +\code{\link{style_duo_accent}()}, +\code{\link{style_duo_accent_inverse}()}, \code{\link{style_mono_accent}()}, +\code{\link{style_mono_accent_inverse}()}, \code{\link{style_mono_dark}()}, \code{\link{style_mono_light}()}, \code{\link{style_solarized_light}()}, diff --git a/man/style_solarized_light.Rd b/man/style_solarized_light.Rd index d43c5014..07468857 100644 --- a/man/style_solarized_light.Rd +++ b/man/style_solarized_light.Rd @@ -457,11 +457,11 @@ style_solarized_light( } \seealso{ Other themes: -\code{\link{style_duo_accent_inverse}()}, -\code{\link{style_duo_accent}()}, \code{\link{style_duo}()}, -\code{\link{style_mono_accent_inverse}()}, +\code{\link{style_duo_accent}()}, +\code{\link{style_duo_accent_inverse}()}, \code{\link{style_mono_accent}()}, +\code{\link{style_mono_accent_inverse}()}, \code{\link{style_mono_dark}()}, \code{\link{style_mono_light}()}, \code{\link{style_solarized_dark}()}, diff --git a/man/style_xaringan.Rd b/man/style_xaringan.Rd index 8f637f0b..4a721f85 100644 --- a/man/style_xaringan.Rd +++ b/man/style_xaringan.Rd @@ -467,11 +467,11 @@ style_xaringan( } \seealso{ Other themes: -\code{\link{style_duo_accent_inverse}()}, -\code{\link{style_duo_accent}()}, \code{\link{style_duo}()}, -\code{\link{style_mono_accent_inverse}()}, +\code{\link{style_duo_accent}()}, +\code{\link{style_duo_accent_inverse}()}, \code{\link{style_mono_accent}()}, +\code{\link{style_mono_accent_inverse}()}, \code{\link{style_mono_dark}()}, \code{\link{style_mono_light}()}, \code{\link{style_solarized_dark}()}, diff --git a/man/theme_xaringan_base.Rd b/man/theme_xaringan_base.Rd index abdd2759..31c9d148 100644 --- a/man/theme_xaringan_base.Rd +++ b/man/theme_xaringan_base.Rd @@ -129,8 +129,8 @@ if (has_ggplot2) { } \seealso{ Other xaringanthemer ggplot2 themes: +\code{\link{theme_xaringan}()}, \code{\link{theme_xaringan_inverse}()}, -\code{\link{theme_xaringan_set_defaults}()}, -\code{\link{theme_xaringan}()} +\code{\link{theme_xaringan_set_defaults}()} } \concept{xaringanthemer ggplot2 themes} diff --git a/man/theme_xaringan_inverse.Rd b/man/theme_xaringan_inverse.Rd index 0f08dc94..1d30362d 100644 --- a/man/theme_xaringan_inverse.Rd +++ b/man/theme_xaringan_inverse.Rd @@ -109,8 +109,8 @@ if (has_ggplot2) { } \seealso{ Other xaringanthemer ggplot2 themes: +\code{\link{theme_xaringan}()}, \code{\link{theme_xaringan_base}()}, -\code{\link{theme_xaringan_set_defaults}()}, -\code{\link{theme_xaringan}()} +\code{\link{theme_xaringan_set_defaults}()} } \concept{xaringanthemer ggplot2 themes} diff --git a/man/theme_xaringan_set_defaults.Rd b/man/theme_xaringan_set_defaults.Rd index d2941c6b..6d91cbe9 100644 --- a/man/theme_xaringan_set_defaults.Rd +++ b/man/theme_xaringan_set_defaults.Rd @@ -53,8 +53,8 @@ defaults with \code{theme_xaringan_restore_defaults()}. By default, }} \seealso{ Other xaringanthemer ggplot2 themes: +\code{\link{theme_xaringan}()}, \code{\link{theme_xaringan_base}()}, -\code{\link{theme_xaringan_inverse}()}, -\code{\link{theme_xaringan}()} +\code{\link{theme_xaringan_inverse}()} } \concept{xaringanthemer ggplot2 themes}