Search code examples
rshinyr-markdownflexdashboardbootswatch

Rmarkdown Interactive documents Bootswatch theme colour incorrect


In R markdown using Flexdashboard template, colours of Bootswatch themes don's seem matching what's shown on the Bootswatch website

For example, using flatly theme

---
title: "Test Dashboard"
output: 
  flexdashboard::flex_dashboard:
    theme: flatly
runtime: shiny
---

What I got is like this: flatly theme in rmarkdown flexdashboard theme

enter image description here

What the flatly theme looks like from Bootswatch is like this: flatly theme from Bootswatch

enter image description here

Is there some settings that I need to specify to get the correct colour? Or for Rmarkdown Bootswatch themes are set to look differently?


Solution

  • Adding the following JS chunk solves the problem:

    ```{js}
    $('.navbar-inverse').removeClass('navbar-inverse').addClass('navbar-
    default');
    ```