-
Notifications
You must be signed in to change notification settings - Fork 218
Closed
Milestone
Description
When passing google_font() as a list into tab_style(), it does not seem to work, i.e. the font face does not change.
library(gt)
mtcars %>%
head() %>%
gt() %>%
tab_style(
style = list(
cell_text(font = google_font("Fira Code")),
cell_fill(color = "#F5F3F1")
),
locations = cells_body(everything())
)However, if I pass it as two separate calls to tab_style() and not as a list():
- one for changing the font-face
- second for updating the background color of the cells
then it works:
mtcars %>%
head() %>%
gt() %>%
# First call to change font-face
tab_style(
style = cell_text(font = google_font("Fira Code")), # without list()
locations = cells_body(everything())
) %>%
# Second call to update background color
tab_style(
style = cell_fill(color = "#F5F3F1"), # without list()
locations = cells_body(everything())
)
