Skip to content

Commit

Permalink
feat: Add inverse_link_color to styles
Browse files Browse the repository at this point in the history
Fixes #44
  • Loading branch information
gadenbuie committed Mar 2, 2021
1 parent 300908a commit 8a8ebd5
Show file tree
Hide file tree
Showing 41 changed files with 200 additions and 7 deletions.
6 changes: 6 additions & 0 deletions NEWS.md
@@ -1,3 +1,9 @@
# xaringanthemer 0.3.0.9000

- 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

# xaringanthemer 0.3.0

* Adds `theme_xaringan()`, a ggplot2 theme that automatically uses the colors
Expand Down
6 changes: 6 additions & 0 deletions R/style_duo.R
Expand Up @@ -85,6 +85,11 @@
#' 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
Expand Down Expand Up @@ -280,6 +285,7 @@ style_duo <- function(
inverse_text_color = primary_color,
inverse_text_shadow = FALSE,
inverse_header_color = primary_color,
inverse_link_color = link_color,
title_slide_text_color = secondary_color,
title_slide_background_color = primary_color,
title_slide_background_image = NULL,
Expand Down
6 changes: 6 additions & 0 deletions R/style_duo_accent.R
Expand Up @@ -97,6 +97,11 @@
#' 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
Expand Down Expand Up @@ -294,6 +299,7 @@ style_duo_accent <- function(
inverse_text_color = choose_dark_or_light(secondary_color, black_color, white_color),
inverse_text_shadow = FALSE,
inverse_header_color = choose_dark_or_light(secondary_color, black_color, white_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,
Expand Down
6 changes: 6 additions & 0 deletions R/style_duo_accent_inverse.R
Expand Up @@ -97,6 +97,11 @@
#' 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
Expand Down Expand Up @@ -295,6 +300,7 @@ style_duo_accent_inverse <- function(
inverse_text_color = choose_dark_or_light(secondary_color, black_color, white_color),
inverse_text_shadow = FALSE,
inverse_header_color = choose_dark_or_light(secondary_color, black_color, white_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,
Expand Down
6 changes: 6 additions & 0 deletions R/style_mono_accent.R
Expand Up @@ -88,6 +88,11 @@
#' 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
Expand Down Expand Up @@ -284,6 +289,7 @@ style_mono_accent <- function(
inverse_text_color = white_color,
inverse_text_shadow = FALSE,
inverse_header_color = white_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,
Expand Down
6 changes: 6 additions & 0 deletions R/style_mono_accent_inverse.R
Expand Up @@ -89,6 +89,11 @@
#' 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
Expand Down Expand Up @@ -285,6 +290,7 @@ style_mono_accent_inverse <- function(
inverse_text_color = black_color,
inverse_text_shadow = FALSE,
inverse_header_color = black_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,
Expand Down
6 changes: 6 additions & 0 deletions R/style_mono_dark.R
Expand Up @@ -90,6 +90,11 @@
#' 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
Expand Down Expand Up @@ -286,6 +291,7 @@ style_mono_dark <- function(
inverse_text_color = black_color,
inverse_text_shadow = FALSE,
inverse_header_color = black_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,
Expand Down
6 changes: 6 additions & 0 deletions R/style_mono_light.R
Expand Up @@ -90,6 +90,11 @@
#' 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
Expand Down Expand Up @@ -286,6 +291,7 @@ style_mono_light <- function(
inverse_text_color = white_color,
inverse_text_shadow = FALSE,
inverse_header_color = white_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,
Expand Down
6 changes: 6 additions & 0 deletions R/style_solarized_dark.R
Expand Up @@ -76,6 +76,11 @@
#' 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
Expand Down Expand Up @@ -268,6 +273,7 @@ style_solarized_dark <- function(
inverse_text_color = "#002b36",
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,
Expand Down
6 changes: 6 additions & 0 deletions R/style_solarized_light.R
Expand Up @@ -76,6 +76,11 @@
#' 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
Expand Down Expand Up @@ -268,6 +273,7 @@ style_solarized_light <- function(
inverse_text_color = "#fdf6e3",
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,
Expand Down
6 changes: 6 additions & 0 deletions R/style_xaringan.R
Expand Up @@ -76,6 +76,11 @@
#' 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
Expand Down Expand Up @@ -267,6 +272,7 @@ style_xaringan <- function(
inverse_text_color = "#d6d6d6",
inverse_text_shadow = FALSE,
inverse_header_color = "#f3f3f3",
inverse_link_color = link_color,
title_slide_text_color = inverse_text_color,
title_slide_background_color = inverse_background_color,
title_slide_background_image = NULL,
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
2 changes: 1 addition & 1 deletion README.Rmd
Expand Up @@ -22,7 +22,7 @@ library(xaringanthemer)
<!-- badges: start -->
[![CRAN status](https://www.r-pkg.org/badges/version/xaringanthemer)](https://CRAN.R-project.org/package=xaringanthemer)
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)
[![CI by {tic}](https://github.com/gadenbuie/xaringanthemer/workflows/CI%20by%20{tic}/badge.svg?branch=master)](https://github.com/gadenbuie/xaringanthemer/actions)
[![CI by {tic}](https://github.com/gadenbuie/xaringanthemer/workflows/tic/badge.svg?branch=master)](https://github.com/gadenbuie/xaringanthemer/actions)
[![Codecov](https://img.shields.io/codecov/c/github/gadenbuie/xaringanthemer)](https://codecov.io/github/gadenbuie/xaringanthemer)
<!-- badges: end -->

Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -10,7 +10,7 @@ status](https://www.r-pkg.org/badges/version/xaringanthemer)](https://CRAN.R-pro
[![Lifecycle:
stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)
[![CI by
{tic}](https://github.com/gadenbuie/xaringanthemer/workflows/CI%20by%20%7Btic%7D/badge.svg?branch=master)](https://github.com/gadenbuie/xaringanthemer/actions)
{tic}](https://github.com/gadenbuie/xaringanthemer/workflows/tic/badge.svg?branch=master)](https://github.com/gadenbuie/xaringanthemer/actions)
[![Codecov](https://img.shields.io/codecov/c/github/gadenbuie/xaringanthemer)](https://codecov.io/github/gadenbuie/xaringanthemer)
<!-- badges: end -->

Expand Down Expand Up @@ -38,6 +38,6 @@ remotes::install_github("gadenbuie/xaringanthemer")

## Features

There’s a lot more that **xaringanthemer** can do\! [Discover
There’s a lot more that **xaringanthemer** can do! [Discover
xaringanthemer’s
features.](https://pkg.garrickadenbuie.com/xaringanthemer/articles/xaringanthemer.html)
1 change: 1 addition & 0 deletions data-raw/theme_template_variables.R
Expand Up @@ -19,6 +19,7 @@ template_variables <- tibble::tribble(
, "inverse_text_color", "#d6d6d6", ".inverse", "Inverse Text Color", "--inverse-text-color"
, "inverse_text_shadow", "{FALSE}", ".inverse", "Enables Shadow on text of inverse slides", NA_character_
, "inverse_header_color", "#f3f3f3", ".inverse h1, .inverse h2, .inverse h3", "Inverse Header Color", "--inverse-header-color"
, "inverse_link_color", "{link_color}", ".inverse a, .inverse a > code", "Inverse Link Color", "--inverse-link-color"
, "title_slide_text_color", "{inverse_text_color}", ".title-slide", "Title Slide Text Color", "--title-slide-text-color"
, "title_slide_background_color", "{inverse_background_color}", ".title-slide", "Title Slide Background Color", "--title-slide-background-color"
, "title_slide_background_image", "{NULL}", ".title-slide", "Title Slide Background Image URL", NA_character_
Expand Down
4 changes: 4 additions & 0 deletions inst/resources/template.css
Expand Up @@ -51,6 +51,7 @@
--inverse-text-color: {{inverse_text_color}};
--inverse-background-color: {{inverse_background_color}};
--inverse-header-color: {{inverse_header_color}};
--inverse-link-color: {{inverse_link_color}};
--title-slide-background-color: {{title_slide_background_color}};
--title-slide-text-color: {{title_slide_text_color}};
--header-background-color: {{header_background_color}};
Expand Down Expand Up @@ -133,6 +134,9 @@ a, a > code {
.inverse h1, .inverse h2, .inverse h3 {
color: var(--inverse-header-color);
}
.inverse a, .inverse a > code {
color: var(--inverse-link-color);
}
.title-slide, .title-slide h1, .title-slide h2, .title-slide h3 {
color: var(--title-slide-text-color);
}
Expand Down
4 changes: 0 additions & 4 deletions make.R
Expand Up @@ -8,10 +8,6 @@ message("Rendering README.Rmd for GitHub")
rmarkdown::render("README.Rmd", quiet = TRUE)
unlink("README.html")

message("Rendering index.Rmd for pkgdown")
rmarkdown::render("index.Rmd", quiet = TRUE)
unlink("index.html")

message("Checking package")
devtools::check(document = FALSE)

Expand Down
7 changes: 7 additions & 0 deletions man/style_duo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions man/style_duo_accent.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions man/style_duo_accent_inverse.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions man/style_mono_accent.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8a8ebd5

Please sign in to comment.