Skip to contents

Transparent panel and plot backgrounds so the page wallpaper shows through glass cards. Use surface = "opaque" for a near-solid panel when dense charts must stay readable. Requires ggplot2 (a Suggests dependency).

Usage

theme_glass(
  preset = NULL,
  base_size = 13,
  input = NULL,
  surface = c("clear", "opaque"),
  ...
)

Arguments

preset

"light" or "dark". When NULL, uses glass_resolved_preset().

base_size

Base font size passed to ggplot2::theme_minimal().

input

Optional Shiny input.

surface

"clear" or "opaque". See glass_plot_colors().

...

Additional ggplot2::theme() arguments.

Value

A ggplot2 theme object.

Examples

if (requireNamespace("ggplot2", quietly = TRUE)) {
  ggplot2::ggplot(mtcars, ggplot2::aes(wt, mpg)) +
    ggplot2::geom_point() +
    theme_glass("light")
}