R ShinyDashboard自定义框状态颜色

编程入门 行业动态 更新时间:2024-10-09 07:27:06
本文介绍了R ShinyDashboard自定义框状态颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想自定义我闪亮的应用程序的盒子状态颜色。 我找到了一种CSS方法来更改这些框的框背景颜色,但不能自定义状态颜色,但是在CSS中看不到 status的等效参数吗? 因此,我打印了一个简单页面的源代码,其中包含考虑的参数状态,并且我正在查看其类(我认为class = box box-solid box-primary),但是我无法达到在此网页提供的几个.css文件中...:(

I would like to customize the color of the box status of my shiny app. I find a css way to change the box background color of these box but not to customize the status color, but I do not see the equivalent argument of "status" in css? I thus print the source code of a simple page containing the considered argument "status" and I was lookin at its class (I think class="box box-solid box-primary") but I do not manage to reach it in the several .css provided in this webpage... :(

您有想法吗?

这是简单的代码:

library(shiny) library(shinydashboard) ui <- dashboardPage( dashboardHeader(), dashboardSidebar(), dashboardBody( fluidRow( box(width = 6, title = "youhou", status = "primary", solidHeader = TRUE, "Box content" ) ) ) ) server <- function(input, output) {} shinyApp(ui, server)

在此先感谢您的帮助!

Cha

推荐答案

我终于找到了答案(漫长而艰难,但总是令人满足:D)

I finally found the answer (long and tough but always gratifying :D)

我的一个朋友(非常感谢我的朋友!!!)向我展示了如何显示网页(尤其是闪亮页面)每个元素的所有CSS参数:转到相应的页面然后单击鼠标右键,类似检查元素!

One of my friend (Thank you so much my friend !!!) shows me how to display all css parameters of each element of a web page (and particularly of a shiny page: go to the appropriate page and right click, something like "examine the element"!!

太神奇了!!

然后,我看起来更深入(非常非常深入,有很多类!),我设法访问了框的任何css参数!

Then, I look deeper (very very very deeper, there is so much classes !!) and I managed to access to any css parameter of the boxes !

以下是下一个人的代码:

Here is the code for the next people :

library(shiny) library(shinydashboard) ui <- dashboardPage( dashboardHeader(), dashboardSidebar(), dashboardBody( tags$style(HTML(" .box.box-solid.box-primary>.box-header { color:#fff; background:#666666 } .box.box-solid.box-primary{ border-bottom-color:#666666; border-left-color:#666666; border-right-color:#666666; border-top-color:#666666; } ")), fluidRow( box(width = 6, title = "youhou", status = "primary", solidHeader = TRUE, "Box content" ) ) ) ) server <- function(input, output) {} shinyApp(ui, server)

有一个不错的选择周末!!

Have a good week-end !!

欢呼!

更多推荐

R ShinyDashboard自定义框状态颜色

本文发布于:2023-07-19 13:46:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1157101.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自定义   颜色   状态   ShinyDashboard

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!