feat: add unocss
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
node_modules
|
||||
Session.vim
|
||||
.direnv
|
||||
.vercel
|
||||
@@ -5,3 +6,4 @@ Session.vim
|
||||
dist
|
||||
tmp
|
||||
bin
|
||||
static/uno.css
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
golangci-lint
|
||||
templ
|
||||
nodePackages_latest.vercel
|
||||
nodejs_20
|
||||
corepack_20
|
||||
];
|
||||
};
|
||||
});
|
||||
|
||||
24
jsconfig.json
Normal file
24
jsconfig.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/jsconfig",
|
||||
"compilerOptions": {
|
||||
"checkJs": true,
|
||||
"allowJs": true,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"moduleResolution": "node",
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"module": "ESNext",
|
||||
"target": "ESNext",
|
||||
"alwaysStrict": true,
|
||||
"outDir": "./dist"
|
||||
},
|
||||
"include": [
|
||||
"./uno.config.js"
|
||||
],
|
||||
"exclude": [
|
||||
"./node_modules/**",
|
||||
"./dist/**"
|
||||
]
|
||||
}
|
||||
@@ -3,9 +3,10 @@ package layouts
|
||||
templ Page(title string) {
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="/uno.css"/>
|
||||
<title>{ title }</title>
|
||||
</head>
|
||||
<body>
|
||||
<body class="bg-black">
|
||||
{ children... }
|
||||
</body>
|
||||
</html>
|
||||
|
||||
3
makefile
3
makefile
@@ -3,6 +3,7 @@ PORT?=8080
|
||||
all: run
|
||||
|
||||
dev:
|
||||
pnpm unocss -w &
|
||||
air -build.pre_cmd 'make templ' \
|
||||
-build.include_ext 'templ' \
|
||||
-proxy.enabled true \
|
||||
@@ -27,6 +28,7 @@ run-vercel: bin/vercel
|
||||
./bin/vercel
|
||||
|
||||
build-static: templ
|
||||
pnpm unocss
|
||||
go run ./cmd/build/main.go
|
||||
|
||||
build-vercel: bin/vercel build-static
|
||||
@@ -49,4 +51,5 @@ clean:
|
||||
if [[ -d "dist" ]]; then rm -r ./dist; fi
|
||||
if [[ -d "tmp" ]]; then rm -r ./tmp; fi
|
||||
if [[ -d "bin" ]]; then rm -r ./bin; fi
|
||||
rm ./static/uno.css
|
||||
rm $(TEMPL_FILES)
|
||||
|
||||
9
package.json
Normal file
9
package.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "www",
|
||||
"version": "0.0.1",
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.12.12",
|
||||
"@unocss/cli": "^0.60.3",
|
||||
"unocss": "^0.60.3"
|
||||
}
|
||||
}
|
||||
1744
pnpm-lock.yaml
generated
Normal file
1744
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
32
uno.config.js
Normal file
32
uno.config.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import {
|
||||
defineConfig,
|
||||
presetIcons,
|
||||
presetTypography,
|
||||
presetUno,
|
||||
presetWebFonts,
|
||||
transformerDirectives,
|
||||
transformerVariantGroup,
|
||||
} from 'unocss';
|
||||
|
||||
export default defineConfig({
|
||||
cli: {
|
||||
entry: {
|
||||
patterns: [
|
||||
'./{pages,layouts}/**/*.templ',
|
||||
'./static/**/*.{js,css,html}',
|
||||
'!./static/uno.css',
|
||||
],
|
||||
outFile: './static/uno.css',
|
||||
},
|
||||
},
|
||||
presets: [
|
||||
presetIcons(),
|
||||
presetTypography(),
|
||||
presetUno(),
|
||||
presetWebFonts(),
|
||||
],
|
||||
transformers: [
|
||||
transformerDirectives(),
|
||||
transformerVariantGroup(),
|
||||
],
|
||||
});
|
||||
Reference in New Issue
Block a user