Learn R Programming

brand.yml (version 0.1.0)

brand_sass_defaults_bootstrap: Generate Sass variables and layer for Bootstrap defaults

Description

Creates Sass variables and a sass layer from Bootstrap defaults defined in the brand object. Allows overriding defaults from other sources like Shiny themes.

Usage

brand_sass_defaults_bootstrap(brand, overrides = "shiny.theme")

Value

A list with two components:

  • defaults: Sass variable definitions with !default flag

  • layer: A sass_layer object with functions, mixins, and rules

Arguments

brand

A list or string of YAML representing the brand, or a path to a brand.yml file.

overrides

Path to override defaults, e.g., "shiny.theme"

See Also

Other brand.yml Sass helpers: brand_sass_color(), brand_sass_color_palette(), brand_sass_fonts(), brand_sass_typography()

Examples

Run this code
brand <- list(
  defaults = list(
    bootstrap = list(
      defaults = list(
        primary = "#007bff",
        enable_rounded = TRUE
      ),
      functions = "@function brand-function() { @return true; }"
    ),
    shiny = list(
      theme = list(
        defaults = list(
          primary = "#428bca"  # Override bootstrap primary
        )
      )
    )
  )
)

brand_sass_defaults_bootstrap(brand)

Run the code above in your browser using DataLab