Skip to content

Commit ad42c80

Browse files
authored
Merge pull request #63 from pgulb/49-use-tailwindcss-not-from-cdn
49 use tailwindcss not from cdn
2 parents 45f4b32 + 3d1fc91 commit ad42c80

File tree

5 files changed

+34
-3
lines changed

5 files changed

+34
-3
lines changed

.github/workflows/deploy-pwa.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ jobs:
3030
uses: actions/checkout@v4
3131
- name: Setup Pages
3232
uses: actions/configure-pages@v5
33+
- name: Install wget
34+
run: sudo apt-get update && sudo apt-get install -y wget
35+
- name: Install Tailwind CLI
36+
run: |
37+
wget https://github.com/tailwindlabs/tailwindcss/releases/download/v3.4.14/tailwindcss-linux-x64 &&
38+
chmod +x tailwindcss-linux-x64 &&
39+
sudo mv tailwindcss-linux-x64 /usr/bin/tailwindcss
3340
- name: Setup Go environment
3441
uses: actions/setup-go@v5.0.2
3542
with:
@@ -40,10 +47,12 @@ jobs:
4047
run: |
4148
cd pwa &&
4249
mkdir -p ./app/web &&
50+
mv ./web/* ./app/web/ &&
4351
echo -n ${{ vars.FLUSH_API_URL }} > ./app/web/apiurl &&
4452
GOARCH=wasm GOOS=js go build -o ./app/web/app.wasm ./main/main.go &&
4553
BUILD_STATIC=true go build -o ./flush-log ./main/main.go &&
4654
./flush-log &&
55+
tailwindcss -i ./app/web/tailwind-input.css -o ./app/web/style.css --minify
4756
ls -ltrRa &&
4857
mv ./*.html ./*.webmanifest ./*.js ./*.css ./app &&
4958
mv app ..

.gitignore

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,20 @@ venv/
55

66
# go
77
tmp/
8-
web/
98
flush-log
109
flush-log.exe
10+
*.exe
11+
apiurl
1112

1213
# drawio
1314
.$*
15+
16+
# web static artifacts
17+
wasm_exec.js
18+
app-worker.js
19+
app.js
20+
app.css
21+
*.html
22+
*.webmanifest
23+
app.wasm
24+
style.css

pwa/flush/pwa.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ func Run() {
2121
Name: "Flush-Log",
2222
Description: "bowel tracking app",
2323
Resources: app.GitHubPages("flush-log"),
24-
Scripts: []string{
25-
"https://cdn.tailwindcss.com",
24+
Styles: []string{
25+
"/web/style.css",
2626
},
2727
})
2828
if err != nil {

pwa/tailwind.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/** @type {import('tailwindcss').Config} */
2+
module.exports = {
3+
content: ["./*.{html,js}"],
4+
theme: {
5+
extend: {},
6+
},
7+
plugins: [],
8+
}

pwa/web/tailwind-input.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;

0 commit comments

Comments
 (0)