Skip to contents

Wrap UI in a custom shad_theme() applied only to its descendants.

Usage

shad_theme_scope(theme, ..., class = NULL)

Arguments

theme

A shad_theme() object.

...

UI to wrap.

class

Extra CSS classes on the wrapper.

Value

A <div> scoping the theme.

Examples

shad_theme_scope(shad_theme(primary = "#16a34a"), shad_button("Go"))
#> <style>.shad-theme-3 {
#>   --shad-primary: #16a34a;
#> }</style>
#> <div class="shad-theme-3">
#>   <button type="button" class="shad-btn shad-btn--default">Go</button>
#> </div>