EVOLUTION-MANAGER
Edit File: bs_current_theme.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: Obtain the currently active theme at render time</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_current_theme {bslib}"><tr><td>bs_current_theme {bslib}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Obtain the currently active theme at render time</h2> <h3>Description</h3> <p>Intended for advanced use by developers to obtain the currently active theme <em>at render time</em> and primarily for implementing themable widgets that can't otherwise be themed via <code><a href="bs_dependency.html">bs_dependency_defer()</a></code> . </p> <h3>Usage</h3> <pre> bs_current_theme(session = get_reactive_domain()) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>session</code></td> <td> <p>The current Shiny session (if any).</p> </td></tr> </table> <h3>Details</h3> <p>This function should generally only be called at print/render time. For example: </p> <ul> <li><p> Inside the <code>preRenderHook</code> of <code>htmlwidgets::createWidget()</code>. </p> </li> <li><p> Inside of a custom <a href="../../base/html/print.html">print</a> method that generates <a href="../../htmltools/html/builder.html">htmltools::tags</a>. </p> </li> <li><p> Inside of a <code><a href="../../htmltools/html/tagFunction.html">htmltools::tagFunction()</a></code> </p> </li></ul> <p>Calling this function at print/render time is important because it does different things based on the context in which it's called: </p> <ul> <li><p> If a reactive context is active, <code>session$getCurrentTheme()</code> is called (which is a reactive read). </p> </li> <li><p> If no reactive context is active, <code>shiny::getCurrentTheme()</code> is called (which returns the current app's <code>theme</code>, if relevant). </p> </li> <li><p> If <code>shiny::getCurrentTheme()</code> comes up empty, then <code>bs_global_get()</code> is called, which is relevant for <code><a href="../../rmarkdown/html/html_document.html">rmarkdown::html_document()</a></code>, and possibly other static rendering contexts. </p> </li></ul> <h3>Value</h3> <p>a <code><a href="bs_theme.html">bs_theme()</a></code> object. </p> <hr /><div style="text-align: center;">[Package <em>bslib</em> version 0.4.0 <a href="00Index.html">Index</a>]</div> </body></html>