Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bs_vars_font

Bootstrap font variables


Description

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

Usage

bs_vars_font(
  family_sans_serif = NULL,
  size_base = NULL,
  size_large = NULL,
  size_small = NULL,
  size_h1 = NULL,
  size_h2 = NULL,
  size_h3 = NULL,
  size_h4 = NULL,
  size_h5 = NULL,
  size_h6 = NULL
)

Arguments

family_sans_serif

Font family to use.

size_base

Size of base font, e.g. normal text, default in Bootstrap is "15px".

size_large

Size of large text.

size_small

Size of small text.

size_h1

Size of h1 tags.

size_h2

Size of h2 tags.

size_h3

Size of h3 tags.

size_h4

Size of h4 tags.

size_h5

Size of h5 tags.

size_h6

Size of h6 tags.

Value

a list that can be used in create_theme.

Note

In Bootstrap, only size_base is defined, all others are calculated from this one. See default parameters for Bootstrap: https://getbootstrap.com/docs/3.4/customize/.

Examples

# Use a smaller font than the default
bs_vars_font(
  size_base = "12px"
)

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

  ui <- fluidPage(
    use_theme(create_theme(
      theme = "default",
      bs_vars_font(
        size_base = "32px"
      )
    )),
    tags$h1("Big font theme"),

    sidebarLayout(
      sidebarPanel(
        "This is the sidebar panel"
      ),
      mainPanel(
        tags$h1("First level title"),
        tags$h2("Second level title"),
        tags$h3("Third level title"),
        tags$h4("Fourth level title"),
        tags$h5("Fifth level title"),
        tags$h6("Sixth level title")
      )
    )
  )

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

  }

  shinyApp(ui, server)
}

fresh

Create Custom 'Bootstrap' Themes to Use in 'Shiny'

v0.2.0
GPL-3
Authors
Victor Perrier [aut, cre, cph], Fanny Meyer [aut], Thomas Park [ctb, cph] (Bootswatch themes), Mark Otto [ctb] (Bootstrap library), Jacob Thornton [ctb] (Bootstrap library), Bootstrap contributors [ctb] (Bootstrap library), Twitter, Inc [cph] (Bootstrap library), onkbear [ctb, cph] (admin-lte-2-sass), Colorlib [ctb, cph] (AdminLTE)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.