style_banner: Style Banner

View source: R/banner.R

style_bannerR Documentation

Style Banner

Description

Change the banner style properties for a specific selector. By default, the changes apply to all banners, but by setting selector you can apply style changes to the banners of specific slide styles. For example, to set the styles for inverse slides, use selector = ".inverse".

Usage

style_banner(
  text_color = NULL,
  background_color = NULL,
  padding_horizontal = NULL,
  padding_vertical = NULL,
  height = NULL,
  width = NULL,
  font_size = NULL,
  font_family = NULL,
  z_index = NULL,
  selector = ":root"
)

Arguments

text_color

The color of text in the banners which may be overridden by other styles, e.g. link color, etc. The default value inherits from the primary text color of the slide.

background_color

The color of the banner background. By default the background is transparent.

padding_horizontal, padding_vertical

The inner padding of the banner. By default no padding is applied in the vertical direction, but ⁠2em⁠ of padding is applied horizontally. If anything, you probably only want to change the value of padding_horizontal.

height

The height of the banner in a valid CSS unit.

width

The maximum width of each column in the banner. You can set the width for all columns with a single valid CSS unit, or you may provide a vector of CSS units, named "left", "center", or "right" or provided in that order.

font_size, font_family

The font size and family of the text in the banner. The default font size is ⁠0.7em⁠ and the default family inherits from the primary text of the slide.

z_index

The z-index of the banner. By default this value is 0 so that all other content appears over the banner. To ensure the banner appears above slide content, you can set z_index to something greater than 0.

selector

A CSS selector, e.g. ".inverse", where the styles set in this call should be applied. Typically, you'll either set these styles for all banners using the default selector, or you'll want to customize the banner appearance for particular slide classes. Note that you can call style_banner() as many times as you want in your slides, but you'll want to change the selector for each call.

Value

Returns a ⁠<style>⁠ tag with the banner styles for selector as HTML via htmltools::HTML().

See Also

use_banner()

Examples

style_banner(text_color = "red")
style_banner(text_color = "white", background_color = "red")


xaringanExtra documentation built on May 29, 2024, 4:17 a.m.