Add tailwind

This commit is contained in:
2026-06-10 21:11:27 -04:00
parent 23d1733e10
commit d31547406e
4 changed files with 14 additions and 1 deletions

3
.gitignore vendored
View File

@@ -1 +1,4 @@
/target /target
# Tailwind output file
/assets/tailwind.css

View File

@@ -1,4 +1,5 @@
[application] [application]
tailwind_input = "style/tailwind.css"
[web.app] [web.app]
title = "libretunes" title = "libretunes"

View File

@@ -1,5 +1,7 @@
use dioxus::prelude::*; use dioxus::prelude::*;
const TAILWIND_CSS: Asset = asset!("/assets/tailwind.css");
#[derive(Debug, Clone, Routable, PartialEq)] #[derive(Debug, Clone, Routable, PartialEq)]
#[rustfmt::skip] #[rustfmt::skip]
enum Route { enum Route {
@@ -10,6 +12,7 @@ enum Route {
#[component] #[component]
fn App() -> Element { fn App() -> Element {
rsx! { rsx! {
document::Link { rel: "stylesheet", href: TAILWIND_CSS }
Router::<Route> {} Router::<Route> {}
} }
} }
@@ -18,7 +21,10 @@ fn App() -> Element {
#[component] #[component]
fn Home() -> Element { fn Home() -> Element {
rsx! { rsx! {
"Hello, world!" p {
class: "text-lg",
"Hello, world!"
}
} }
} }

3
style/tailwind.css Normal file
View File

@@ -0,0 +1,3 @@
@import "tailwindcss";
@source not "*";
@source "./src/**/*.{rs,html,css}";