From d31547406e4e1f464641216529be35852005e8fc Mon Sep 17 00:00:00 2001 From: Ethan Girouard Date: Wed, 10 Jun 2026 21:11:27 -0400 Subject: [PATCH] Add tailwind --- .gitignore | 3 +++ Dioxus.toml | 1 + src/main.rs | 8 +++++++- style/tailwind.css | 3 +++ 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 style/tailwind.css diff --git a/.gitignore b/.gitignore index ea8c4bf..a5eac2b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ /target + +# Tailwind output file +/assets/tailwind.css diff --git a/Dioxus.toml b/Dioxus.toml index 1fc99b5..79d41c1 100644 --- a/Dioxus.toml +++ b/Dioxus.toml @@ -1,4 +1,5 @@ [application] +tailwind_input = "style/tailwind.css" [web.app] title = "libretunes" diff --git a/src/main.rs b/src/main.rs index 3b76760..f18610c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,7 @@ use dioxus::prelude::*; +const TAILWIND_CSS: Asset = asset!("/assets/tailwind.css"); + #[derive(Debug, Clone, Routable, PartialEq)] #[rustfmt::skip] enum Route { @@ -10,6 +12,7 @@ enum Route { #[component] fn App() -> Element { rsx! { + document::Link { rel: "stylesheet", href: TAILWIND_CSS } Router:: {} } } @@ -18,7 +21,10 @@ fn App() -> Element { #[component] fn Home() -> Element { rsx! { - "Hello, world!" + p { + class: "text-lg", + "Hello, world!" + } } } diff --git a/style/tailwind.css b/style/tailwind.css new file mode 100644 index 0000000..906ef8e --- /dev/null +++ b/style/tailwind.css @@ -0,0 +1,3 @@ +@import "tailwindcss"; +@source not "*"; +@source "./src/**/*.{rs,html,css}";