I want to add a css file reference to my htmlTemplate for a shiny application. My current method, pointing to an external file, is not working. Removing and replacing the class attribute with style and adding color directly does work.
I feel like this is a path issue. I would add a www
folder but I’m using the rhino framework. All files sit within the same folder.
App structure:
template.html
<!DOCTYPE html>
<html>
<head>
{{ headContent() }}
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<div class="slider_class">
{{ slider }}
</div>
</body>
</html>
styles.css
.slider_class {
color: #FF0000;
}
app.R
library(shiny)
ui <- htmlTemplate("template.html", slider = sliderInput("x", "X", 1, 100, 50))
server <- function(input, output, session) {}
shinyApp(ui, server)