Skip to content

Commit 1fb0e38

Browse files
committed
feat: tailwind v4 compat
1 parent 10b6c82 commit 1fb0e38

7 files changed

Lines changed: 227 additions & 64 deletions

File tree

apps/frontend/app/assets/css/main.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
@layer reset, normalize, tailwind-base, base, tailwind-utilities, utilities;
1+
@layer reset, base;
22
@import '@unocss/reset/tailwind.css' layer(reset);
3+
34
@import './palette.css';
45
@import './shadcn.css';
56
@import './scrollbar.css';

apps/frontend/app/assets/css/shadcn.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
}
8484
}
8585

86-
@layer base {
86+
@layer default {
8787
* {
8888
@apply border-border;
8989
}

apps/frontend/app/components/chat/LanguageDropdown.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const { locale, locales, setLocale } = useI18n()
66
<DropdownMenu :modal="true">
77
<DropdownMenuTrigger>
88
<Button
9-
class="h-fit w-11.5 px-2 py-1 font-medium uppercase text-h-4!"
9+
class="font-medium px-2 py-1 h-fit w-11.5 uppercase text-h4!"
1010
variant="ghost"
1111
>
1212
{{ locale.substring(0, 2) }}

apps/frontend/app/components/layouts/default/DefaultHeader.vue

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,42 @@ const convexVueContext = inject<ConvexVueContext>('convex-vue')
66
</script>
77

88
<template>
9-
<header class="grid grid-cols-12 h-73px items-center text-h-4 view-transition-header xl:gap-10">
10-
<div class="col-span-3 h-full flex items-center justify-start gap-2 py-4 text-xl">
11-
<NuxtLink to="https://github.com/NamesMT/starter-monorepo" external target="_blank" class="h-full flex items-center gap-3 text-h-3 font-black">
12-
<Logo class="h-full text-surface-900 dark:text-surface-0" />
9+
<header class="text-h4 grid grid-cols-12 h-73px items-center view-transition-header xl:gap-10">
10+
<div class="text-xl py-4 flex gap-2 col-span-3 h-full items-center justify-start">
11+
<NuxtLink to="https://github.com/NamesMT/starter-monorepo" external target="_blank" class="text-h3 font-black flex gap-3 h-full items-center">
12+
<Logo class="text-surface-900 h-full dark:text-surface-0" />
1313
<h1 class="whitespace-nowrap max-sm:hidden">
1414
starter-monorepo
1515
</h1>
1616
</NuxtLink>
1717
</div>
1818

1919
<div
20-
class="col-span-6 flex flex-row justify-center gap-2 py-2.5 text-surface-700 font-medium 2xl:gap-8 lg:gap-5 md:gap-4 sm:gap-3 xl:gap-6 [&>*]:(px-2) dark:text-surface-300"
20+
class="text-surface-700 font-medium py-2.5 flex flex-row gap-2 col-span-6 justify-center dark:text-surface-300 [&>*]:(px-2) 2xl:gap-8 lg:gap-5 md:gap-4 sm:gap-3 xl:gap-6"
2121
>
2222
<NuxtLink
2323
to="/" class="group flex items-center"
2424
exact-active-class="text-secondary border-b-2px border-secondary"
2525
>
26-
<span class="transition-all group-hover:text-h-3 group-hover:text-accent-foreground">{{ $t('pages.home.title') }}</span>
26+
<span class="transition-all group-hover:text-h3 group-hover:text-accent-foreground">{{ $t('pages.home.title') }}</span>
2727
</NuxtLink>
2828
<NuxtLink
2929
to="/test" class="group flex items-center"
3030
exact-active-class="text-secondary border-b-2px border-secondary"
3131
>
32-
<span class="transition-all group-hover:text-h-3 group-hover:text-accent-foreground">{{ $t('pages.test.title') }}</span>
32+
<span class="transition-all group-hover:text-h3 group-hover:text-accent-foreground">{{ $t('pages.test.title') }}</span>
3333
</NuxtLink>
3434
<NuxtLink
3535
v-if="convexVueContext?.clientRef?.value"
3636
to="/chat" class="group flex items-center"
3737
exact-active-class="text-secondary border-b-2px border-secondary"
3838
>
39-
<span class="transition-all group-hover:text-h-3 group-hover:text-accent-foreground">{{ $t('pages.chat.title') }}</span>
39+
<span class="transition-all group-hover:text-h3 group-hover:text-accent-foreground">{{ $t('pages.chat.title') }}</span>
4040
</NuxtLink>
4141
</div>
4242

43-
<div class="col-span-3 flex">
44-
<div class="flex grow items-center justify-end gap-4">
43+
<div class="flex col-span-3">
44+
<div class="flex grow gap-4 items-center justify-end">
4545
<LanguageDropdown />
4646
</div>
4747
</div>

apps/frontend/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"deploy": "pnpm run build && sh scripts/deploy.sh",
1414
"preview": "nuxt preview",
1515
"postinstall": "nuxt prepare",
16-
"shad-add": "pnpm dlx shadcn-vue@^1 add"
16+
"shad-add": "pnpm dlx shadcn-vue@2 add"
1717
},
1818
"dependencies": {
1919
"embla-carousel": "^8.6.0",
@@ -62,12 +62,12 @@
6262
"nuxt-svgo": "4.2.2",
6363
"ohash": "^2.0.11",
6464
"sass": "^1.92.1",
65-
"shadcn-nuxt": "^1.0.3",
66-
"tailwind-merge": "^2.6.0",
65+
"shadcn-nuxt": "^2.2.0",
66+
"tailwind-merge": "^3.3.1",
6767
"ufo": "^1.6.1",
6868
"unocss": "^66.5.0",
6969
"unocss-preset-animations": "^1.2.1",
70-
"unocss-preset-shadcn": "^0.5.0",
70+
"unocss-preset-shadcn": "^1.0.1",
7171
"vite-plugin-optimize-exclude": "^0.0.1",
7272
"vue": "^3.5.21",
7373
"vue-router": "^4.5.1"

apps/frontend/uno.config.ts

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
presetIcons,
44
presetTypography,
55
presetWebFonts,
6-
presetWind3,
6+
presetWind4,
77
transformerDirectives,
88
transformerVariantGroup,
99
} from 'unocss'
@@ -47,17 +47,41 @@ function commonColorVarsGen(varName: string, additionalVars?: Array<string>) {
4747
}
4848

4949
export default defineConfig({
50+
outputToCssLayers: true,
5051
theme: {
51-
fontSize: {
52-
'h-1': ['40px', '48px'],
53-
'h-2': ['32px', '40px'],
54-
'h-3': ['24px', '32px'],
55-
'h-4': ['20px', '28px'],
56-
57-
'body-1': ['18px', '26px'],
58-
'body-2': ['16px', '24px'],
59-
'body-3': ['14px', '20px'],
60-
'body-4': ['12px', '16px'],
52+
text: {
53+
h1: {
54+
fontSize: '40px',
55+
lineHeight: '48px',
56+
},
57+
h2: {
58+
fontSize: '32px',
59+
lineHeight: '40px',
60+
},
61+
h3: {
62+
fontSize: '24px',
63+
lineHeight: '32px',
64+
},
65+
h4: {
66+
fontSize: '20px',
67+
lineHeight: '28px',
68+
},
69+
body1: {
70+
fontSize: '18px',
71+
lineHeight: '26px',
72+
},
73+
body2: {
74+
fontSize: '16px',
75+
lineHeight: '24px',
76+
},
77+
body3: {
78+
fontSize: '14px',
79+
lineHeight: '20px',
80+
},
81+
body4: {
82+
fontSize: '12px',
83+
lineHeight: '16px',
84+
},
6185
},
6286
ringWidth: {
6387
DEFAULT: '3px',
@@ -142,7 +166,11 @@ export default defineConfig({
142166
},
143167
],
144168
presets: [
145-
presetWind3(),
169+
presetWind4({
170+
preflights: {
171+
reset: false, // We import the preflight reset ourself in main.scss
172+
},
173+
}),
146174
presetIcons({
147175
scale: 1.2,
148176
cdn: 'https://esm.sh/',

0 commit comments

Comments
 (0)