diff --git a/README.md b/README.md index 562cd6f..f244c92 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,12 @@ rustup target add wasm32-unknown-unknown We will also use the [Trunk] tool to run and build our project. +Finally, it's recommended to install the `leptosfmt` tool, since plain `rustfmt` +can't dealt with `view!` macros very well. +```sh +cargo install leptosfmt +``` + ## Developing To develop the project, run @@ -18,7 +24,6 @@ trunk serve --port 3000 --open ``` which, will open the app in your default browser at `http://localhost:3000`. - ## Deploying To build the project for release, use the command diff --git a/public/styles.scss b/public/styles.scss index 56b7814..46fde96 100644 --- a/public/styles.scss +++ b/public/styles.scss @@ -21,6 +21,16 @@ body { align-items: center; } +header { + display: flex; + align-items: center; + justify-content: end; +} + +header > select { + margin: 0 1em; +} + h1, h2, h3, @@ -35,6 +45,7 @@ h6 { h1.title { width: 80vw; max-inline-size: 80vw; + padding-top: 1rem; } p { @@ -62,21 +73,22 @@ form input { width: 4em; } -form > div.results { +div.results { display: grid; - grid-template-columns: 1fr 8em 5em 1fr; + grid-template-columns: 1fr 7em 1rem 5em 1fr; + padding-top: 1em; min-width: 20em; max-width: 30em; width: 30vw; font-size: 1.2em; } -form > div.results > span.left { +div.results > span.left { grid-column: 2 / 3; text-align: right; - padding-right: 1em; } -form > div.results > span.right { - grid-column: 3 / 4; +div.results > span.right { + grid-column: 4 / 5; + text-align: left; } diff --git a/rust-analyzer.toml b/rust-analyzer.toml new file mode 100644 index 0000000..c111f76 --- /dev/null +++ b/rust-analyzer.toml @@ -0,0 +1,2 @@ +[rustfmt] +overrideCommand = ["leptosfmt", "--stdin", "--rustfmt"] diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..f216078 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1 @@ +edition = "2024" diff --git a/src/components/calculator.rs b/src/components/calculator.rs index 209d77d..8211455 100644 --- a/src/components/calculator.rs +++ b/src/components/calculator.rs @@ -77,38 +77,45 @@ pub fn Calculator() -> impl IntoView { } />
-