margin_all: Margins

View source: R/margin-all.R

margin_allR Documentation

Margins

Description

The ⁠margin_*()⁠ functions adjust a tag element's margin, the space outside and around the element, its border, and its content.

Usage

margin_all(x, ...)

margin_top(x, ...)

margin_right(x, ...)

margin_bottom(x, ...)

margin_left(x, ...)

margin_horizontal(x, ...)

margin_vertical(x, ...)

Arguments

x

A tag element or .style pronoun.

...

A number or character string specifying a margin. One or more of,

  • "-5"

  • "-4"

  • "-3"

  • "-2"

  • "-1"

  • 0

  • 1

  • 2

  • 3

  • 4

  • 5

  • "auto"

    Use name-value pairs to specify breakpoints.

Value

An object of the same type as x.

See Also

gap_all() for flex spacing.

Examples


library(htmltools)

div(
  .style %>%
    margin_left(3) %>%
    margin_right(3),
  "Left margin, right margin"
)

div(
  .style %>%
    margin_horizontal(3),
  "Shorthand for left and right margins"
)

div(
  .style %>%
    margin_horizontal("auto"),
  "A centered element."
)


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