ui.css.as_css_unit(value)
Convert a value into a CSS unit.
Parameters
value : None | CssUnit
-
A value to convert into a CSS unit.
Returns
: None | str
-
If the value
is None
, then None
. If the value is 0
, then "0"
. If the value
is numeric, then a formatted pixel value. Otherwise, the value
as-is.
Examples
from shiny.ui.css import as_css_unit
as_css_unit(0)