Add tailwind
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1 +1,4 @@
|
|||||||
/target
|
/target
|
||||||
|
|
||||||
|
# Tailwind output file
|
||||||
|
/assets/tailwind.css
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
[application]
|
[application]
|
||||||
|
tailwind_input = "style/tailwind.css"
|
||||||
|
|
||||||
[web.app]
|
[web.app]
|
||||||
title = "libretunes"
|
title = "libretunes"
|
||||||
|
|||||||
@@ -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
3
style/tailwind.css
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
@import "tailwindcss";
|
||||||
|
@source not "*";
|
||||||
|
@source "./src/**/*.{rs,html,css}";
|
||||||
Reference in New Issue
Block a user