R/bulma-modifier.R

Defines functions bulma_has_background bulma_has_text bulma_has bulma_are bulma_is

Documented in bulma_are bulma_has bulma_has_background bulma_has_text bulma_is

#' @title
#' Bulma Modifiers
#'
#' @description
#' Bulma is a CSS framework, and therefore all the modifiers are contained
#' in CSS classes, regardless of the HTML tag. These functions allow easy class
#' addition of the main prefixes in the Bulma CSS Framework.
#'
#' [Documentation](https://bulma.io/documentation/overview/classes/)
#'
#' @param tag      HTML tag to be modified
#' @param modifier string to be added as a modifier
#'
#' @family Bulma Modifiers
#' @name bulma_modifier
NULL

#' @rdname bulma_modifier
bulma_is <- function(tag, modifier) {
  tagAppendAttributes(
    tag,
    class = glue("is-{modifier}")
  )
}

#' @rdname bulma_modifier
bulma_are <- function(tag, modifier) {
  tagAppendAttributes(
    tag,
    class = glue("are-{modifier}")
  )
}

#' @rdname bulma_modifier
bulma_has <- function(tag, modifier) {
  tagAppendAttributes(
    tag,
    class = glue("has-{modifier}")
  )
}

#' @rdname bulma_modifier
bulma_has_text <- function(tag, modifier) {
  tagAppendAttributes(
    tag,
    class = glue("has-text-{modifier}")
  )
}

#' @rdname bulma_modifier
bulma_has_background <- function(tag, modifier) {
  tagAppendAttributes(
    tag,
    class = glue("has-background-{modifier}")
  )
}
tjpalanca/bulma.R documentation built on Dec. 23, 2021, 10:58 a.m.