Skip to content

Commit bdf6b5a

Browse files
committed
feat: revert project to Tailwind 3 for improved browser support
1 parent 68a6501 commit bdf6b5a

86 files changed

Lines changed: 2172 additions & 1223 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

core/app/[locale]/(default)/account/wishlists/[id]/_components/wishlist-actions.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const WishlistActions = ({
4444
<div className="flex-1">
4545
<WishlistVisibilitySwitch {...wishlist} />
4646
</div>
47-
<div className="@lg:border-l-contrast-100 flex items-center gap-2 pl-4 @lg:border-l">
47+
<div className="flex items-center gap-2 pl-4 @lg:border-l @lg:border-l-contrast-100">
4848
{publicUrl != null && publicUrl !== '' && (
4949
<WishlistShareButton
5050
closeLabel={shareCloseLabel}
@@ -74,7 +74,7 @@ export function WishlistActionsSkeleton() {
7474
<div className="flex-1">
7575
<SwitchSkeleton characterCount={5} />
7676
</div>
77-
<div className="@lg:border-l-contrast-100 flex items-center gap-2 pl-4 @lg:border-l">
77+
<div className="flex items-center gap-2 pl-4 @lg:border-l @lg:border-l-contrast-100">
7878
<WishlistShareButtonSkeleton />
7979
<Skeleton.Box className="h-10 w-10 rounded-full" />
8080
</div>

core/app/[locale]/(default)/account/wishlists/_components/wishlist-actions-menu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export const WishlistActionsMenu = ({ actionsTitle, items, share }: Props) => {
163163
</DropdownMenu>
164164
{modals.map(({ key, modal: { formAction: action, ...modalProps } }) => (
165165
<Modal
166-
className="max-w-lg min-w-64 @lg:min-w-96"
166+
className="min-w-64 max-w-lg @lg:min-w-96"
167167
form={action ? { action, onSuccess: handleModalFormSuccess(key) } : undefined}
168168
isOpen={state[key] ?? false}
169169
key={key}

core/app/[locale]/(default)/webpages/[id]/_components/web-page.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ export function WebPageContent({ webPage: streamableWebPage, breadcrumbs, childr
3030
<header className="pb-8 @2xl:pb-12 @4xl:pb-16">
3131
{breadcrumbs && <Breadcrumbs breadcrumbs={breadcrumbs} />}
3232

33-
<h1 className="font-heading mt-8 mb-4 text-4xl leading-none font-medium @xl:text-5xl @4xl:text-6xl">
33+
<h1 className="mb-4 mt-8 font-heading text-4xl font-medium leading-none @xl:text-5xl @4xl:text-6xl">
3434
{title}
3535
</h1>
3636
</header>
3737

3838
<div
39-
className="prose [&_h2]:font-heading space-y-4 [&_h2]:text-3xl [&_h2]:leading-none [&_h2]:font-normal @-xl:[&_h2]:text-4xl [&_img]:mx-auto [&_img]:max-h-[600px] [&_img]:w-fit [&_img]:rounded-2xl [&_img]:object-cover"
39+
className="@-xl:[&_h2]:text-4xl prose space-y-4 [&_h2]:font-heading [&_h2]:text-3xl [&_h2]:font-normal [&_h2]:leading-none [&_img]:mx-auto [&_img]:max-h-[600px] [&_img]:w-fit [&_img]:rounded-2xl [&_img]:object-cover"
4040
dangerouslySetInnerHTML={{ __html: content }}
4141
/>
4242
{children}
@@ -50,22 +50,22 @@ export function WebPageContent({ webPage: streamableWebPage, breadcrumbs, childr
5050

5151
function WebPageTitleSkeleton() {
5252
return (
53-
<div className="mt-8 mb-4 animate-pulse">
54-
<div className="bg-contrast-100 h-9 w-5/6 rounded-lg @xl:h-12 @4xl:h-[3.75rem]" />
53+
<div className="mb-4 mt-8 animate-pulse">
54+
<div className="h-9 w-5/6 rounded-lg bg-contrast-100 @xl:h-12 @4xl:h-[3.75rem]" />
5555
</div>
5656
);
5757
}
5858

5959
function WebPageBodySkeleton() {
6060
return (
6161
<div className="mx-auto w-full max-w-4xl animate-pulse pb-8 @2xl:pb-12 @4xl:pb-16">
62-
<div className="bg-contrast-100 mb-8 h-[1lh] w-3/5 rounded-lg" />
63-
<div className="bg-contrast-100 mb-4 h-[0.5lh] w-full rounded-lg" />
64-
<div className="bg-contrast-100 mb-4 h-[0.5lh] w-full rounded-lg" />
65-
<div className="bg-contrast-100 mb-4 h-[0.5lh] w-full rounded-lg" />
66-
<div className="bg-contrast-100 mb-4 h-[0.5lh] w-full rounded-lg" />
67-
<div className="bg-contrast-100 mb-4 h-[0.5lh] w-full rounded-lg" />
68-
<div className="bg-contrast-100 mb-4 h-[0.5lh] w-3/4 rounded-lg" />
62+
<div className="mb-8 h-[1lh] w-3/5 rounded-lg bg-contrast-100" />
63+
<div className="mb-4 h-[0.5lh] w-full rounded-lg bg-contrast-100" />
64+
<div className="mb-4 h-[0.5lh] w-full rounded-lg bg-contrast-100" />
65+
<div className="mb-4 h-[0.5lh] w-full rounded-lg bg-contrast-100" />
66+
<div className="mb-4 h-[0.5lh] w-full rounded-lg bg-contrast-100" />
67+
<div className="mb-4 h-[0.5lh] w-full rounded-lg bg-contrast-100" />
68+
<div className="mb-4 h-[0.5lh] w-3/4 rounded-lg bg-contrast-100" />
6969
</div>
7070
);
7171
}

core/app/[locale]/layout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { graphql } from '~/client/graphql';
1818
import { revalidate } from '~/client/revalidate-target';
1919
import { WebAnalyticsFragment } from '~/components/analytics/fragment';
2020
import { AnalyticsProvider } from '~/components/analytics/provider';
21+
import { ContainerQueryPolyfill } from '~/components/polyfills/container-query';
2122
import { routing } from '~/i18n/routing';
2223
import { getToastNotification } from '~/lib/server-toast';
2324

@@ -122,6 +123,7 @@ export default async function RootLayout({ params, children }: Props) {
122123
</NuqsAdapter>
123124
</NextIntlClientProvider>
124125
<VercelComponents />
126+
<ContainerQueryPolyfill />
125127
</body>
126128
</html>
127129
);
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { headers } from 'next/headers';
2+
import Script from 'next/script';
3+
import { userAgent } from 'next/server';
4+
5+
function checkBrowserSupport(name: string | undefined, version: string | undefined): boolean {
6+
if (!name || !version) return false;
7+
8+
const versionNumber = parseFloat(version);
9+
10+
switch (name) {
11+
case 'Chrome':
12+
return versionNumber <= 105;
13+
14+
case 'Edge':
15+
return versionNumber <= 105;
16+
17+
case 'Safari':
18+
return versionNumber <= 15.6;
19+
20+
case 'Firefox':
21+
return versionNumber <= 109;
22+
23+
default:
24+
return false;
25+
}
26+
}
27+
28+
export async function ContainerQueryPolyfill() {
29+
const headersList = await headers();
30+
const { browser } = userAgent({ headers: headersList });
31+
32+
const { version, name } = browser;
33+
34+
const isUnsupported = checkBrowserSupport(name, version);
35+
36+
if (isUnsupported) {
37+
return (
38+
// eslint-disable-next-line @next/next/no-before-interactive-script-outside-document
39+
<Script
40+
src="https://cdn.jsdelivr.net/npm/container-query-polyfill@1/dist/container-query-polyfill.modern.js"
41+
strategy="beforeInteractive"
42+
/>
43+
);
44+
}
45+
}

core/components/wishlist/share-button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const WishlistShareButton = ({
9898
if (!isMobileUser) {
9999
return (
100100
<Modal
101-
className="max-w-lg min-w-64 @lg:min-w-96"
101+
className="min-w-64 max-w-lg @lg:min-w-96"
102102
isOpen={open}
103103
setOpen={setOpen}
104104
trigger={ShareButton}

0 commit comments

Comments
 (0)