简体   繁体   English

R Shinydashboard标头颜色

[英]R Shinydashboard Header Color

I am creating a dashboard that needs to adhere to corporate style requirements. 我正在创建一个仪表盘,该仪表盘需要符合公司风格的要求。 I need to alter the background color of the header. 我需要更改标题的背景颜色。 I have successfully altered the color except for when I mouse over the header, it changes to a different color. 我已经成功地更改了颜色,但是当我将鼠标悬停在标题上时,它变为了另一种颜色。

Here is an example of the header with the proper color scheme: 这是带有正确配色方案的标头示例:

在此处输入图片说明

Here is the same dashboard with my mouse hovering over the header: 这是同一面板,鼠标悬停在标题上:

在此处输入图片说明

For added measure, here is the result of inspecting the element: 为了增加度量,这是检查元素的结果:

在此处输入图片说明

Any help that can point me in the right direction to keep the background of the header a white color would be greatly appreciated. 可以为我指明正确方向以使标题背景保持白色的任何帮助将不胜感激。

There will be an css property most likely .logo : active or something - remove this. 将有一个CSS属性最可能是.logo:active或其他内容-删除此属性。

Would need full code to give a definitive answer. 需要完整的代码来给出明确的答案。

I solved the problem by adjusting the CSS that appears in a supporting CSS file. 我通过调整出现在支持CSS文件中的CSS来解决了这个问题。 In the OP, the inspect element tool points to a second CSS file that I had not altered. 在OP中,检查元素工具指向我未更改的第二个CSS文件。 Specifically, the all-skins.min.css file. 具体来说,是all-skins.min.css文件。

Once I located that file, which for R/shinydashboard, the file appears in the AdminLTE directory of the package library/shinydashboard, I found the element that affected the behavior: 找到该文件(对于R / shinydashboard)后,该文件出现在包库/ shinydashboard的AdminLTE目录中,我发现了影响行为的元素:

.skin-red .main-header .logo:hover{background-color: }

Since I wanted the background color to remain white, even on hover, I inserted #FFF into the background-color element and, now, the background color for the header remains white even on hover. 因为我希望即使在悬停时背景颜色也保持白色,所以我将#FFF插入到background-color元素中,现在,即使悬停时标题的背景色也保持白色。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM