EVOLUTION-MANAGER
Edit File: bs_theme_dependencies.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Compile Bootstrap Sass with (optional) theming</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for bs_theme_dependencies {bslib}"><tr><td>bs_theme_dependencies {bslib}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Compile Bootstrap Sass with (optional) theming</h2> <h3>Description</h3> <p><code>bs_theme_dependencies()</code> compiles Bootstrap Sass into CSS and returns it, along with other HTML dependencies, as a list of <code><a href="../../htmltools/html/htmlDependency.html">htmltools::htmlDependency()</a></code>s. Most users won't need to call this function directly as Shiny & R Markdown will perform this compilation automatically when handed a <code><a href="bs_theme.html">bs_theme()</a></code>. If you're here looking to create a themeable component, see <code><a href="bs_dependency.html">bs_dependency()</a></code>. </p> <h3>Usage</h3> <pre> bs_theme_dependencies( theme, sass_options = sass::sass_options_get(output_style = "compressed"), cache = sass::sass_cache_get(), jquery = jquerylib::jquery_core(3), precompiled = get_precompiled_option("bslib.precompiled", default = TRUE) ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>theme</code></td> <td> <p>a <code><a href="bs_theme.html">bs_theme()</a></code> object.</p> </td></tr> <tr valign="top"><td><code>sass_options</code></td> <td> <p>a <code><a href="../../sass/html/sass_options.html">sass::sass_options()</a></code> object.</p> </td></tr> <tr valign="top"><td><code>cache</code></td> <td> <p>This can be a directory to use for the cache, a <a href="../../sass/html/FileCache.html">FileCache</a> object created by <code><a href="../../sass/html/sass_file_cache.html">sass_file_cache()</a></code>, or <code>FALSE</code> or <code>NULL</code> for no caching.</p> </td></tr> <tr valign="top"><td><code>jquery</code></td> <td> <p>a <code><a href="../../jquerylib/html/jquery_core.html">jquerylib::jquery_core()</a></code> object.</p> </td></tr> <tr valign="top"><td><code>precompiled</code></td> <td> <p>Before compiling the theme object, first look for a precompiled CSS file for the <code><a href="theme_version.html">theme_version()</a></code>. If <code>precompiled = TRUE</code> and a precompiled CSS file exists for the theme object, it will be fetched immediately and not compiled. At the moment, we only provide precompiled CSS for "stock" builds of Bootstrap (i.e., no theming additions, bootswatch themes, or non-default <code>sass_options</code>).</p> </td></tr> </table> <h3>Value</h3> <p>a list of HTML dependencies containing Bootstrap CSS, Bootstrap JavaScript, and <code>jquery</code>. This list may contain additional HTML dependencies if bundled with the <code>theme</code>. </p> <h3>Sass caching and precompilation</h3> <p>If Shiny Developer Mode is enabled (by setting <code>options(shiny.devmode = TRUE)</code> or calling <code>shiny::devmode(TRUE)</code>), both <span class="pkg">sass</span> caching and <span class="pkg">bslib</span> precompilation are disabled by default; that is, a call to <code>bs_theme_dependencies(theme)</code> expands to <code>bs_theme_dependencies(theme, cache = F, precompiled = F)</code>). This is useful for local development as enabling caching/precompilation may produce incorrect results if local changes are made to bslib's source files. </p> <h3>See Also</h3> <p><code><a href="bs_theme.html">bs_theme()</a></code>, <code><a href="bs_dependency.html">bs_dependency()</a></code> </p> <h3>Examples</h3> <pre> # Function to preview the styling a (primary) Bootstrap button library(htmltools) button <- tags$a(class = "btn btn-primary", href = "#", role = "button", "Hello") preview_button <- function(theme) { if (interactive()) { browsable(tags$body(bs_theme_dependencies(theme), button)) } } # Latest Bootstrap preview_button(bs_theme()) # Bootstrap 3 preview_button(bs_theme(3)) # Bootswatch 4 minty theme preview_button(bs_theme(4, bootswatch = "minty")) # Bootswatch 4 sketchy theme preview_button(bs_theme(4, bootswatch = "sketchy")) </pre> <hr /><div style="text-align: center;">[Package <em>bslib</em> version 0.4.0 <a href="00Index.html">Index</a>]</div> </body></html>