Skip to content

Commit

Permalink
dioxus working with tailwindcss, not yet dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
oceanbluesky committed Dec 13, 2024
1 parent 5397000 commit a07af12
Show file tree
Hide file tree
Showing 7 changed files with 757 additions and 46 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dioxus-router = "^0.6.0"
serde = { version = "^1.0.216", features = ["derive"] }
serde_json = "^1.0"
stylist = "^0.13"
manganis = "^0.6.0"

# Allow wasm-bindgen to update dynamically while staying within major version 0.2
wasm-bindgen = "^0.2.99"
Expand Down
3 changes: 3 additions & 0 deletions Dioxus.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[application]
output = "dist"
serve_dir = "dist"
20 changes: 1 addition & 19 deletions __about_these_files.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,7 @@ https://dioxuslabs.com/learn/0.5/cookbook/tailwind/
run this to build tailwind.css and dx serve index.html:
npm run serve

Ensure 'cargo add manganis' has been run in terminal so manganis will be able
to collect and link the css within the index.html file compiled by Dioxus. (Otherwise it will be necessary to handcode this css link in the dist/assets/index.html file: <link rel="stylesheet" href="assets/styles/tailwind.css"> )




_____


the 'npm commands' are in package.json (if files are moved update the package.json file as well)


* this needs 'npm install concurrently --save-dev' to ensure CSS watching and dx server run simultaneously

* this also needs 'cargo add manganis' to be run in the termiinal to ensure Dioxus can link the compoiled tailwind.css file from the index.html file Dioxus compiles
( src/styles/input.css is used to create the output css file dist/assets/styles/tailwind.css)

* 'tailwind.config.js' is used to tell tailwind where to find files to compile

[Since now using unhashed tailwind filename this is no longer necessary:] Ensure 'cargo add manganis' has been run in terminal so manganis will be able to collect and link the css within the index.html file compiled by Dioxus. (Otherwise it will be necessary to handcode this css link in the dist/assets/index.html file: <link rel="stylesheet" href="assets/styles/tailwind.css"> )


______
Expand Down
2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8" />
<link rel="stylesheet" href="/tailwindcssf974d4311df7185b.css">
<link rel="stylesheet" href="/assets/styles/tailwind.css">

</head>
<body>
Expand Down
Loading

0 comments on commit a07af12

Please sign in to comment.