border: Border color

Description Usage Arguments See Also Examples

View source: R/design.R

Description

Use border() to add or modify tag element borders.

Usage

1
border(tag, color = NULL, sides = "all", round = NULL)

Arguments

tag

A tag element.

color

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

sides

One or more of "top", "right", "bottom", "left" or "all" or "none" specifying which sides to add a border to, defaults to "all".

round

One or more of "top", "right", "bottom", "left", "circle", "all", or "none" specifying how to round the border(s) of a tag element, defaults to NULL, in which case the argument is ignored.

See Also

Other design utilities: active(), affix(), background(), display(), float(), font(), height(), padding(), scroll(), shadow(), width()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
### Change border color

div(
  div() %>%
    height(3) %>%
    width(3) %>%
    border("green"),
  div() %>%
    height(3) %>%
    width(3) %>%
    border(
      color = "blue",
      sides = c("left", "right")
    )
)

### Round sides

sides <- c("top", "right", "bottom", "left", "circle", "all")

div(
  lapply(
    sides,
    border,
    tag = div() %>%
      height(3) %>%
      width(3),
    color = "black"
  )
) %>%
  display("flex") %>%
  flex(wrap = TRUE)

yonder documentation built on Jan. 11, 2020, 9:35 a.m.