bs_vars_color: Bootstrap colors variables

Description Usage Arguments Value Note Examples

View source: R/vars-bootstrap.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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: \Sexpr[results=rd, stage=install]{fresh:::rd_col("#337ab7")}.

brand_success

Success color, default: \Sexpr[results=rd, stage=install]{fresh:::rd_col("#5cb85c")}.

brand_info

Info color, default: \Sexpr[results=rd, stage=install]{fresh:::rd_col("#5bc0de")}.

brand_warning

Warning color, default: \Sexpr[results=rd, stage=install]{fresh:::rd_col("#f0ad4e")}.

brand_danger

Danger color, default: \Sexpr[results=rd, stage=install]{fresh:::rd_col("#d9534f")}.

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.

Note

See default parameters for Bootstrap: https://getbootstrap.com/docs/3.4/customize/.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# 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)
}

fresh documentation built on July 2, 2020, 1:59 a.m.