font.Rd
The font()
utility modifies the color, size, weight, case, or alignment of
a tag element's text. All arguments default to NULL
, in which case they are
ignored. For example, font(.., size = "lg")
increases font size without
affecting color, weight, case, or alignment.
font(tag, color = NULL, size = NULL, weight = NULL, case = NULL, align = NULL)
tag | A tag element. |
---|---|
color | One of " |
size | One of |
weight | One of |
case | One of |
align | A responsive argument. One of |
Other design utilities:
active()
,
affix()
,
background()
,
border()
,
display()
,
float()
,
height()
,
padding()
,
scroll()
,
shadow()
,
width()
### Changing text color card( header = h3("Important!") %>% font(color = "amber"), div( "This is a reminder." ) ) %>% border(color = "amber")#> <div class="card border border-amber"> #> <div class="card-header"> #> <h3 class="text-amber">Important!</h3> #> </div> #> <div class="card-body"> #> <div>This is a reminder.</div> #> </div> #> </div>### Changing font size div( p("Extra small") %>% font(size = "xs"), p("Small") %>% font(size = "sm"), p("Medium") %>% font(size = "base"), p("Large") %>% font(size = "lg"), p("Extra large") %>% font(size = "xl") )#> <div> #> <p class="card-text font-size-xs">Extra small</p> #> <p class="card-text font-size-sm">Small</p> #> <p class="card-text font-size-base">Medium</p> #> <p class="card-text font-size-lg">Large</p> #> <p class="card-text font-size-xl">Extra large</p> #> </div>### Changing font weight # Make an element's text bold, italic, light, or monospace. p("Curabitur lacinia pulvinar nibh.") %>% font(weight = "bold")#> <p class="card-text font-weight-bold">Curabitur lacinia pulvinar nibh.</p>p("Proin quam nisl, tincidunt et.") %>% font(weight = "light")#> <p class="card-text font-weight-light">Proin quam nisl, tincidunt et.</p>