diff --git a/examples/crm.rs b/examples/crm.rs index 09a2f2a89..504459fc7 100644 --- a/examples/crm.rs +++ b/examples/crm.rs @@ -27,7 +27,7 @@ fn app(cx: Scope) -> Element { let description = use_state(&cx, String::new); cx.render(rsx!( - body { + body { margin_left: "35%", link { rel: "stylesheet", diff --git a/examples/tailwind.rs b/examples/tailwind.rs index 5e0632d34..385e98776 100644 --- a/examples/tailwind.rs +++ b/examples/tailwind.rs @@ -1,12 +1,11 @@ //! Example: Basic Tailwind usage -//! +//! //! This example shows how an app might be styled with TailwindCSS. -//! +//! //! To minify your tailwind bundle, currently you need to use npm. Follow these instructions: -//! +//! //! https://dev.to/arctic_hen7/how-to-set-up-tailwind-css-with-yew-and-trunk-il9 - use dioxus::prelude::*; fn main() { @@ -44,7 +43,7 @@ pub fn app(cx: Scope) -> Element { RightArrowIcon {} } } - } + } section { class: "text-gray-400 bg-gray-900 body-font", div { class: "container mx-auto flex px-5 py-24 md:flex-row flex-col items-center", @@ -73,11 +72,11 @@ pub fn app(cx: Scope) -> Element { } } div { class: "lg:max-w-lg lg:w-full md:w-1/2 w-5/6", - img { - class: "object-cover object-center rounded", + img { + class: "object-cover object-center rounded", src: "https://i.imgur.com/oK6BLtw.png", referrerpolicy:"no-referrer", - alt: "hero", + alt: "hero", } } } @@ -86,8 +85,6 @@ pub fn app(cx: Scope) -> Element { )) } - - pub fn StacksIcon(cx: Scope) -> Element { cx.render(rsx!( svg { diff --git a/examples/todomvc.rs b/examples/todomvc.rs index d88ec31b4..b41adc5f0 100644 --- a/examples/todomvc.rs +++ b/examples/todomvc.rs @@ -1,6 +1,5 @@ use dioxus::prelude::*; - fn main() { dioxus::desktop::launch(app); } @@ -19,7 +18,6 @@ pub struct TodoItem { pub contents: String, } - pub fn app(cx: Scope<()>) -> Element { let todos = use_state(&cx, || im_rc::HashMap::::default()); let filter = use_state(&cx, || FilterState::All); @@ -80,9 +78,9 @@ pub fn app(cx: Scope<()>) -> Element { } (!todos.is_empty()).then(|| rsx!( footer { class: "footer", - span { class: "todo-count", - strong {"{items_left} "} - span {"{item_text} left"} + span { class: "todo-count", + strong {"{items_left} "} + span {"{item_text} left"} } ul { class: "filters", li { class: "All", a { onclick: move |_| filter.set(FilterState::All), "All" }} @@ -90,8 +88,8 @@ pub fn app(cx: Scope<()>) -> Element { li { class: "Completed", a { onclick: move |_| filter.set(FilterState::Completed), "Completed" }} } (show_clear_completed).then(|| rsx!( - button { - class: "clear-completed", + button { + class: "clear-completed", onclick: move |_| todos.modify().retain(|_, todo| todo.checked == false), "Clear completed" } diff --git a/packages/core/Cargo.toml b/packages/core/Cargo.toml index 53d169760..b19f6eeab 100644 --- a/packages/core/Cargo.toml +++ b/packages/core/Cargo.toml @@ -66,7 +66,3 @@ harness = false [[bench]] name = "jsframework" harness = false - -[[example]] -name = "rows" -path = "./examples/rows.rs"