planmymeal/app/layout.tsx

35 lines
1.5 KiB
TypeScript
Raw Normal View History

2026-10-31 20:44:29 -05:00
import type { Metadata, Viewport } from "next";
import { Inter, JetBrains_Mono } from "next/font/google";
2026-10-31 20:44:29 -05:00
import "./globals.css";
// BoardUI's theme reads --font-inter (sans) and --font-mono-source (mono).
const inter = Inter({ variable: "--font-inter", subsets: ["latin"], axes: ["opsz"] });
const jetbrainsMono = JetBrains_Mono({ variable: "--font-mono-source", subsets: ["latin"] });
2026-10-31 20:44:29 -05:00
export const metadata: Metadata = {
// Pages set just their own name ("Recipes"); the template adds the app name.
title: { default: "Plan my Meals: Budget Meal Planner", template: "%s · Plan my Meals" },
description: "Plan a week of meals around your grocery budget and the appliances you actually own.",
};
export const viewport: Viewport = {
themeColor: [
{ media: "(prefers-color-scheme: light)", color: "#ffffff" },
{ media: "(prefers-color-scheme: dark)", color: "#0d1219" },
2026-10-31 20:44:29 -05:00
],
};
// Runs before paint so the BoardUI `.dark` class is set without a flash.
const THEME_INIT_SCRIPT = `(function(){try{if(localStorage.getItem("boardui:theme")==="dark")document.documentElement.classList.add("dark");}catch(e){}})();`;
2026-10-31 20:44:29 -05:00
export default function RootLayout({ children }: LayoutProps<"/">) {
return (
<html lang="en" suppressHydrationWarning className={`${inter.variable} ${jetbrainsMono.variable} antialiased`}>
2026-10-31 20:44:29 -05:00
<head>
<script dangerouslySetInnerHTML={{ __html: THEME_INIT_SCRIPT }} />
</head>
<body className="min-h-dvh bg-background-full font-sans text-text-primary">{children}</body>
2026-10-31 20:44:29 -05:00
</html>
);
}