Skip to contents

A helper function to retrieve the value of style settings as set by a xaringanthemer style function, for use in plotting and other circumstances.

Usage

theme_xaringan_get_value(setting, css_file = NULL)

Arguments

setting

A xaringanthemer style setting

css_file

Path to a xaringanthemer CSS file, from which the theme variables and values will be inferred. In general, if you use the xaringathemer defaults, you will not need to set this. This feature lets you create a ggplot2 theme for your xaringan slides, even if you have only saved your theme CSS file and you aren't creating your CSS theme with xaringanthemer in your slides' source file.

Value

The value of the xaringanthemer style parameter.

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

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")
#> [1] "#657b83"
theme_xaringan_get_value("background_color")
#> [1] "#fdf6e3"
theme_xaringan_get_value("header_color")
#> [1] "#dc322f"
theme_xaringan_get_value("text_bold_color")
#> [1] "#d33682"