Style example with tailwind

This commit is contained in:
Paul-Henri Froidmont 2025-09-11 19:45:46 +02:00
parent 5dbf3d3ab6
commit 44ffa55cc6
Signed by: phfroidmont
GPG key ID: BE948AFD7E7873BE
5 changed files with 85 additions and 27 deletions

View file

@ -49,10 +49,32 @@ object example extends ScalaCommon:
PathRef(Task.dest)
}
def tailwindConfig = Task.Source(moduleDir / "tailwind.css")
def generateCss = Task {
sources()
os.proc(
"tailwindcss",
"--minify",
"--input",
tailwindConfig().path
).call().out.text()
}
def cssResources = Task {
os.write(
target = Task.dest / "public" / "app.css",
data = generateCss(),
createFolders = true
)
PathRef(Task.dest)
}
def resources = Task {
super.resources() ++ Seq(scaliveBundle())
super.resources() :+ scaliveBundle() :+ cssResources()
}
object js extends TypeScriptModule:
def mainFileName = "app.js"
def npmDeps = Seq("phoenix@1.7.21", "phoenix_live_view@1.1.8", "topbar@3.0.0")
end example