Skip to content

Commit

Permalink
Tailwinf added
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Dec 10, 2024
1 parent e5528c3 commit 36b6a03
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 28 additions & 1 deletion rust-on-nails.com/content/docs/full-stack-web/styling.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,37 @@ tailwind:
cd /workspace/crates/web-assets && tailwind-extra -i ./input.css -o ./dist/tailwind.css --watch
```

Also create a `.gitignore` so that we don't include the dist folder in our repo.

```sh
dist
```

Now we can run

```sh
just tailwind
```

The stylesheet will be compiled.
The stylesheet will be compiled.

## Add the stylesheet to the layout

Update `crates/web-assets/build.rs` and add the `dist` folder to our static files.


```rust
let asset_dirs = vec![PathBuf::from("./images"), PathBuf::from("./dist")];
```

Update `crates/web-pages/src/layout.rs` and change the stylesheets entry.

```rust
stylesheets: vec![web_assets::files::tailwind_css.name.to_string()],
```

## With Tailwind

We're nearly there. Our app is not using tailwind.

![Screenshot](../screenshot-with-tailwind.png)

0 comments on commit 36b6a03

Please sign in to comment.