gap_all: Grid and flex margins

View source: R/gap-all.R

gap_allR Documentation

Grid and flex margins

Description

The ⁠gap_*()⁠ functions adjust the margins of child elements of a tag element with a grid or flex display. Instead of applying margin_*() to each child element, a single ⁠gap_*()⁠ function is applied to the parent element.

Usage

gap_all(x, ...)

gap_horizontal(x, ...)

gap_vertical(x, ...)

Arguments

x

A tag element or .style pronoun.

...

A number specifying the space between child elements. One of,

  • 0

  • 1

  • 2

  • 3

  • 4

  • 5

    Use name-value pairs to specify breakpoints.

Value

An object of the same type as x.

See Also

margin_all() for margins on non flex item elements.

Examples


library(htmltools)

div(
  .style %>%
    flex_display(),
  div(
    .style %>%
      margin_all(2)
  ),
  div(
    .style %>%
      margin_all(2)
  )
)

div(
  .style %>%
    flex_display() %>%
    gap_all(2),
  div(),
  div()
)


cascadess documentation built on Oct. 30, 2024, 9:29 a.m.