GT table colours don't appear in PDF dcoument

I'm trying to add a table that has colour coded columns using the gt package. It works in the console:

but doesn't work when the pdf is created:

My full markdown is:


title: "Untitled"
output: pdf_document

knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
library(gt)

GT package

starwars %>% 
  select (name, height, mass, hair_color, skin_color, sex, gender) %>% 
  head (5) %>% 
  gt() %>% 
   tab_style(
    style = list(
      cell_fill(color = "lightcyan"),
      cell_text(weight = "bold")
      ),
    locations = cells_body(
      columns = vars(height),
      rows = height > 150)
  )