Skip to content

Commit 8a8ebd5

Browse files
committed
feat: Add inverse_link_color to styles
Fixes #44
1 parent 300908a commit 8a8ebd5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+200
-7
lines changed

Diff for: NEWS.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# xaringanthemer 0.3.0.9000
2+
3+
- Add `inverse_link_color` to control color of links on inverse slides (thanks @dmi3kno, #44)
4+
5+
- .pull-right[] now clears floats just for its immediate sibling
6+
17
# xaringanthemer 0.3.0
28

39
* Adds `theme_xaringan()`, a ggplot2 theme that automatically uses the colors

Diff for: R/style_duo.R

+6
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@
8585
#' classes. The value of this variable is also stored as a CSS variable that
8686
#' can be referenced with `var(--inverse-header-color)` in any argument of a
8787
#' style function or in custom CSS.
88+
#' @param inverse_link_color Inverse Link Color. Defaults to `link_color`.
89+
#' Modifies the `.inverse a, .inverse a > code` classes. The value of this
90+
#' variable is also stored as a CSS variable that can be referenced with
91+
#' `var(--inverse-link-color)` in any argument of a style function or in
92+
#' custom CSS.
8893
#' @param title_slide_text_color Title Slide Text Color. Defaults to
8994
#' `secondary_color`. Modifies the `.title-slide` class. The value of this
9095
#' variable is also stored as a CSS variable that can be referenced with
@@ -280,6 +285,7 @@ style_duo <- function(
280285
inverse_text_color = primary_color,
281286
inverse_text_shadow = FALSE,
282287
inverse_header_color = primary_color,
288+
inverse_link_color = link_color,
283289
title_slide_text_color = secondary_color,
284290
title_slide_background_color = primary_color,
285291
title_slide_background_image = NULL,

Diff for: R/style_duo_accent.R

+6
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@
9797
#' this variable is also stored as a CSS variable that can be referenced with
9898
#' `var(--inverse-header-color)` in any argument of a style function or in
9999
#' custom CSS.
100+
#' @param inverse_link_color Inverse Link Color. Defaults to `link_color`.
101+
#' Modifies the `.inverse a, .inverse a > code` classes. The value of this
102+
#' variable is also stored as a CSS variable that can be referenced with
103+
#' `var(--inverse-link-color)` in any argument of a style function or in
104+
#' custom CSS.
100105
#' @param title_slide_text_color Title Slide Text Color. Defaults to
101106
#' `choose_dark_or_light(primary_color, black_color, white_color)`. Modifies
102107
#' the `.title-slide` class. The value of this variable is also stored as a
@@ -294,6 +299,7 @@ style_duo_accent <- function(
294299
inverse_text_color = choose_dark_or_light(secondary_color, black_color, white_color),
295300
inverse_text_shadow = FALSE,
296301
inverse_header_color = choose_dark_or_light(secondary_color, black_color, white_color),
302+
inverse_link_color = link_color,
297303
title_slide_text_color = choose_dark_or_light(primary_color, black_color, white_color),
298304
title_slide_background_color = primary_color,
299305
title_slide_background_image = NULL,

Diff for: R/style_duo_accent_inverse.R

+6
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@
9797
#' this variable is also stored as a CSS variable that can be referenced with
9898
#' `var(--inverse-header-color)` in any argument of a style function or in
9999
#' custom CSS.
100+
#' @param inverse_link_color Inverse Link Color. Defaults to `link_color`.
101+
#' Modifies the `.inverse a, .inverse a > code` classes. The value of this
102+
#' variable is also stored as a CSS variable that can be referenced with
103+
#' `var(--inverse-link-color)` in any argument of a style function or in
104+
#' custom CSS.
100105
#' @param title_slide_text_color Title Slide Text Color. Defaults to
101106
#' `choose_dark_or_light(primary_color, black_color, white_color)`. Modifies
102107
#' the `.title-slide` class. The value of this variable is also stored as a
@@ -295,6 +300,7 @@ style_duo_accent_inverse <- function(
295300
inverse_text_color = choose_dark_or_light(secondary_color, black_color, white_color),
296301
inverse_text_shadow = FALSE,
297302
inverse_header_color = choose_dark_or_light(secondary_color, black_color, white_color),
303+
inverse_link_color = link_color,
298304
title_slide_text_color = choose_dark_or_light(primary_color, black_color, white_color),
299305
title_slide_background_color = primary_color,
300306
title_slide_background_image = NULL,

Diff for: R/style_mono_accent.R

+6
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@
8888
#' this variable is also stored as a CSS variable that can be referenced with
8989
#' `var(--inverse-header-color)` in any argument of a style function or in
9090
#' custom CSS.
91+
#' @param inverse_link_color Inverse Link Color. Defaults to `link_color`.
92+
#' Modifies the `.inverse a, .inverse a > code` classes. The value of this
93+
#' variable is also stored as a CSS variable that can be referenced with
94+
#' `var(--inverse-link-color)` in any argument of a style function or in
95+
#' custom CSS.
9196
#' @param title_slide_text_color Title Slide Text Color. Defaults to
9297
#' `inverse_text_color`. Modifies the `.title-slide` class. The value of this
9398
#' variable is also stored as a CSS variable that can be referenced with
@@ -284,6 +289,7 @@ style_mono_accent <- function(
284289
inverse_text_color = white_color,
285290
inverse_text_shadow = FALSE,
286291
inverse_header_color = white_color,
292+
inverse_link_color = link_color,
287293
title_slide_text_color = inverse_text_color,
288294
title_slide_background_color = inverse_background_color,
289295
title_slide_background_image = NULL,

Diff for: R/style_mono_accent_inverse.R

+6
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@
8989
#' this variable is also stored as a CSS variable that can be referenced with
9090
#' `var(--inverse-header-color)` in any argument of a style function or in
9191
#' custom CSS.
92+
#' @param inverse_link_color Inverse Link Color. Defaults to `link_color`.
93+
#' Modifies the `.inverse a, .inverse a > code` classes. The value of this
94+
#' variable is also stored as a CSS variable that can be referenced with
95+
#' `var(--inverse-link-color)` in any argument of a style function or in
96+
#' custom CSS.
9297
#' @param title_slide_text_color Title Slide Text Color. Defaults to
9398
#' `inverse_text_color`. Modifies the `.title-slide` class. The value of this
9499
#' variable is also stored as a CSS variable that can be referenced with
@@ -285,6 +290,7 @@ style_mono_accent_inverse <- function(
285290
inverse_text_color = black_color,
286291
inverse_text_shadow = FALSE,
287292
inverse_header_color = black_color,
293+
inverse_link_color = link_color,
288294
title_slide_text_color = inverse_text_color,
289295
title_slide_background_color = inverse_background_color,
290296
title_slide_background_image = NULL,

Diff for: R/style_mono_dark.R

+6
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@
9090
#' this variable is also stored as a CSS variable that can be referenced with
9191
#' `var(--inverse-header-color)` in any argument of a style function or in
9292
#' custom CSS.
93+
#' @param inverse_link_color Inverse Link Color. Defaults to `link_color`.
94+
#' Modifies the `.inverse a, .inverse a > code` classes. The value of this
95+
#' variable is also stored as a CSS variable that can be referenced with
96+
#' `var(--inverse-link-color)` in any argument of a style function or in
97+
#' custom CSS.
9398
#' @param title_slide_text_color Title Slide Text Color. Defaults to
9499
#' `inverse_text_color`. Modifies the `.title-slide` class. The value of this
95100
#' variable is also stored as a CSS variable that can be referenced with
@@ -286,6 +291,7 @@ style_mono_dark <- function(
286291
inverse_text_color = black_color,
287292
inverse_text_shadow = FALSE,
288293
inverse_header_color = black_color,
294+
inverse_link_color = link_color,
289295
title_slide_text_color = inverse_text_color,
290296
title_slide_background_color = inverse_background_color,
291297
title_slide_background_image = NULL,

Diff for: R/style_mono_light.R

+6
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@
9090
#' this variable is also stored as a CSS variable that can be referenced with
9191
#' `var(--inverse-header-color)` in any argument of a style function or in
9292
#' custom CSS.
93+
#' @param inverse_link_color Inverse Link Color. Defaults to `link_color`.
94+
#' Modifies the `.inverse a, .inverse a > code` classes. The value of this
95+
#' variable is also stored as a CSS variable that can be referenced with
96+
#' `var(--inverse-link-color)` in any argument of a style function or in
97+
#' custom CSS.
9398
#' @param title_slide_text_color Title Slide Text Color. Defaults to
9499
#' `inverse_text_color`. Modifies the `.title-slide` class. The value of this
95100
#' variable is also stored as a CSS variable that can be referenced with
@@ -286,6 +291,7 @@ style_mono_light <- function(
286291
inverse_text_color = white_color,
287292
inverse_text_shadow = FALSE,
288293
inverse_header_color = white_color,
294+
inverse_link_color = link_color,
289295
title_slide_text_color = inverse_text_color,
290296
title_slide_background_color = inverse_background_color,
291297
title_slide_background_image = NULL,

Diff for: R/style_solarized_dark.R

+6
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@
7676
#' classes. The value of this variable is also stored as a CSS variable that
7777
#' can be referenced with `var(--inverse-header-color)` in any argument of a
7878
#' style function or in custom CSS.
79+
#' @param inverse_link_color Inverse Link Color. Defaults to `link_color`.
80+
#' Modifies the `.inverse a, .inverse a > code` classes. The value of this
81+
#' variable is also stored as a CSS variable that can be referenced with
82+
#' `var(--inverse-link-color)` in any argument of a style function or in
83+
#' custom CSS.
7984
#' @param title_slide_text_color Title Slide Text Color. Defaults to
8085
#' `inverse_text_color`. Modifies the `.title-slide` class. The value of this
8186
#' variable is also stored as a CSS variable that can be referenced with
@@ -268,6 +273,7 @@ style_solarized_dark <- function(
268273
inverse_text_color = "#002b36",
269274
inverse_text_shadow = FALSE,
270275
inverse_header_color = inverse_text_color,
276+
inverse_link_color = link_color,
271277
title_slide_text_color = inverse_text_color,
272278
title_slide_background_color = inverse_background_color,
273279
title_slide_background_image = NULL,

Diff for: R/style_solarized_light.R

+6
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@
7676
#' classes. The value of this variable is also stored as a CSS variable that
7777
#' can be referenced with `var(--inverse-header-color)` in any argument of a
7878
#' style function or in custom CSS.
79+
#' @param inverse_link_color Inverse Link Color. Defaults to `link_color`.
80+
#' Modifies the `.inverse a, .inverse a > code` classes. The value of this
81+
#' variable is also stored as a CSS variable that can be referenced with
82+
#' `var(--inverse-link-color)` in any argument of a style function or in
83+
#' custom CSS.
7984
#' @param title_slide_text_color Title Slide Text Color. Defaults to
8085
#' `inverse_text_color`. Modifies the `.title-slide` class. The value of this
8186
#' variable is also stored as a CSS variable that can be referenced with
@@ -268,6 +273,7 @@ style_solarized_light <- function(
268273
inverse_text_color = "#fdf6e3",
269274
inverse_text_shadow = FALSE,
270275
inverse_header_color = inverse_text_color,
276+
inverse_link_color = link_color,
271277
title_slide_text_color = inverse_text_color,
272278
title_slide_background_color = inverse_background_color,
273279
title_slide_background_image = NULL,

Diff for: R/style_xaringan.R

+6
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@
7676
#' this variable is also stored as a CSS variable that can be referenced with
7777
#' `var(--inverse-header-color)` in any argument of a style function or in
7878
#' custom CSS.
79+
#' @param inverse_link_color Inverse Link Color. Defaults to `link_color`.
80+
#' Modifies the `.inverse a, .inverse a > code` classes. The value of this
81+
#' variable is also stored as a CSS variable that can be referenced with
82+
#' `var(--inverse-link-color)` in any argument of a style function or in
83+
#' custom CSS.
7984
#' @param title_slide_text_color Title Slide Text Color. Defaults to
8085
#' `inverse_text_color`. Modifies the `.title-slide` class. The value of this
8186
#' variable is also stored as a CSS variable that can be referenced with
@@ -267,6 +272,7 @@ style_xaringan <- function(
267272
inverse_text_color = "#d6d6d6",
268273
inverse_text_shadow = FALSE,
269274
inverse_header_color = "#f3f3f3",
275+
inverse_link_color = link_color,
270276
title_slide_text_color = inverse_text_color,
271277
title_slide_background_color = inverse_background_color,
272278
title_slide_background_image = NULL,

Diff for: R/sysdata.rda

35 Bytes
Binary file not shown.

Diff for: README.Rmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ library(xaringanthemer)
2222
<!-- badges: start -->
2323
[![CRAN status](https://www.r-pkg.org/badges/version/xaringanthemer)](https://CRAN.R-project.org/package=xaringanthemer)
2424
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)
25-
[![CI by {tic}](https://github.com/gadenbuie/xaringanthemer/workflows/CI%20by%20{tic}/badge.svg?branch=master)](https://github.com/gadenbuie/xaringanthemer/actions)
25+
[![CI by {tic}](https://github.com/gadenbuie/xaringanthemer/workflows/tic/badge.svg?branch=master)](https://github.com/gadenbuie/xaringanthemer/actions)
2626
[![Codecov](https://img.shields.io/codecov/c/github/gadenbuie/xaringanthemer)](https://codecov.io/github/gadenbuie/xaringanthemer)
2727
<!-- badges: end -->
2828

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ status](https://www.r-pkg.org/badges/version/xaringanthemer)](https://CRAN.R-pro
1010
[![Lifecycle:
1111
stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)
1212
[![CI by
13-
{tic}](https://github.com/gadenbuie/xaringanthemer/workflows/CI%20by%20%7Btic%7D/badge.svg?branch=master)](https://github.com/gadenbuie/xaringanthemer/actions)
13+
{tic}](https://github.com/gadenbuie/xaringanthemer/workflows/tic/badge.svg?branch=master)](https://github.com/gadenbuie/xaringanthemer/actions)
1414
[![Codecov](https://img.shields.io/codecov/c/github/gadenbuie/xaringanthemer)](https://codecov.io/github/gadenbuie/xaringanthemer)
1515
<!-- badges: end -->
1616

@@ -38,6 +38,6 @@ remotes::install_github("gadenbuie/xaringanthemer")
3838

3939
## Features
4040

41-
There’s a lot more that **xaringanthemer** can do\! [Discover
41+
There’s a lot more that **xaringanthemer** can do! [Discover
4242
xaringanthemer’s
4343
features.](https://pkg.garrickadenbuie.com/xaringanthemer/articles/xaringanthemer.html)

Diff for: data-raw/theme_template_variables.R

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ template_variables <- tibble::tribble(
1919
, "inverse_text_color", "#d6d6d6", ".inverse", "Inverse Text Color", "--inverse-text-color"
2020
, "inverse_text_shadow", "{FALSE}", ".inverse", "Enables Shadow on text of inverse slides", NA_character_
2121
, "inverse_header_color", "#f3f3f3", ".inverse h1, .inverse h2, .inverse h3", "Inverse Header Color", "--inverse-header-color"
22+
, "inverse_link_color", "{link_color}", ".inverse a, .inverse a > code", "Inverse Link Color", "--inverse-link-color"
2223
, "title_slide_text_color", "{inverse_text_color}", ".title-slide", "Title Slide Text Color", "--title-slide-text-color"
2324
, "title_slide_background_color", "{inverse_background_color}", ".title-slide", "Title Slide Background Color", "--title-slide-background-color"
2425
, "title_slide_background_image", "{NULL}", ".title-slide", "Title Slide Background Image URL", NA_character_

Diff for: inst/resources/template.css

+4
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
--inverse-text-color: {{inverse_text_color}};
5252
--inverse-background-color: {{inverse_background_color}};
5353
--inverse-header-color: {{inverse_header_color}};
54+
--inverse-link-color: {{inverse_link_color}};
5455
--title-slide-background-color: {{title_slide_background_color}};
5556
--title-slide-text-color: {{title_slide_text_color}};
5657
--header-background-color: {{header_background_color}};
@@ -133,6 +134,9 @@ a, a > code {
133134
.inverse h1, .inverse h2, .inverse h3 {
134135
color: var(--inverse-header-color);
135136
}
137+
.inverse a, .inverse a > code {
138+
color: var(--inverse-link-color);
139+
}
136140
.title-slide, .title-slide h1, .title-slide h2, .title-slide h3 {
137141
color: var(--title-slide-text-color);
138142
}

Diff for: make.R

-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ message("Rendering README.Rmd for GitHub")
88
rmarkdown::render("README.Rmd", quiet = TRUE)
99
unlink("README.html")
1010

11-
message("Rendering index.Rmd for pkgdown")
12-
rmarkdown::render("index.Rmd", quiet = TRUE)
13-
unlink("index.html")
14-
1511
message("Checking package")
1612
devtools::check(document = FALSE)
1713

Diff for: man/style_duo.Rd

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: man/style_duo_accent.Rd

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: man/style_duo_accent_inverse.Rd

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: man/style_mono_accent.Rd

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)