feat: use unocss wind4 preset

This commit is contained in:
Anthony Fu committed 2025-03-05 15:12:05 +08:00
1 parent 1a3ee1ffab
commit 2c6d05f0be
12 files changed
+323 -362

No files matched your search

+1 -2
View File
@@ -23,7 +23,6 @@ body,
} }
html.dark { html.dark {
background: #222; color-scheme: dark;
color: white;
} }
</style> </style>
+2 -2
View File
@@ -4,13 +4,13 @@ const { count, inc, dec } = useCount()
<template> <template>
<div inline-flex m="y-3"> <div inline-flex m="y-3">
<button rounded-full p-2 btn @click="dec()"> <button p-2 rounded-full btn @click="dec()">
<div i-carbon-subtract /> <div i-carbon-subtract />
</button> </button>
<div font="mono" w="15" m-auto inline-block> <div font="mono" w="15" m-auto inline-block>
{{ count }} {{ count }}
</div> </div>
<button rounded-full p-2 btn @click="inc()"> <button p-2 rounded-full btn @click="inc()">
<div i-carbon-add /> <div i-carbon-add />
</button> </button>
</div> </div>
+3 -2
View File
@@ -14,7 +14,8 @@ function go() {
id="input" id="input"
v-model="name" v-model="name"
placeholder="What's your name?" placeholder="What's your name?"
type="text" autocomplete="off" type="text"
autocomplete="off"
p="x-4 y-2" m="t-5" w="250px" p="x-4 y-2" m="t-5" w="250px"
text="center" bg="transparent" text="center" bg="transparent"
border="~ rounded gray-200 dark:gray-700" border="~ rounded gray-200 dark:gray-700"
@@ -23,7 +24,7 @@ function go() {
> >
<div> <div>
<button <button
m-3 text-sm btn text-sm m-3 btn
:disabled="!name" :disabled="!name"
@click="go" @click="go"
> >
+5 -5
View File
@@ -1,8 +1,8 @@
<template> <template>
<div inline-flex cursor-default text-2xl font-300> <div text-2xl font-300 inline-flex cursor-default>
<div flex flex-col children:mx-auto> <div flex flex-col children:mx-auto>
<img inline-block h-18 w-18 src="/nuxt.svg"> <img h-18 w-18 inline-block src="/nuxt.svg">
<span mt--2 text-green5>Nuxt 3</span> <span text-green5 mt--2>Nuxt 3</span>
</div> </div>
<div <div
text="3xl gray4" text="3xl gray4"
@@ -10,8 +10,8 @@
i-carbon-add transform transition-all-500 hover:rotate-135 i-carbon-add transform transition-all-500 hover:rotate-135
/> />
<div flex flex-col children:mx-auto> <div flex flex-col children:mx-auto>
<img inline-block h-18 w-18 src="/vite.png"> <img h-18 w-18 inline-block src="/vite.png">
<span mt--2 text-purple5>Vitesse</span> <span text-purple-500 mt--2>Vitesse</span>
</div> </div>
</div> </div>
</template> </template>
+1 -1
View File
@@ -2,7 +2,7 @@
<main class="px-10 py-20 text-center"> <main class="px-10 py-20 text-center">
<slot /> <slot />
<Footer /> <Footer />
<div class="mx-auto mt-5 text-center text-sm opacity-25"> <div class="text-sm mx-auto mt-5 text-center opacity-25">
[Default Layout] [Default Layout]
</div> </div>
</main> </main>
+1 -1
View File
@@ -2,7 +2,7 @@
<main class="px-10 py-20 text-center"> <main class="px-10 py-20 text-center">
<slot /> <slot />
<Footer /> <Footer />
<div class="mx-auto mt-5 text-center text-sm opacity-25"> <div class="text-sm mx-auto mt-5 text-center opacity-25">
[Home Layout] [Home Layout]
</div> </div>
</main> </main>
+3 -3
View File
@@ -14,7 +14,7 @@ definePageMeta({
<template> <template>
<div> <div>
<div i-twemoji:waving-hand inline-block animate-shake-x animate-duration-5000 text-4xl /> <div i-twemoji:waving-hand text-4xl inline-block animate-shake-x animate-duration-5000 />
<h3 text-2xl font-500> <h3 text-2xl font-500>
Hi, Hi,
</h3> </h3>
@@ -23,7 +23,7 @@ definePageMeta({
</div> </div>
<template v-if="user.otherNames.length"> <template v-if="user.otherNames.length">
<div my-4 text-sm> <div text-sm my-4>
<span op-50>Also as known as:</span> <span op-50>Also as known as:</span>
<ul> <ul>
<li v-for="otherName in user.otherNames" :key="otherName"> <li v-for="otherName in user.otherNames" :key="otherName">
@@ -39,7 +39,7 @@ definePageMeta({
<div> <div>
<NuxtLink <NuxtLink
class="m-3 text-sm btn" class="text-sm m-3 btn"
to="/" to="/"
> >
Back Back
+1 -1
View File
@@ -16,7 +16,7 @@ const online = useOnline()
You're offline You're offline
</div> </div>
<template #fallback> <template #fallback>
<div italic op50> <div op50 italic>
<span animate-pulse>Loading...</span> <span animate-pulse>Loading...</span>
</div> </div>
</template> </template>
-4
View File
@@ -33,10 +33,6 @@ export default defineNuxtConfig({
}, },
}, },
css: [
'@unocss/reset/tailwind.css',
],
colorMode: { colorMode: {
classSuffix: '', classSuffix: '',
}, },
+5 -4
View File
@@ -14,23 +14,24 @@
"typecheck": "vue-tsc --noEmit" "typecheck": "vue-tsc --noEmit"
}, },
"devDependencies": { "devDependencies": {
"@antfu/eslint-config": "^4.4.0", "@antfu/eslint-config": "^4.5.1",
"@iconify-json/carbon": "^1.2.8", "@iconify-json/carbon": "^1.2.8",
"@iconify-json/twemoji": "^1.2.2", "@iconify-json/twemoji": "^1.2.2",
"@nuxt/devtools": "^2.1.3", "@nuxt/devtools": "^2.1.3",
"@nuxt/eslint": "^1.1.0", "@nuxt/eslint": "^1.1.0",
"@nuxtjs/color-mode": "^3.5.2", "@nuxtjs/color-mode": "^3.5.2",
"@pinia/nuxt": "^0.10.1", "@pinia/nuxt": "^0.10.1",
"@unocss/eslint-config": "^66.0.0", "@unocss/eslint-config": "^66.1.0-beta.3",
"@unocss/nuxt": "^66.0.0", "@unocss/nuxt": "^66.1.0-beta.3",
"@vite-pwa/nuxt": "^0.10.6", "@vite-pwa/nuxt": "^0.10.6",
"@vueuse/nuxt": "^12.7.0", "@vueuse/nuxt": "^12.8.0",
"consola": "^3.4.0", "consola": "^3.4.0",
"eslint": "^9.21.0", "eslint": "^9.21.0",
"eslint-plugin-format": "^1.0.1", "eslint-plugin-format": "^1.0.1",
"nuxt": "^3.15.4", "nuxt": "^3.15.4",
"pinia": "^3.0.1", "pinia": "^3.0.1",
"typescript": "^5.8.2", "typescript": "^5.8.2",
"unocss": "66.1.0-beta.3",
"vue-tsc": "^2.2.8" "vue-tsc": "^2.2.8"
}, },
"pnpm": { "pnpm": {
+299 -335
View File
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -4,8 +4,8 @@ import {
presetAttributify, presetAttributify,
presetIcons, presetIcons,
presetTypography, presetTypography,
presetUno,
presetWebFonts, presetWebFonts,
presetWind4,
transformerDirectives, transformerDirectives,
transformerVariantGroup, transformerVariantGroup,
} from 'unocss' } from 'unocss'
@@ -16,7 +16,7 @@ export default defineConfig({
['icon-btn', 'inline-block cursor-pointer select-none opacity-75 transition duration-200 ease-in-out hover:opacity-100 hover:text-teal-600'], ['icon-btn', 'inline-block cursor-pointer select-none opacity-75 transition duration-200 ease-in-out hover:opacity-100 hover:text-teal-600'],
], ],
presets: [ presets: [
presetUno(), presetWind4(),
presetAttributify(), presetAttributify(),
presetIcons({ presetIcons({
scale: 1.2, scale: 1.2,