Skip to contents

The text_color() function adjusts the color of text in a tag element.

Usage

text_color(x, color)

text_emphasis(x, color)

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"

Value

An object of the same type as x.

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>