feat: enabling TailwindCSS styling
with manual running of cli: tailwindcss -i ./src/input.css -o ./dist/output.css --watch
This commit is contained in:
parent
98d6f77014
commit
fd75be6abe
|
@ -2,3 +2,4 @@
|
||||||
.scala-build/
|
.scala-build/
|
||||||
.metals/
|
.metals/
|
||||||
.direnv
|
.direnv
|
||||||
|
*/dist/
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
pkgs.scala-cli
|
pkgs.scala-cli
|
||||||
pkgs.sbt
|
pkgs.sbt
|
||||||
pkgs.scalafmt
|
pkgs.scalafmt
|
||||||
|
pkgs.nodePackages.tailwindcss
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
@tailwind base;
|
||||||
|
@tailwind components;
|
||||||
|
@tailwind utilities;
|
|
@ -6,6 +6,7 @@ package app
|
||||||
|
|
||||||
import scalatags.Text.all._
|
import scalatags.Text.all._
|
||||||
import scala.util.Random
|
import scala.util.Random
|
||||||
|
import scalatags.Text.tags2
|
||||||
|
|
||||||
object Main extends cask.MainRoutes {
|
object Main extends cask.MainRoutes {
|
||||||
@cask.get("/")
|
@cask.get("/")
|
||||||
|
@ -13,15 +14,27 @@ object Main extends cask.MainRoutes {
|
||||||
doctype("html")(
|
doctype("html")(
|
||||||
html(
|
html(
|
||||||
head(
|
head(
|
||||||
|
tags2.title("Trying out the starter page"),
|
||||||
|
meta(
|
||||||
|
charset := "UTF-8"
|
||||||
|
),
|
||||||
|
meta(
|
||||||
|
name := "viewport",
|
||||||
|
content := "width=device-width, initial-scale=1.0"
|
||||||
|
),
|
||||||
|
link(rel := "stylesheet", href := "/dist/output.css")
|
||||||
// title("Hello testing")
|
// title("Hello testing")
|
||||||
),
|
),
|
||||||
body(
|
body(
|
||||||
|
cls := "bg-blue-50 grid place-content-center h-screen",
|
||||||
div(
|
div(
|
||||||
h1("This is it, the start"),
|
h1(
|
||||||
|
cls := "text-2xl font-bold",
|
||||||
|
"This is it, the start"),
|
||||||
p("Let's keep going"),
|
p("Let's keep going"),
|
||||||
ul(
|
ul(
|
||||||
Range(1, 15).map(index =>
|
Range(1, 15).map(index =>
|
||||||
li(a(s"article with number $index", href := s"/article/$index"))
|
li(a(s"article with number $index", href := s"/article/$index", cls := "underline text-blue-500"))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -30,6 +43,9 @@ object Main extends cask.MainRoutes {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@cask.staticFiles("/dist")
|
||||||
|
def staticFileRoutes() = "/dist"
|
||||||
|
|
||||||
@cask.get("/article/:id")
|
@cask.get("/article/:id")
|
||||||
def articlePage(id: Long) = {
|
def articlePage(id: Long) = {
|
||||||
doctype("html")(
|
doctype("html")(
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
/** @type {import('tailwindcss').Config} */
|
||||||
|
module.exports = {
|
||||||
|
content: ["./src/**/*.scala"],
|
||||||
|
theme: {
|
||||||
|
extend: {},
|
||||||
|
},
|
||||||
|
plugins: [],
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue