EVOLUTION-MANAGER
Edit File: bs_get_variables.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: Retrieve Sass variable values from the current theme</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_get_variables {bslib}"><tr><td>bs_get_variables {bslib}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Retrieve Sass variable values from the current theme</h2> <h3>Description</h3> <p>Useful for retriving a variable from the current theme and using the value to inform another R function. </p> <h3>Usage</h3> <pre> bs_get_variables(theme, varnames) bs_get_contrast(theme, varnames) </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>varnames</code></td> <td> <p>a character string referencing a Sass variable in the current theme.</p> </td></tr> </table> <h3>Value</h3> <p>a character string containing a CSS/Sass value. If the variable(s) are not defined, their value is <code>NA</code>. </p> <h3>Examples</h3> <pre> vars <- c("body-bg", "body-color", "primary", "border-radius") bs_get_variables(bs_theme(), varnames = vars) bs_get_variables(bs_theme(bootswatch = "darkly"), varnames = vars) bs_get_contrast(bs_theme(), c("primary", "dark", "light")) library(htmltools) div( class = "bg-primary", style = css( color = bs_get_contrast(bs_theme(), "primary") ) ) </pre> <hr /><div style="text-align: center;">[Package <em>bslib</em> version 0.4.0 <a href="00Index.html">Index</a>]</div> </body></html>