#' @title
#' Bulma
#'
#' @description
#' Show/hide content depending on the width of the viewport.
#'
#' [Visibility](https://bulma.io/documentation/helpers/visibility-helpers/)
#'
#' @param tag (tag) to be modified
#'
#' @family Bulma Modifiers
#' @name bulma_visibility
NULL
#' @describeIn bulma_visibility Modifies the display class
#' @param display (string) display class
#' @param breakpoint (string) If has only then applicable, otherwise
#' that breakpoint and larger.
#' @export
bulma_display <- function(tag,
display = c("block", "flex", "inline", "hidden",
"inline-block", "inline-flex"),
breakpoint = c("mobile", "tablet-only",
"desktop-only",
"widescreen-only", "touch", "tablet",
"desktop", "widescreen", "fullhd")) {
display <- match_arg(display)
breakpoint <- match_arg(breakpoint)
if (!is.null(breakpoint)) {
bulma_is(tag, glue("{display}-{breakpoint}"))
} else {
bulma_is(tag, display)
}
}
#' @describeIn bulma_visibility Hides element
#' @export
<- function(tag,
breakpoint = c("mobile", "tablet-only", "desktop-only",
"widescreen-only", "touch", "tablet",
"desktop", "widescreen", "fullhd")) {
breakpoint <- match_arg(breakpoint)
if (!is.null(breakpoint)) {
bulma_is(tag, glue("hidden-{breakpoint}"))
} else {
bulma_is(tag, "hidden")
}
}
#' @describeIn bulma_visibility Adds visibility hidden
#' @export
bulma_invisible <- function(tag) {
bulma_is(tag, "invisible")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.