flexdashboard - 改变tittle bar颜色

时间:2017-06-01 10:42:12

标签: r flexdashboard

我想改变flexdashboard的细条颜色。

我找到了一个删除它的例子 - SE here,但鉴于我不知道任何CSS / JQuery,我不得不问。

我想将bar collor更改为红色,将文本更改为黑色。

任何?

编辑(以下示例):

---
title: "DB: Contact information"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
---

<style>                     
.navbar {
  background-color:crimson;
  border-color:black;
}
.navbar-brand {
color:black!important;
}


</style>   


Dashboard
=====================================  

Test. Test. Test. 

Column {data-width=650}
-----------------------------------------------------------------------

### Clustered Data

结果: enter image description here

1 个答案:

答案 0 :(得分:8)

您可以在FileStream file; boolean isNew; try { file = File.Open(path, FileMode.CreateNew); isNew = true; } catch (IOException ex) { file = File.Open(path, FileMode.Append); isNew = false; } 块中自定义样式表,如下所示:

<style>...</style>

或使用

---
title: "Untitled"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
---
<style>                     
.navbar {
  background-color:red;
  border-color:black;
}
.navbar-brand {
color:black!important;
}
</style>                    

```{r setup, include=FALSE}
library(flexdashboard)
```

Column {data-width=650}
-----------------------------------------------------------------------

### Chart A

```{r}
plot(0)
```

Column {data-width=350}
-----------------------------------------------------------------------

### Chart B

```{r}
plot(0)
```

### Chart C

```{r}
plot(0)
```

将自定义样式放在单独的output: flexdashboard::flex_dashboard: css: styles.css 文件中。

enter image description here