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".
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"
)Returns a <style> tag with the banner styles for selector as
HTML via htmltools::HTML().
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.
The color of the banner background. By default the background is transparent.
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.
The height of the banner in a valid CSS unit.
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.
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.
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.
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.
use_banner()
style_banner(text_color = "red")
style_banner(text_color = "white", background_color = "red")
Run the code above in your browser using DataLab