我正在将flexdashboard包与Rmarkdown一起使用,并想修改标题的尺寸,边框的位置,颜色等,从而导致由Rstudio创建的网页。 Flex仪表板和Rmarkdown关联了许多CSS文件。有人可以告诉我为此修改哪些CSS文件,以及这些文件在R或Rstudio目录中的位置吗?

最佳答案

通过在同事的Lumen子目录中修改CSS主题(我们选择修改flexdashboard),我了解到可以控制flexdashboard中某些元素的尺寸。

具体来说,我们更改了此目录中的CSS文件:
C:\ Program Files \ R \ R-3.4.2 \ library \ flexdashboard \ rmarkdown \ templates \ flex_dashboard \ resources

有关如何更改边框的尺寸,请参见下面的带注释的CSS文件(同样是流明主题)。显示的编辑内容位于现有lumen.css文件的末尾。

/* Jeff's Edits */

.storyboard-nav {
    box-sizing: border-box;
    width: 100% !important; /* This prevents JS transformation on width */
    height: auto; /* This overrides the height */
}

.storyboard-nav .sbnext, .storyboard-nav .sbprev {
    height: auto; /* This overrides the height */
    font-size: 3rem;
}

.storyboard-nav .sbframelist {
    height: auto; /* This overrides the height */
}

.storyboard-nav .sbframelist ul {
    box-sizing: border-box;
    width: 100% !important; /* This prevents JS transformation on width */
    height: auto; /* This overrides the height */
}

.storyboard-nav .sbframelist ul li {
    height: auto; /* This overrides the height */
    width: auto; /* This overrides the width */
}

关于css - 在R中修改Flexdashboard CSS,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/49803014/

10-12 12:22
查看更多