You may have guessed by now if you looked at the layout we created that we're going to use Tailwind for styling.
We'll add this to our web-assets
folder and then to our layout. We have pre-installed tailwind-extra so we can use tailwind without creating an npm pipeline.
This will create a tailwind.config.js
file.
We also need to create a input.css
file.
@ @ @
Add the following to your ´Justfile´
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.
Now we can run
The stylesheet will be compiled.
Update crates/web-assets/build.rs
and add the dist
folder to our static files.
let asset_dirs = vec!;
Update crates/web-pages/src/layout.rs
and change the stylesheets entry.
stylesheets: vec!,
We're nearly there. Our app is not using tailwind.