Commit 80a233b
authored
Fix cloud background images to respect BASE_PATH (#5)
* Fix cloud background images to respect BASE_PATH
Convert inline style background-image to Tailwind bg-[url(...)] classes
so that Vite's CSS pipeline can automatically apply the base path.
Problem:
- Cloud images were using inline style attributes
- Inline styles are not processed by Vite and don't get base path
- This caused 404s on GitHub Pages subdirectory deployment
Solution:
- Use Tailwind arbitrary values: bg-[url('/images/...')]
- Tailwind classes are processed through Vite's CSS pipeline
- Base path is automatically applied during build
Tested:
- With BASE_PATH=/repo-name: URLs become /repo-name/images/cloud-*.jpg
- Without BASE_PATH: URLs remain /images/cloud-*.jpg
- Cloudflare Workers staging: works (BASE_PATH not set)
- GitHub Pages subdirectory: will work (BASE_PATH set)
* docs: document Tailwind usage for CSS images with BASE_PATH1 parent 2858152 commit 80a233b
2 files changed
Lines changed: 5 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 80 | + | |
| 81 | + | |
85 | 82 | | |
86 | 83 | | |
87 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
0 commit comments