dot-style: '.style' pronoun

dot-styleR Documentation

.style pronoun

Description

The .style pronoun allows defining styles within the function call of a tag element. Without the .style pronoun tag element styles are applied outside and after constructing a tag element.

div() %>%
  background_color("primary") %>%
  display("flex") %>%
  flex_justify("between")

Once the content of a tag element grows to more than a few lines, associating the element's styles with the element becomes less and less intuitive. In these situations, make use of the .style pronoun.

div(
  .style %>%
    border_color(theme_primary()) %>%
    text_color(theme_primary()),
  p("Paragraph"),
  p("Paragraph"),
  p("Paragraph")
)

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