Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: use shared favicon metadata so the tab icon isn't blurry on hi-dpi (#48770)

claude[bot]c30437a58acb
diff --git a/apps/design-system/app/layout.tsx b/apps/design-system/app/layout.tsx
index e1e5c9ca5d6..de7f2407868 100644
--- a/apps/design-system/app/layout.tsx
+++ b/apps/design-system/app/layout.tsx
@@ -3,6 +3,8 @@ import '@/styles/globals.css'
import type { Metadata, Viewport } from 'next'
+import { genFaviconData } from 'common/MetaFavicons/app-router'
+
import { Providers } from './Providers'
import { Toaster } from './toaster'
import { inter, manrope, sourceCodePro } from '@/lib/fonts'
@@ -11,99 +13,6 @@ const className = `${inter.variable} ${manrope.variable} ${sourceCodePro.variabl
const BASE_PATH = process.env.NEXT_PUBLIC_BASE_PATH || '/design-system'
-const genFaviconData = (basePath: string): Metadata['icons'] => ({
- icon: {
- url: `${basePath}/favicon/favicon.ico`,
- type: 'image/x-icon',
- },
- shortcut: `${basePath}/favicon/favicon.ico`,
- apple: `${basePath}/favicon/favicon.ico`,
- other: [
- {
- rel: 'apple-touch-icon-precomposed',
- url: `${basePath}/favicon/apple-icon-57x57.png`,
- sizes: '57x57',
- },
- {
- rel: 'apple-touch-icon-precomposed',
- url: `${basePath}/favicon/apple-icon-60x60.png`,
- sizes: '60x60',
- },
- {
- rel: 'apple-touch-icon-precomposed',
- url: `${basePath}/favicon/apple-icon-72x72.png`,
- sizes: '72x72',
- },
- {
- rel: 'apple-touch-icon-precomposed',
- url: `${basePath}/favicon/apple-icon-76x76.png`,
- sizes: '76x76',
- },
- {
- rel: 'apple-touch-icon-precomposed',
- url: `${basePath}/favicon/apple-icon-114x114.png`,
- sizes: '114x114',
- },
- {
- rel: 'apple-touch-icon-precomposed',
- url: `${basePath}/favicon/apple-icon-120x120.png`,
- sizes: '120x120',
- },
- {
- rel: 'apple-touch-icon-precomposed',
- url: `${basePath}/favicon/apple-icon-144x144.png`,
- sizes: '144x144',
- },
- {
- rel: 'apple-touch-icon-precomposed',
- url: `${basePath}/favicon/apple-icon-152x152.png`,
- sizes: '152x152',
- },
- {
- rel: 'icon',
- url: `${basePath}/favicon/favicon-16x16.png`,
- type: 'image/png',
- sizes: '16x16',
- },
- {
- rel: 'icon',
- url: `${basePath}/favicon/favicon-32x32.png`,
- type: 'image/png',
- sizes: '32x32',
- },
- {
- rel: 'icon',
- url: `${basePath}/favicon/favicon-48x48.png`,
- type: 'image/png',
- sizes: '48x48',
- },
- {
- rel: 'icon',
- url: `${basePath}/favicon/favicon-96x96.png`,
- type: 'image/png',
- sizes: '96x96',
- },
- {
- rel: 'icon',
- url: `${basePath}/favicon/favicon-128x128.png`,
- type: 'image/png',
- sizes: '128x128',
- },
- {
- rel: 'icon',
- url: `${basePath}/favicon/favicon-180x180.png`,
- type: 'image/png',
- sizes: '180x180',
- },
- {
- rel: 'icon',
- url: `${basePath}/favicon/favicon-196x196.png`,
- type: 'image/png',
- sizes: '196x196',
- },
- ],
-})
-
export const metadata: Metadata = {
applicationName: 'Supabase Design System',
title: 'Supabase Design System',
diff --git a/apps/www/app/layout.tsx b/apps/www/app/layout.tsx
index 33ef4139ee0..9fae90684bb 100644
--- a/apps/www/app/layout.tsx
+++ b/apps/www/app/layout.tsx
@@ -4,6 +4,7 @@ import '../styles/globals.css'
import '../pages/launch-week/launchWeek.css'
import { inter, manrope, sourceCodePro } from '~/lib/fonts'
+import { genFaviconData } from 'common/MetaFavicons/app-router'
import type { Metadata, Viewport } from 'next'
import Providers from './providers'
@@ -32,11 +33,8 @@ export const metadata: Metadata = {
site: '@supabase',
card: 'summary_large_image',
},
- icons: {
- icon: '/favicon/favicon.ico',
- shortcut: '/favicon/favicon.ico',
- apple: '/favicon/favicon.ico',
- },
+ // www serves from the site root (`basePath: ''` in next.config.mjs)
+ icons: genFaviconData(''),
}
export const viewport: Viewport = {
diff --git a/packages/common/MetaFavicons/app-router.ts b/packages/common/MetaFavicons/app-router.ts
index dbded7b8324..078229427e9 100644
--- a/packages/common/MetaFavicons/app-router.ts
+++ b/packages/common/MetaFavicons/app-router.ts
@@ -74,7 +74,7 @@ const genFaviconData = (basePath: string): Metadata['icons'] => ({
},
{
rel: 'icon',
- url: `${basePath}/favicon/favicon-128x128.png`,
+ url: `${basePath}/favicon/favicon-128.png`,
type: 'image/png',
sizes: '128x128',
},