升级 Tailwind CSS 到 v4 并简化构建流程
- 将 input.css 从 v3 的 @tailwind 指令迁移到 v4 的 @import "tailwindcss" - 删除 tailwind.config.js(v4 不再需要配置文件) - 删除 package.json(完全使用本地 tailwindcss CLI) - 重新构建 public/style.css 为 v4 格式 - 添加 Makefile 提供 dev/build/css/css-watch/clean 命令 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
61638fafcc
commit
390ab98b86
22
Makefile
Normal file
22
Makefile
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
.PHONY: dev build css css-watch clean
|
||||||
|
|
||||||
|
dev:
|
||||||
|
@echo "Starting tailwindcss watch and dx serve..."
|
||||||
|
@tailwindcss -i input.css -o public/style.css --watch & \
|
||||||
|
TAILWIND_PID=$$!; \
|
||||||
|
trap 'kill $$TAILWIND_PID 2>/dev/null; exit' INT TERM EXIT; \
|
||||||
|
dx serve
|
||||||
|
|
||||||
|
build:
|
||||||
|
@tailwindcss -i input.css -o public/style.css --minify
|
||||||
|
@dx build --release
|
||||||
|
|
||||||
|
css:
|
||||||
|
@tailwindcss -i input.css -o public/style.css
|
||||||
|
|
||||||
|
css-watch:
|
||||||
|
@tailwindcss -i input.css -o public/style.css --watch
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@cargo clean
|
||||||
|
@rm -f public/style.css
|
||||||
@ -1,3 +1 @@
|
|||||||
@tailwind base;
|
@import "tailwindcss";
|
||||||
@tailwind components;
|
|
||||||
@tailwind utilities;
|
|
||||||
|
|||||||
18
package.json
18
package.json
@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "yggdrasil",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"description": "",
|
|
||||||
"main": "index.js",
|
|
||||||
"scripts": {
|
|
||||||
"build:css": "tailwindcss -i input.css -o public/style.css --minify",
|
|
||||||
"watch:css": "tailwindcss -i input.css -o public/style.css --watch",
|
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
|
||||||
},
|
|
||||||
"keywords": [],
|
|
||||||
"author": "",
|
|
||||||
"license": "ISC",
|
|
||||||
"type": "commonjs",
|
|
||||||
"devDependencies": {
|
|
||||||
"tailwindcss": "^3.4.19"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
634
public/style.css
634
public/style.css
File diff suppressed because one or more lines are too long
@ -1,9 +0,0 @@
|
|||||||
/** @type {import('tailwindcss').Config} */
|
|
||||||
module.exports = {
|
|
||||||
darkMode: 'class',
|
|
||||||
content: ['./src/**/*.rs', './index.html'],
|
|
||||||
theme: {
|
|
||||||
extend: {},
|
|
||||||
},
|
|
||||||
plugins: [],
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user