Remove or retrieve Sass code from a theme

bs_remove(theme, ids = character(0))

bs_retrieve(theme, ids = character(0), include_unnamed = TRUE)

Arguments

theme

a bs_theme() object.

ids

a character vector of ids

include_unnamed

whether or not to include unnamed sass::sass_layer()s (e.g., Bootstrap Sass variables, functions, and mixins).

Value

a modified bs_theme() object.

Examples


# Remove CSS rules for print and carousels
bs4 <- bs_theme(version = 4)
bs_remove(bs4, c("_print", "_carousel"))
#> /* Sass Bundle: _root, _reboot, _type, _images, _code, _grid, _tables, _forms, _buttons, _transitions, _dropdown, _button-group, _input-group, _custom-forms, _nav, _navbar, _card, _breadcrumb, _pagination, _badge, _jumbotron, _alert, _progress, _media, _list-group, _close, _toasts, _modal, _tooltip, _popover, _spinners, _utilities, bs3compat, nav_spacer */
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_deprecated.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_functions.scss";
#> @import "/home/runner/work/_temp/Library/bslib/sass-utils/color-contrast.scss";
#> @import "/home/runner/work/_temp/Library/bslib/bs3compat/_defaults.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_variables.scss";
#> $bootstrap-version: 4;
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_mixins.scss";
#> @import "/home/runner/work/_temp/Library/bslib/bs3compat/_declarations.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_root.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_reboot.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_type.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_images.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_code.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_grid.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_tables.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_forms.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_buttons.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_transitions.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_dropdown.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_button-group.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_input-group.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_custom-forms.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_nav.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_navbar.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_card.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_breadcrumb.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_pagination.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_badge.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_jumbotron.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_alert.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_progress.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_media.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_list-group.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_close.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_toasts.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_modal.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_tooltip.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_popover.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_spinners.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_utilities.scss";
#> .table th[align=left] { text-align: left; }
#> .table th[align=right] { text-align: right; }
#> .table th[align=center] { text-align: center; }
#> @import "/home/runner/work/_temp/Library/bslib/bs3compat/_rules.scss";
#> @import "/home/runner/work/_temp/Library/bslib/nav-spacer/nav-spacer.scss";
#> /* *** */
#> 
#> Other Sass Bundle information:
#> List of 2
#>  $ html_deps       :List of 1
#>   ..$ :List of 10
#>   .. ..$ name      : chr "bs3compat"
#>   .. ..$ version   : chr "0.4.0"
#>   .. ..$ src       :List of 1
#>   .. .. ..$ file: chr "bs3compat/js"
#>   .. ..$ meta      : NULL
#>   .. ..$ script    : chr [1:3] "transition.js" "tabs.js" "bs3compat.js"
#>   .. ..$ stylesheet: NULL
#>   .. ..$ head      : NULL
#>   .. ..$ attachment: NULL
#>   .. ..$ package   : chr "bslib"
#>   .. ..$ all_files : logi TRUE
#>   .. ..- attr(*, "class")= chr "html_dependency"
#>  $ file_attachments: Named chr "/home/runner/work/_temp/Library/bslib/lib/bs3/assets/fonts"
#>   ..- attr(*, "names")= chr "fonts"

# Remove BS3 compatibility layer
bs_remove(bs4, "bs3compat")
#> /* Sass Bundle: _root, _reboot, _type, _images, _code, _grid, _tables, _forms, _buttons, _transitions, _dropdown, _button-group, _input-group, _custom-forms, _nav, _navbar, _card, _breadcrumb, _pagination, _badge, _jumbotron, _alert, _progress, _media, _list-group, _close, _toasts, _modal, _tooltip, _popover, _carousel, _spinners, _utilities, _print, nav_spacer */
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_deprecated.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_functions.scss";
#> @import "/home/runner/work/_temp/Library/bslib/sass-utils/color-contrast.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_variables.scss";
#> $bootstrap-version: 4;
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_mixins.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_root.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_reboot.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_type.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_images.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_code.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_grid.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_tables.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_forms.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_buttons.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_transitions.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_dropdown.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_button-group.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_input-group.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_custom-forms.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_nav.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_navbar.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_card.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_breadcrumb.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_pagination.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_badge.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_jumbotron.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_alert.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_progress.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_media.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_list-group.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_close.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_toasts.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_modal.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_tooltip.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_popover.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_carousel.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_spinners.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_utilities.scss";
#> @import "/home/runner/work/_temp/Library/bslib/lib/bs4/scss/_print.scss";
#> .table th[align=left] { text-align: left; }
#> .table th[align=right] { text-align: right; }
#> .table th[align=center] { text-align: center; }
#> @import "/home/runner/work/_temp/Library/bslib/nav-spacer/nav-spacer.scss";
#> /* *** */