From 63e2395caf4ae93ebde96d97e12fc946af1e9ac9 Mon Sep 17 00:00:00 2001 From: Ashelyn Rose Date: Sat, 22 Mar 2025 14:51:36 -0600 Subject: Component styles and hot-reloading --- src/components/layout/layout.module.css | 34 +++++++++++++++++++++++++++++++++ src/components/layout/mod.rs | 26 +++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 src/components/layout/layout.module.css create mode 100644 src/components/layout/mod.rs (limited to 'src/components/layout') diff --git a/src/components/layout/layout.module.css b/src/components/layout/layout.module.css new file mode 100644 index 0000000..5b9ccc2 --- /dev/null +++ b/src/components/layout/layout.module.css @@ -0,0 +1,34 @@ +main.layout { + min-height: 100vh; + display: grid; + max-width: 1000px; + margin: 0 auto; + grid-template-columns: 200px 1fr; + grid-template-rows: 200px 1fr 100px auto; +} + +.layout header { + display: flex; + grid-row: 1 / 2; + grid-column: 1 / 3; +} + +.layout nav { + grid-row: 2 / 3; + grid-column: 1 / 2; +} + +.layout article { + grid-row: 2 / 3; + grid-column: 2 / 3; +} + +.layout footer { + grid-column: 1 / 3; + grid-row: 3 / 4; +} + +.layout::after { + grid-column: 1 / 3; + grid-row: 4 / 5; +} diff --git a/src/components/layout/mod.rs b/src/components/layout/mod.rs new file mode 100644 index 0000000..6ec37da --- /dev/null +++ b/src/components/layout/mod.rs @@ -0,0 +1,26 @@ +use leptos::prelude::*; +use leptos::component; +use leptos_router::components::Outlet; + +stylance::import_crate_style!(styles, "src/components/layout/layout.module.css"); + +#[component] +pub fn Layout() -> impl IntoView { + view! { +
+
+

Site Title

+
+ +
+

Article

+ +
+ +
+ } +} -- cgit 1.4.1