bs_vars_global: Bootstrap global variables

Description Usage Arguments Value Examples

View source: R/vars-bootstrap.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
bs_vars_global(
  body_bg = NULL,
  text_color = NULL,
  link_color = NULL,
  link_hover_color = NULL,
  line_height_base = NULL,
  grid_columns = NULL,
  grid_gutter_width = NULL,
  border_radius_base = NULL
)

Arguments

body_bg

Background color for the body.

text_color

Global text color on body.

link_color

Global textual link color.

link_hover_color

Link hover color.

line_height_base

Unit-less 'line-height' for use in components like buttons.

grid_columns

Number of columns in the grid, e.g. in shiny::fluidRow(shiny::column(...)).

grid_gutter_width

Padding between columns. Gets divided in half for the left and right.

border_radius_base

Base border radius (rounds the corners of elements).

Value

a list that can be used in create_theme.

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
77
78
79
80
# change background color
bs_vars_global(
  body_bg = "#FAFAFA"
)

if (interactive()) {
  library(shiny)

  ui <- fluidPage(
    use_theme(
      create_theme(
        theme = "default",
        bs_vars_global(
          body_bg = "#F5A9E1",
          text_color = "#FFF",
          grid_columns = 16
        ),
        output_file = NULL
      )
    ),
    tags$h1("My custom app!"),
    tags$h3("With plenty of columns!"),
    fluidRow(
      column(
        width = 1, "Column 1"
      ),
      column(
        width = 1, "Column 2"
      ),
      column(
        width = 1, "Column 3"
      ),
      column(
        width = 1, "Column 4"
      ),
      column(
        width = 1, "Column 5"
      ),
      column(
        width = 1, "Column 6"
      ),
      column(
        width = 1, "Column 7"
      ),
      column(
        width = 1, "Column 8"
      ),
      column(
        width = 1, "Column 9"
      ),
      column(
        width = 1, "Column 10"
      ),
      column(
        width = 1, "Column 11"
      ),
      column(
        width = 1, "Column 12"
      ),
      column(
        width = 1, "Column 13"
      ),
      column(
        width = 1, "Column 14"
      ),
      column(
        width = 1, "Column 15"
      ),
      column(
        width = 1, "Column 16"
      )
    )
  )

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

  }

  shinyApp(ui, server)
}

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