if (interactive()) {
temp <- tempdir()
owd <- setwd(temp)
infile <- "custom.css"
writeLines("@tailwind base;", infile)
outfile <- "out.css"
# file.copy(system.file("examples", "01-Old_Faithful", "app.R", package = "shiny.tailwind"),
# "app.R", overwrite = TRUE)
# write a mini shiny UI
writeLines("
library(shiny)
div(class = \"page-div\",
div(class = \"w-full text-center py-12\",
h1(\"Hello World\")
)
)", "app.R")
tailwindcss <- NULL # can be set to the executable file
compile_tailwindcss(infile, outfile, tailwindcss = tailwindcss)
cat(paste(readLines(outfile)[1:20], collapse = "\n"))
setwd(owd)
}
Run the code above in your browser using DataLab