Rmarkdown 中的 YAML 标题字体和颜色

YAML title font and color in Rmarkdown

有没有办法更改 R markdown flexdashboard 中 YAML 标题的字体和颜色? 这是我要更改的 YAML header 的代码:

---
title: "Greenhouse gases and weather data"
fontsize: 30
output: 
  flexdashboard::flex_dashboard:
    orientation: rows
    vertical_layout: fill
    social: menu
    source_code: embed
    theme: readable

---

正如 Kat 所说,颜色由 CSS 设置,因此您可以在 .rmd 文件本身或基础主题模板 .css 文件中更改行为。

某处位于:

/home/user/R/x86_64-pc-linux-gnu-library/4.0/flexdashboard/rmarkdown/templates/flex_dashboard/resources

添加(到 rmd)或查找并更改 (.css) 到 :

<style>                     
.navbar {
  background-color:white;
  border-color:blue;
}
.navbar-brand {
color:blue!important;
}
</style>  

这将恢复顶部导航栏的默认配色方案

目前我不知道一个简单的 YAML - 参数解决方案 (但是研究 css 会让你收获更多 沿途的多功能性,而不是依赖 YAML 选项)

另一种选择是在仪表板的任意位置添加 CSS 代码块

```{css}

body > div.navbar.navbar-inverse.navbar-fixed-top > div > div.navbar-header > span.navbar-brand {
  
    font-size: 26px;
    color: red;
}

```