The text_color()
function adjusts the color of text in a tag element.
Arguments
- x
A tag element or .style pronoun.
- color
A character string specifying a color. One of,
"primary"
"secondary"
"success"
"danger"
"warning"
"info"
"light"
"dark"
"body"
"black"
"white"
See also
Other text utilities:
text_alignment()
,
text_break()
,
text_decoration()
,
text_height()
,
text_selection()
,
text_style()
,
text_transform()
,
text_weight()
,
text_wrap()
Examples
library(htmltools)
div(
.style %>%
text_color(theme_primary())
)
#> <div class="text-primary"></div>
div(
.style %>%
text_color(theme_dark()) %>%
border_color(theme_dark())
)
#> <div class="text-dark border-dark"></div>