R/bulma-helpers.R

Defines functions bulma_pulled bulma_relative bulma_clickable bulma_unselectable bulma_shadowless bulma_radiusless bulma_clipped bulma_overlay bulma_clearfix

Documented in bulma_clearfix bulma_clickable bulma_clipped bulma_overlay bulma_pulled bulma_radiusless bulma_relative bulma_shadowless bulma_unselectable

#' @title
#' Bulma Miscellaneous Helpers
#'
#' @description
#' Other useful Bulma helpers
#'
#' @param tag (tag) to be modified
#'
#' @family Bulma Modifiers
#' @name bulma_helpers
NULL

#' @describeIn bulma_helpers Fixes an element's floating children
#' @export
bulma_clearfix <- function(tag) {

  bulma_is(tag, "clearfix")

}

#' @describeIn bulma_helpers Completely covers the first positioned parent
#' @export
bulma_overlay <- function(tag) {

  bulma_is(tag, "overlay")

}

#' @describeIn bulma_helpers Adds overflow hidden
#' @export
bulma_clipped <- function(tag) {

  bulma_is(tag, "clipped")

}

#' @describeIn bulma_helpers Removes any radius
#' @export
bulma_radiusless <- function(tag) {

  bulma_is(tag, "radiusless")

}

#' @describeIn bulma_helpers Removes any shadow
#' @export
bulma_shadowless <- function(tag) {

  bulma_is(tag, "shadowless")

}

#' @describeIn bulma_helpers Prevents the text from being selectable
#' @export
bulma_unselectable <- function(tag) {

  bulma_is(tag, "unselectable")

}

#' @describeIn bulma_helpers
#' Applies `cursor: pointer !important` to the element
#' @export
bulma_clickable <- function(tag) {

  bulma_is(tag, "clickable")

}

#' @describeIn bulma_helpers Applies `position: relative` to the element.
#' @export
bulma_relative <- function(tag) {

  bulma_is(tag, "relative")

}

#' @describeIn bulma_helpers Moves an element to the right or left
#' @param direction (string) `left` or `right`
#' @export
bulma_pulled <- function(tag, direction = c("left", "right")) {

  direction <- match_arg(direction)
  assert_string(direction)
  bulma_is(tag, glue("pulled-{direction}"))

}
tjpalanca/bulma.R documentation built on Dec. 23, 2021, 10:58 a.m.