如何更改 Shiny Dashboard 中固定控制栏的颜色
How to change the color of Pined controlbar in Shiny Dashboard
正在寻找一种方法来更改 shinyDashboard 中固定控制栏的颜色。当您将控制栏固定在主页右侧时,我已经能够更改 shinydashboard 中每个元素的颜色,除了小图钉。
任何帮助将不胜感激。
library(shiny)
library(bs4Dash)
shinyApp(
ui = dashboardPage(
header = dashboardHeader(),
sidebar = dashboardSidebar(),
body = dashboardBody(),
controlbar = dashboardControlbar(
id = "controlbar",
collapsed = FALSE,
overlay = TRUE,
skin = "light",
pinned = T
)
),
server = function(input, output, session) {
}
)
要更改图钉颜色,您可以使用
tags$head(tags$style(type = "text/css", ".fa-thumbtack {color:rgb(255,0,0) !important;}"))
完整代码
library(shiny)
library(bs4Dash)
shinyApp(
ui = dashboardPage(
header = dashboardHeader(),
sidebar = dashboardSidebar(),
body = dashboardBody(
#tags$style(".fa-thumbtack {color:rgb(255,0,0)}"), ## this changes only the horizontal pin color
tags$head(tags$style(type = "text/css", ".fa-thumbtack {color:rgb(255,0,0) !important;}"))
),
controlbar = dashboardControlbar(
id = "controlbar",
collapsed = FALSE,
overlay = TRUE,
skin = "light",
pinned = T
)
),
server = function(input, output, session) {
}
)
正在寻找一种方法来更改 shinyDashboard 中固定控制栏的颜色。当您将控制栏固定在主页右侧时,我已经能够更改 shinydashboard 中每个元素的颜色,除了小图钉。 任何帮助将不胜感激。
library(shiny)
library(bs4Dash)
shinyApp(
ui = dashboardPage(
header = dashboardHeader(),
sidebar = dashboardSidebar(),
body = dashboardBody(),
controlbar = dashboardControlbar(
id = "controlbar",
collapsed = FALSE,
overlay = TRUE,
skin = "light",
pinned = T
)
),
server = function(input, output, session) {
}
)
要更改图钉颜色,您可以使用
tags$head(tags$style(type = "text/css", ".fa-thumbtack {color:rgb(255,0,0) !important;}"))
完整代码
library(shiny)
library(bs4Dash)
shinyApp(
ui = dashboardPage(
header = dashboardHeader(),
sidebar = dashboardSidebar(),
body = dashboardBody(
#tags$style(".fa-thumbtack {color:rgb(255,0,0)}"), ## this changes only the horizontal pin color
tags$head(tags$style(type = "text/css", ".fa-thumbtack {color:rgb(255,0,0) !important;}"))
),
controlbar = dashboardControlbar(
id = "controlbar",
collapsed = FALSE,
overlay = TRUE,
skin = "light",
pinned = T
)
),
server = function(input, output, session) {
}
)