marnau901e
marnau901e

Reputation: 93

R Shiny - change color of text in navbarPage

I achieve to change the background color of the navbar using css style but not the color of the text... I reproduce a basic example below to my code.

ui <- function(){

  bootstrapPage('',

      navbarPage(title = 'Hello'),

      tags$style(type = 'text/css', '.navbar { background-color: #262626;
                                               font-family: Arial;
                                               font-size: 13px;
                                               color: #FF0000; }',

                                '.navbar-dropdown { background-color: #262626;
                                                    font-family: Arial;
                                                    font-size: 13px;
                                                    color: #FF0000; }'))

}

server <- function(input, output, session){
}


shinyApp(ui = ui, server = server)

Upvotes: 8

Views: 7797

Answers (1)

Adelmo Filho
Adelmo Filho

Reputation: 396

Well, You just need to change the color on this css.

'.navbar-default .navbar-brand {
                         color: #cc3f3f;}'

Here, I changed to #cc3f3f to obtain a red text.

   ui <- function(){

  bootstrapPage('',

                navbarPage(title = 'Hello'),

                tags$style(type = 'text/css', '.navbar { background-color: #262626;
                           font-family: Arial;
                           font-size: 13px;
                           color: #FF0000; }',

                           '.navbar-dropdown { background-color: #262626;
                           font-family: Arial;
                           font-size: 13px;
                           color: #FF0000; }',

                           '.navbar-default .navbar-brand {
                             color: #cc3f3f;
                           }'

                           ))

}

server <- function(input, output, session){
}


shinyApp(ui = ui, server = server)

Upvotes: 8

Related Questions