fresh (version 0.1.0)

bs_vars_color: Bootstrap CSS colors variables

Description

Those variables can be used to customize defaults colors in Bootstrap and Bootswatch themes.

Usage

bs_vars_color(brand_primary = NULL, brand_success = NULL,
  brand_info = NULL, brand_warning = NULL, brand_danger = NULL,
  gray_base = NULL, gray_darker = NULL, gray_dark = NULL,
  gray = NULL, gray_light = NULL, gray_lighter = NULL)

Arguments

brand_primary

Primary color (default in Bootstrap is blue).

brand_success

Success color (default in Bootstrap is green).

brand_info

Info color (default in Bootstrap is light blue).

brand_warning

Warning color (default in Bootstrap is orange).

brand_danger

Danger color (default in Bootstrap is red).

gray_base

Base gray color.

gray_darker

Darker gray color.

gray_dark

Dark gray color.

gray

Gray color.

gray_light

Light gray color.

gray_lighter

Lighter gray color.

Value

a list that can be used in create_theme.

Examples

Run this code
# NOT RUN {
# New colors (for buttons for example)
bs_vars_color(
  brand_primary = "#75b8d1",
  brand_success = "#c9d175",
  brand_info = "#758bd1",
  brand_warning = "#d1ab75",
  brand_danger = "#d175b8"
)

if (interactive()) {
  library(shiny)
  library(shinyWidgets)
  library(fresh)

  ui <- fluidPage(
    use_theme(create_theme(
      theme = "default",
      bs_vars_color(
        brand_primary = "#75b8d1",
        brand_success = "#c9d175",
        brand_info = "#758bd1",
        brand_warning = "#d1ab75",
        brand_danger = "#d175b8"
      )
    )),
    tags$h1("Colors"),

    tags$p("Apply to :"),
    tags$p("buttons"),
    actionButton("btn1", "Primary", class = "btn-primary"),
    actionButton("btn2", "Success", class = "btn-success"),
    actionButton("btn3", "Danger", class = "btn-danger"),
    actionButton("btn4", "Warning", class = "btn-warning"),
    actionButton("btn5", "info", class = "btn-info"),
    tags$br(), tags$br(),
    tags$p("links"),
    tags$a(href = "", "A link (same color as the primary button)"),
    tags$br(), tags$br(),
    tags$p("labels"),
    tags$span(class = "label label-primary", "Primary"),
    tags$span(class = "label label-success", "Success"),
    tags$span(class = "label label-danger", "Danger"),
    tags$span(class = "label label-warning", "Warning"),
    tags$span(class = "label label-info", "Info"),
    tags$br(), tags$br(),
    tags$p("progress bars"),
    progressBar(
      "pb1", value = 80, status = "primary", display_pct = TRUE
    ),
    progressBar(
      "pb2", value = 80, status = "success", display_pct = TRUE
    ),
    progressBar(
      "pb3", value = 80, status = "danger", display_pct = TRUE
    ),
    progressBar(
      "pb4", value = 80, status = "warning", display_pct = TRUE
    ),
    progressBar(
      "pb5", value = 80, status = "info", display_pct = TRUE
    ),
    tags$br(), tags$br(),
    tags$p("and panels (only primary)"),
    panel(
      heading = "Primary panel",
      status = "primary",
      "For other status, look at ?bs_vars_state"
    )
  )

  server <- function(input, output, session) {

  }

  shinyApp(ui, server)
}
# }

Run the code above in your browser using DataLab