MCPcopy Index your code
hub / github.com/LyonSyonII/dioxus-tailwindcss

github.com/LyonSyonII/dioxus-tailwindcss @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
10 symbols 14 edges 5 files 1 documented · 10%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Dioxus + TailwindCSS

Example and Template for the Rust Dioxus desktop/web framework.

Demo: https://garriga.dev/dioxus-tailwindcss

Common Dependencies

A nodejs installation is required. If yarn is installed, it'll be prioritized.

Desktop

Dependencies

Windows

Windows Desktop apps depend on WebView2 – a library that should be installed in all modern Windows distributions. If you have Edge installed, then Dioxus will work fine. If you don't have Webview2, then you can install it through Microsoft. MS provides 3 options:

  1. A tiny "evergreen" bootstrapper that fetches an installer from Microsoft's CDN
  2. A tiny installer that fetches Webview2 from Microsoft's CDN
  3. A statically linked version of Webview2 in your final binary for offline users

For development purposes, use Option 1.


Linux

Webview Linux apps require WebkitGtk. When distributing, this can be part of your dependency tree in your .rpm or .deb. However, likely, your users will already have WebkitGtk.

sudo apt install libwebkit2gtk-4.0-dev libgtk-3-dev libappindicator3-dev

When using Debian/bullseye libappindicator3-dev is no longer available but replaced by libayatana-appindicator3-dev.

# on Debian/bullseye use:
sudo apt install libwebkit2gtk-4.0-dev libgtk-3-dev libayatana-appindicator3-dev

If you run into issues, make sure you have all the basics installed, as outlined in the Tauri docs.


Running

cargo run

Web

cargo install dioxus-cli

Install the required target:

rustup target add wasm32-unknown-unknown

Serve/Dev

dioxus serve

Build

dioxus build --release

Troubleshooting

Problems I encountered while making this demo.

  • public files are not loading in Desktop builds

    In Desktop builds, the path of the assets is based on the root of the crate.
    So, for example, to load a file located on "$CRATE_ROOT/public/example.svg" you'd write:
    * Web: src: "example.svg"
    * Desktop: src: "public/example.svg"

    In the example I've used conditional compilation to change the path depending on the build (look at src/app.rs -> const DIOXUS_IMG).

  • Drop Shadows look broken when the logos are animated in Desktop builds

    I'm aware of it, but don't know the solution unfortunately, in web it works fine though.

  • Why not use the CDN instead of Tailwind CLI?

    The CDN recommended by the official examples of Dioxus is outdated, and the newest version of Tailwind does not support that kind of usage.

    Also, it's not recommended to use in production, as it inserts ALL css classes into your html.

    The workaround I've used is based on the instructions of the tailwind.rs example (dioxus/examples/tailwind.rs).

Core symbols most depended-on inside this repo

if_windows
called by 3
build.rs
wasm_or_else
called by 3
src/app.rs
install_packages
called by 1
build.rs
url_encode
called by 1
macros/src/lib.rs
main
called by 0
build.rs
include_url_encoded
called by 0
macros/src/lib.rs
main
called by 0
src/main.rs
Root
called by 0
src/main.rs

Shape

Function 10

Languages

Rust100%

Modules by API surface

src/app.rs3 symbols
build.rs3 symbols
src/main.rs2 symbols
macros/src/lib.rs2 symbols

For agents

$ claude mcp add dioxus-tailwindcss \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact