Creates Sass variables and CSS rules for fonts defined in the brand object. Supports Google fonts, Bunny fonts, and file-based fonts.
Value
A list with two components:
defaults
: Sass variables for font definitionsrules
: CSS rules for applying fonts via classes
See also
Other brand.yml Sass helpers:
brand_sass_color()
,
brand_sass_color_palette()
,
brand_sass_defaults_bootstrap()
,
brand_sass_typography()
Examples
brand <- list(
typography = list(
fonts = list(
list(
family = "Roboto",
source = "google",
weight = c(400, 700),
style = "normal"
)
)
)
)
brand_sass_fonts(brand)
#> $defaults
#> $defaults$`brand-font-roboto`
#> $families
#> [1] "Roboto"
#>
#> $html_deps
#> function ()
#> dep_func(x)
#> <bytecode: 0x55a4a92d6318>
#> <environment: 0x55a4a880e990>
#> attr(,"class")
#> [1] "shiny.tag.function"
#>
#> $default_flag
#> [1] TRUE
#>
#> attr(,"class")
#> [1] "font_collection" "list"
#>
#>
#> $rules
#> $rules[[1]]
#> [1] ".brand-font-roboto { font-family: $brand-font-roboto; }"
#>
#>