It could be done similar to how you are changing the other colors, here are the CSS selectors:
tags$style(HTML('table.dataTable thead tr td {color: black !important;}')),
Reproducible example:
library(shiny)
library(DT)
ui <- fluidPage(
tags$style(HTML('table.dataTable tr:nth-child(even) {background-color: #1b1b21 !important;color: #e8e8e8 !important;}}')),
tags$style(HTML('table.dataTable tr:nth-child(odd) {background-color: #242932 !important; color: #e8e8e8 !important;}')),
tags$style(HTML('table.dataTable thead tr td {color: black !important;}')),
tags$style(HTML('table.dataTable th {background-color: #1b1b21 !important;}')),
tags$style(HTML(".dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter, .dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_processing,.dataTables_wrapper .dataTables_paginate .paginate_button, .dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
color: #5daa45 !important;
}")),
dataTableOutput("mytable")
)
server <- function(input, output, session) {
output$mytable <- renderDataTable({
datatable(cars,filter = "top")
})
}
shinyApp(ui, server)