14

我想更改 flexdashboard 的标题栏颜色。

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

我想将条形颜色更改为红色,将文本更改为黑色。

任何人?

编辑(下面的示例):

---
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

结果: 在此处输入图像描述

4

1 回答 1

19

<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

将您的自定义样式放在单独的styles.css文件中。

在此处输入图像描述

于 2017-06-01T11:14:41.710 回答