Skip to content

Commit e2766bd

Browse files
⚡ Upgrade tailwind version to 4 (#170)
* ⚡️ Upgrade Tailwind version to 4 * 🔥 Add GSAP and update theme toggle animations * ✨ Add cursor pointer style for buttons in base layer
1 parent c0538cf commit e2766bd

23 files changed

+852
-1658
lines changed

package-lock.json

Lines changed: 652 additions & 1444 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,19 @@
1212
"@docsearch/js": "^3.9.0",
1313
"@fontsource/poppins": "^5.2.6",
1414
"@tailwindcss/forms": "^0.5.10",
15+
"@tailwindcss/postcss": "^4.1.8",
1516
"@tailwindcss/typography": "^0.5.16",
1617
"alpinejs": "^3.14.9",
17-
"autoprefixer": "^10.4.21",
1818
"axios": "^1.9.0",
19+
"gsap": "^3.13.0",
1920
"laravel-vite-plugin": "^0.7.8",
20-
"motion": "^12.10.4",
21+
"motion": "^12.16.0",
2122
"number-flow": "^0.5.7",
22-
"postcss": "^8.5.3",
23+
"postcss": "^8.5.4",
2324
"prettier": "^3.5.3",
2425
"prettier-plugin-blade": "^2.1.21",
25-
"prettier-plugin-tailwindcss": "^0.6.11",
26-
"tailwindcss": "^3.4.17",
26+
"prettier-plugin-tailwindcss": "^0.6.12",
27+
"tailwindcss": "^4.1.8",
2728
"vite": "^4.5.14"
2829
}
2930
}

postcss.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export default {
22
plugins: {
3-
tailwindcss: {},
4-
autoprefixer: {},
3+
'@tailwindcss/postcss': {},
54
},
65
};

public/js/filament/forms/components/markdown-editor.js

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/js/filament/forms/components/rich-editor.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/js/filament/forms/components/select.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/js/filament/support/support.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/css/app.css

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,50 @@
1-
@tailwind base;
2-
@tailwind components;
3-
@tailwind utilities;
1+
@import 'tailwindcss';
2+
3+
@plugin '@tailwindcss/typography';
4+
@plugin '@tailwindcss/forms';
5+
6+
@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';
7+
@source '../../storage/framework/views/*.php';
8+
@source '../../vendor/filament/**/*.blade.php';
9+
10+
@custom-variant dark (&:where(.dark, .dark *));
11+
12+
@theme {
13+
--color-mirage: #141624;
14+
--color-haiti: #16182c;
15+
--color-cloud: #2b2e53;
16+
17+
--font-poppins: 'Poppins', Verdana, sans-serif;
18+
}
19+
20+
@utility container {
21+
margin-inline: auto;
22+
}
23+
24+
@layer base {
25+
button:not(:disabled),
26+
[role='button']:not(:disabled) {
27+
cursor: pointer;
28+
}
29+
}
30+
31+
/*
32+
The default border color has changed to `currentcolor` in Tailwind CSS v4,
33+
so we've added these compatibility styles to make sure everything still
34+
looks the same as it did with Tailwind CSS v3.
35+
36+
If we ever want to remove these styles, we need to add an explicit border
37+
color utility to any element that depends on these defaults.
38+
*/
39+
@layer base {
40+
*,
41+
::after,
42+
::before,
43+
::backdrop,
44+
::file-selector-button {
45+
border-color: var(--color-gray-200, currentcolor);
46+
}
47+
}
448

549
@layer base {
650
html {

resources/css/docsearch.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@reference "./app.css"
2+
13
:root {
24
--docsearch-container-background: rgba(0, 0, 0, 0.5);
35
--docsearch-primary-color: #987af1;
@@ -34,11 +36,11 @@
3436
}
3537

3638
.DocSearch-Button-Placeholder {
37-
@apply hidden pl-1 pr-1 text-sm text-black/60 min-[400px]:block min-[520px]:pr-20 dark:text-white/60;
39+
@apply hidden pr-1 pl-1 text-sm text-black/60 min-[400px]:block min-[520px]:pr-20 dark:text-white/60;
3840
}
3941

4042
.DocSearch-Button-Keys {
41-
@apply ml-1 mt-1 hidden min-w-[auto] text-sm leading-none min-[520px]:flex;
43+
@apply mt-1 ml-1 hidden min-w-[auto] text-sm leading-none min-[520px]:flex;
4244
}
4345

4446
.DocSearch-Button-Key {

resources/js/app.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import './fonts'
22
import './bootstrap'
33
import 'number-flow'
4+
import { gsap } from 'gsap'
45
import {
56
Livewire,
67
Alpine,
@@ -49,6 +50,9 @@ window.motion = {
4950
cubicBezier: cubicBezier,
5051
}
5152

53+
// GSAP
54+
window.gsap = gsap
55+
5256
// Alpine
5357
Alpine.data('codeBlock', codeBlock)
5458
Alpine.magic('refAll', (el) => {

resources/views/components/alert-v1-announcement.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ class="relative z-0 mt-5 flex flex-col items-start gap-3 overflow-hidden rounded
66
>
77
{{-- Blue circle --}}
88
<div
9-
class="absolute left-6 top-0 -z-10 hidden h-32 w-6 -rotate-[60deg] rounded-full blur-lg min-[450px]:top-1/2 min-[450px]:-translate-y-1/2 dark:block dark:bg-gradient-to-b dark:from-blue-500 dark:to-blue-500/10"
9+
class="absolute left-6 top-0 -z-10 hidden h-32 w-6 -rotate-60 rounded-full blur-lg min-[450px]:top-1/2 min-[450px]:-translate-y-1/2 dark:block dark:bg-linear-to-b dark:from-blue-500 dark:to-blue-500/10"
1010
aria-hidden="true"
1111
></div>
1212

1313
{{-- White circle --}}
1414
<div
15-
class="absolute left-20 top-0 -z-20 hidden h-32 w-3 -rotate-[60deg] rounded-full blur-lg min-[450px]:top-1/2 min-[450px]:-translate-y-1/2 dark:block dark:bg-gradient-to-b dark:from-white/30 dark:to-transparent"
15+
class="absolute left-20 top-0 -z-20 hidden h-32 w-3 -rotate-60 rounded-full blur-lg min-[450px]:top-1/2 min-[450px]:-translate-y-1/2 dark:block dark:bg-linear-to-b dark:from-white/30 dark:to-transparent"
1616
aria-hidden="true"
1717
></div>
1818

1919
{{-- Icon --}}
2020
<div
21-
class="grid size-10 place-items-center rounded-full bg-gray-200/50 backdrop-blur-sm dark:bg-black/30"
21+
class="grid size-10 place-items-center rounded-full bg-gray-200/50 backdrop-blur-xs dark:bg-black/30"
2222
aria-hidden="true"
2323
>
2424
<x-icons.colored-confetti

resources/views/components/faq-card.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<div
1111
x-data="{ open: false }"
1212
x-on:click="open = !open"
13-
class="group/faq-card grid cursor-pointer select-none grid-cols-[1.8rem,1fr,2.5rem] gap-x-3 rounded-2xl px-5 py-5 ring-1 transition-all duration-200"
13+
class="group/faq-card grid cursor-pointer select-none grid-cols-[1.8rem_1fr_2.5rem] gap-x-3 rounded-2xl px-5 py-5 ring-1 transition-all duration-200"
1414
:class="{ 'ring-gray-200 hover:bg-gray-100 dark:ring-white/20 dark:hover:bg-gray-900/50': !open, 'ring-black/10 bg-gray-100 dark:ring-white/20 dark:bg-gray-900/50': open }"
1515
>
1616
{{-- Number --}}

resources/views/components/footer.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<footer
2-
class="mx-auto max-w-5xl px-5 pb-5 pt-20 xl:max-w-7xl 2xl:max-w-[90rem]"
2+
class="mx-auto max-w-5xl px-5 pb-5 pt-20 xl:max-w-7xl 2xl:max-w-360"
33
aria-labelledby="footer-heading"
44
>
55
<h2

resources/views/components/layout-three-columns.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<x-layout :hasMenu="! empty($sidebarLeft)">
22
{{-- Main container --}}
33
<main
4-
class="mx-auto flex w-full max-w-5xl grow items-start px-4 pt-1 xl:max-w-7xl 2xl:max-w-[90rem]"
4+
class="mx-auto flex w-full max-w-5xl grow items-start px-4 pt-1 xl:max-w-7xl 2xl:max-w-360"
55
>
66
{{-- Left sidebar --}}
77
@if (! empty($sidebarLeft))

resources/views/components/navigation-bar.blade.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class="sticky top-0 z-50 flex flex-col items-center justify-center px-3 pt-px"
99
'ring-gray-200/80 dark:ring-gray-800/50 bg-white/50 dark:bg-white/5 translate-y-3': scrolled || showDocsNavigation,
1010
'ring-transparent dark:bg-transparent': ! scrolled && ! showDocsNavigation,
1111
}"
12-
class="mx-auto flex w-full max-w-5xl items-center justify-between gap-5 rounded-2xl px-5 py-4 ring-1 backdrop-blur-md transition duration-200 ease-out xl:max-w-7xl 2xl:max-w-[90rem]"
12+
class="mx-auto flex w-full max-w-5xl items-center justify-between gap-5 rounded-2xl px-5 py-4 ring-1 backdrop-blur-md transition duration-200 ease-out xl:max-w-7xl 2xl:max-w-360"
1313
>
1414
{{-- Left side --}}
1515
<div class="flex items-center gap-3">
@@ -31,11 +31,11 @@ class="group relative z-0 hidden items-center overflow-hidden rounded-full bg-gr
3131
title="Read the NativePHP v1 announcement"
3232
>
3333
<div
34-
class="absolute inset-0 flex items-center [container-type:inline-size]"
34+
class="@container absolute inset-0 flex items-center"
3535
aria-hidden="true"
3636
>
3737
<div
38-
class="absolute h-[100cqw] w-[100cqw] bg-[conic-gradient(from_0_at_50%_50%,rgba(167,139,250,0.75)_0deg,transparent_60deg,transparent_300deg,rgba(167,139,250,0.75)_360deg)] transition duration-300 [animation:spin_2.5s_linear_infinite]"
38+
class="absolute h-[100cqw] w-[100cqw] animate-[spin_2.5s_linear_infinite] bg-[conic-gradient(from_0_at_50%_50%,rgba(167,139,250,0.75)_0deg,transparent_60deg,transparent_300deg,rgba(167,139,250,0.75)_360deg)] transition duration-300"
3939
></div>
4040
</div>
4141

@@ -107,7 +107,7 @@ class="flex items-center gap-3.5 text-sm"
107107

108108
{{-- Decorative circle --}}
109109
<div
110-
class="hidden size-[3px] rotate-45 rounded-sm bg-gray-400 transition duration-200 lg:block dark:opacity-60"
110+
class="hidden size-[3px] rotate-45 rounded-xs bg-gray-400 transition duration-200 lg:block dark:opacity-60"
111111
aria-hidden="true"
112112
></div>
113113

@@ -126,15 +126,15 @@ class="hidden size-[3px] rotate-45 rounded-sm bg-gray-400 transition duration-20
126126

127127
{{-- Decorative circle --}}
128128
<div
129-
class="hidden size-[3px] rotate-45 rounded-sm bg-gray-400 transition duration-200 lg:block dark:opacity-60"
129+
class="hidden size-[3px] rotate-45 rounded-xs bg-gray-400 transition duration-200 lg:block dark:opacity-60"
130130
aria-hidden="true"
131131
></div>
132132

133133
@if ($hasMenu)
134134
<button
135135
type="button"
136136
@click="showDocsNavigation = !showDocsNavigation"
137-
class="-m-2 block p-2 text-gray-600 focus:outline-none focus:ring-0 lg:hidden dark:text-gray-300"
137+
class="-m-2 block p-2 text-gray-600 focus:ring-0 focus:outline-hidden lg:hidden dark:text-gray-300"
138138
aria-expanded="false"
139139
aria-controls="docs-navigation"
140140
aria-label="Toggle documentation menu"
@@ -179,7 +179,7 @@ class="size-6"
179179

180180
{{-- Decorative circle --}}
181181
<div
182-
class="hidden size-[3px] rotate-45 rounded-sm bg-gray-400 transition duration-200 lg:block dark:opacity-60"
182+
class="hidden size-[3px] rotate-45 rounded-xs bg-gray-400 transition duration-200 lg:block dark:opacity-60"
183183
aria-hidden="true"
184184
></div>
185185

@@ -196,10 +196,10 @@ class="hidden size-[3px] rotate-45 rounded-sm bg-gray-400 transition duration-20
196196
>
197197
Blog
198198
</a>
199-
199+
200200
{{-- Decorative circle -- }}
201201
<div
202-
class="hidden size-[3px] rotate-45 rounded-sm bg-gray-400 transition duration-200 lg:block dark:opacity-60"
202+
class="hidden size-[3px] rotate-45 rounded-xs bg-gray-400 transition duration-200 lg:block dark:opacity-60"
203203
aria-hidden="true"
204204
></div>
205205
--}}
@@ -272,7 +272,7 @@ class="hidden size-[3px] rotate-45 rounded-sm bg-gray-400 transition duration-20
272272
}
273273
"
274274
href="/docs/1/getting-started/sponsoring"
275-
class="relative hidden bg-gradient-to-tr from-violet-600 to-violet-300 bg-clip-text font-medium text-transparent lg:block dark:from-violet-500 dark:to-white/80"
275+
class="relative hidden bg-linear-to-tr from-violet-600 to-violet-300 bg-clip-text font-medium text-transparent lg:block dark:from-violet-500 dark:to-white/80"
276276
aria-label="Sponsor NativePHP"
277277
title="Support NativePHP development"
278278
>
@@ -282,7 +282,7 @@ class="relative hidden bg-gradient-to-tr from-violet-600 to-violet-300 bg-clip-t
282282
{{-- Heart 1 --}}
283283
<div
284284
x-ref="sponsorHeart1"
285-
class="absolute right-1/2 top-0 origin-center scale-0 opacity-0"
285+
class="absolute top-0 right-1/2 origin-center scale-0 opacity-0"
286286
aria-hidden="true"
287287
>
288288
<x-icons.heart class="size-[9px] text-violet-400" />
@@ -291,7 +291,7 @@ class="absolute right-1/2 top-0 origin-center scale-0 opacity-0"
291291
{{-- Heart 2 --}}
292292
<div
293293
x-ref="sponsorHeart2"
294-
class="absolute left-1/2 top-0 origin-center scale-0 opacity-0"
294+
class="absolute top-0 left-1/2 origin-center scale-0 opacity-0"
295295
aria-hidden="true"
296296
>
297297
<x-icons.heart class="size-[7px] text-violet-400" />
@@ -300,7 +300,7 @@ class="absolute left-1/2 top-0 origin-center scale-0 opacity-0"
300300
{{-- Heart 3 --}}
301301
<div
302302
x-ref="sponsorHeart3"
303-
class="absolute right-1/2 top-0 origin-center scale-0 opacity-0"
303+
class="absolute top-0 right-1/2 origin-center scale-0 opacity-0"
304304
aria-hidden="true"
305305
>
306306
<x-icons.heart class="size-[5px] text-violet-400" />
@@ -350,7 +350,7 @@ class="absolute -bottom-1 left-0 h-0.5 w-2 origin-left rounded-full bg-violet-40
350350
)
351351
}
352352
"
353-
class="absolute -bottom-1.5 left-0 h-8 w-2 origin-left rounded-full bg-gradient-to-t from-violet-500 to-transparent blur-[9px] will-change-transform dark:blur-sm"
353+
class="absolute -bottom-1.5 left-0 h-8 w-2 origin-left rounded-full bg-linear-to-t from-violet-500 to-transparent blur-[9px] will-change-transform dark:blur-xs"
354354
aria-hidden="true"
355355
></div>
356356
</a>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<aside
2-
class="sticky top-20 hidden max-h-[clamp(15rem,100svh,88svh)] w-[17rem] shrink-0 flex-col overflow-y-auto overflow-x-hidden px-3 py-4 xl:flex"
2+
class="sticky top-20 hidden max-h-[clamp(15rem,100svh,88svh)] w-68 shrink-0 flex-col overflow-y-auto overflow-x-hidden px-3 py-4 xl:flex"
33
>
44
{{ $slot }}
55
</aside>

0 commit comments

Comments
 (0)