height: Height

Description Usage Arguments See Also Examples

View source: R/design.R

Description

Utility function to change a tag element's height. Height is specified relative to the font size of page (browser default is 16px), relative to their parent element, or relative to the element's content.

Usage

1
height(tag, size)

Arguments

tag

A tag element.

size

A character string or number specifying the height of the tag element. Possible values:

An integer between 1 and 20, in which case the height of the element is relative to the font size of the page.

"full", in which case the element's height is a percentage of its parent's height. The height of the parent element must also be specified. Percentages do not account for margins or padding and may cause an element to extend beyond its parent.

"auto", in which case the element's height is determined by the browser. The browser will take into account the height, padding, margins, and border of the tag element's parent to keep the element from extending beyond its parent.

"screen", in which case the element's height is determined by the height of the viewport.

See Also

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
### Numeric values

div(
  lapply(
    seq(2, 20, by = 2),
    function(h) {
      div(h) %>%
        width(2) %>%
        height(h) %>%  # <-
        padding(l = 1) %>%
        border("black")
    }
  )
) %>%
  display("flex") %>%
  flex(justify = "between")

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