如何更改rmdformat/readthedown上的颜色/主题? [英] How to change the color/theme on rmdformats/readthedown?

查看:28
本文介绍了如何更改rmdformat/readthedown上的颜色/主题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用R中的rmdformats包生成readthedown格式的报告。

如何更改默认整体颜色?

推荐答案

rmdformats作者在此。

若要更改标题和其他元素的默认颜色,您必须提供重新定义定义颜色的默认CSS元素的自定义CSS文件。

如果认为以下CSS元素就足够了:

#main .nav-pills > li.active > a,
#main .nav-pills > li.active > a:hover,
#main .nav-pills > li.active > a:focus {
    background-color: #22983B;
}

#main .nav-pills > li > a:hover {
    background-color: #22983B;
}

h1, h2, h3, h4, h5, h6, legend {
    color: #22983B;
}

#nav-top span.glyphicon {
    color: #22983B;
}

#table-of-contents header {
    color: #22983B;
}

#table-of-contents h2 {
    background-color: #22983B;
}

#main a {
    background-image: linear-gradient(180deg,#d64a70,#d64a70);
    color: #c7254e;
}

a:hover {
    color: #3d1308;
}

a:visited {
    color: #3d1308;
}

自定义此文件并将其添加到Rmd文件目录中的custom.css文件,然后在序言中添加css: custom.css

这篇关于如何更改rmdformat/readthedown上的颜色/主题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆