Learn R Programming

yonder (version 0.1.0)

font: Tag element font

Description

The font() utility modifies the color, size, weight, case, or alignment of a tag element's text. All arguments default to NULL, in which case they are ignored. For example, font(.., size = "lg") increases font size without affecting color, weight, case, or alignment.

Usage

font(tag, color = NULL, size = NULL, weight = NULL, case = NULL,
  align = NULL)

Arguments

tag

A tag element.

color

One "red", "purple", "indigo", "blue", "cyan", "teal", "green", "yellow", "amber", "orange", "grey", "black", or "white" specifying the tag element text color, defaults to NULL.

size

One of "xs", "sm", "base", "lg", "xl" specifying a font size relative to the default base page font size, defaults to NULL.

weight

One of "bold", "normal", "light", "italic", or "monospace" specifying the font weight of the element's text, defaults to NULL.

case

One of "upper", "lower", or "title" specifying a transformation of the tag element's text, default to NULL.

align

A responsive argument. One of "left", "center", "right", or "justify", specifying the alignment of the tag element's text, defaults to NULL.

See Also

Other design: active, affix, background, border, display, float, height, padding, scroll, shadow, width

Examples

Run this code
# NOT RUN {
### Changing text color

card(
  header = h3("Important!") %>%
    font(color = "amber"),
  div(
    "This is a reminder."
  )
) %>%
  border(color = "amber")

### Changing font size

div(
  p("Extra small") %>%
    font(size = "xs"),
  p("Small") %>%
    font(size = "sm"),
  p("Medium") %>%
    font(size = "base"),
  p("Large") %>%
    font(size = "lg"),
  p("Extra large") %>%
    font(size = "xl")
)

### Changing font weight

# Make an element's text bold, italic, light, or monospace.

p("Curabitur lacinia pulvinar nibh.") %>%
  font(weight = "bold")

p("Proin quam nisl, tincidunt et.") %>%
  font(weight = "light")

# }

Run the code above in your browser using DataLab