Art*_*die 4 css themes r shiny
我能够成功使用闪亮的自定义主题,即
# Internal, hidden function
# Called by CherryPickPalette()
CustomPal <- function(new_pal){
if (interactive()){
cherrypickedpalette <- runApp(list(
ui = fluidPage(
theme = shinythemes::shinytheme("slate"),
Run Code Online (Sandbox Code Playgroud)
将为应用程序提供以下外观和感觉
但是,如果我用自定义 .css 替换,程序会忽略它,即
自定义 CSS,h5.css
h5 {
color: orange;
text-align: center;
}
Run Code Online (Sandbox Code Playgroud)
使用h5.css 的代码
# Internal, hidden function
# Called by CherryPickPalette()
CustomPal <- function(new_pal){
if (interactive()){
cherrypickedpalette <- runApp(list(
ui = fluidPage(
theme = "h5.css",
titlePanel("Cherry Pick Your Own Palette!"),
sidebarPanel (hr(),
selectInput('col', 'Options', new_pal, multiple=TRUE, selectize=FALSE, size = 15)
),
mainPanel(
h5('Your Cherry-Picked Palette'),
fluidRow(column(12,verbatimTextOutput("col"))),
Run Code Online (Sandbox Code Playgroud)
h5 文本,即“Your Cherry-Picked Palette”不受影响。
R目录结构在这里
请帮忙!
我不确定为什么它不适用于此目录结构,但您可以尝试这样做:
ui = fluidPage(
# theme = "h5.css",
tags$head(includeCSS("R/www/h5.css")),
titlePanel("Cherry Pick Your Own Palette!"),
...
)
Run Code Online (Sandbox Code Playgroud)