Unverified Commit 0f55f2ab authored by yasmin p's avatar yasmin p Committed by GitHub

Update create-next-app template CSS (#66233)

Updates `create-next-app` template CSS:

- Declares variable font weights in `localFont` options and removes
instances of `font-synthesis: none`
- Removes Geist font variables from Tailwind config files
- Adds fallback sans typefaces to the `body` CSS
Co-authored-by: 's avatarSam Ko <sam@vercel.com>
parent 10dd3367
...@@ -17,5 +17,5 @@ ...@@ -17,5 +17,5 @@
body { body {
color: var(--foreground); color: var(--foreground);
background: var(--background); background: var(--background);
font-synthesis: none; font-family: Arial, Helvetica, sans-serif;
} }
...@@ -4,10 +4,12 @@ import "./globals.css"; ...@@ -4,10 +4,12 @@ import "./globals.css";
const geistSans = localFont({ const geistSans = localFont({
src: "./fonts/GeistVF.woff", src: "./fonts/GeistVF.woff",
variable: "--font-geist-sans", variable: "--font-geist-sans",
weight: "100 900",
}); });
const geistMono = localFont({ const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff", src: "./fonts/GeistMonoVF.woff",
variable: "--font-geist-mono", variable: "--font-geist-mono",
weight: "100 900",
}); });
export const metadata = { export const metadata = {
......
...@@ -2,7 +2,10 @@ import Image from "next/image"; ...@@ -2,7 +2,10 @@ import Image from "next/image";
export default function Home() { export default function Home() {
return ( return (
<div className="font-sans grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20"> <div
className="grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20"
style={{ fontFamily: "var(--font-geist-sans)" }}
>
<main className="flex flex-col gap-8 row-start-2 items-center sm:items-start"> <main className="flex flex-col gap-8 row-start-2 items-center sm:items-start">
<Image <Image
className="dark:invert" className="dark:invert"
...@@ -12,7 +15,10 @@ export default function Home() { ...@@ -12,7 +15,10 @@ export default function Home() {
height={38} height={38}
priority priority
/> />
<ol className="font-mono list-inside list-decimal text-sm text-center sm:text-left"> <ol
className="list-inside list-decimal text-sm text-center sm:text-left"
style={{ fontFamily: "var(--font-geist-mono)" }}
>
<li className="mb-2"> <li className="mb-2">
Get started by editing{" "} Get started by editing{" "}
<code className="bg-black/[.05] dark:bg-white/[.06] px-1 py-0.5 rounded font-semibold"> <code className="bg-black/[.05] dark:bg-white/[.06] px-1 py-0.5 rounded font-semibold">
......
...@@ -11,10 +11,6 @@ module.exports = { ...@@ -11,10 +11,6 @@ module.exports = {
background: "var(--background)", background: "var(--background)",
foreground: "var(--foreground)", foreground: "var(--foreground)",
}, },
fontFamily: {
sans: ["var(--font-geist-sans)"],
mono: ["var(--font-geist-mono)"],
},
}, },
}, },
plugins: [], plugins: [],
......
...@@ -17,5 +17,5 @@ ...@@ -17,5 +17,5 @@
body { body {
color: var(--foreground); color: var(--foreground);
background: var(--background); background: var(--background);
font-synthesis: none; font-family: Arial, Helvetica, sans-serif;
} }
...@@ -5,10 +5,12 @@ import "./globals.css"; ...@@ -5,10 +5,12 @@ import "./globals.css";
const geistSans = localFont({ const geistSans = localFont({
src: "./fonts/GeistVF.woff", src: "./fonts/GeistVF.woff",
variable: "--font-geist-sans", variable: "--font-geist-sans",
weight: "100 900",
}); });
const geistMono = localFont({ const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff", src: "./fonts/GeistMonoVF.woff",
variable: "--font-geist-mono", variable: "--font-geist-mono",
weight: "100 900",
}); });
export const metadata: Metadata = { export const metadata: Metadata = {
......
...@@ -2,7 +2,10 @@ import Image from "next/image"; ...@@ -2,7 +2,10 @@ import Image from "next/image";
export default function Home() { export default function Home() {
return ( return (
<div className="font-sans grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20"> <div
className="grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20"
style={{ fontFamily: "var(--font-geist-sans)" }}
>
<main className="flex flex-col gap-8 row-start-2 items-center sm:items-start"> <main className="flex flex-col gap-8 row-start-2 items-center sm:items-start">
<Image <Image
className="dark:invert" className="dark:invert"
...@@ -12,7 +15,10 @@ export default function Home() { ...@@ -12,7 +15,10 @@ export default function Home() {
height={38} height={38}
priority priority
/> />
<ol className="font-mono list-inside list-decimal text-sm text-center sm:text-left"> <ol
className="list-inside list-decimal text-sm text-center sm:text-left"
style={{ fontFamily: "var(--font-geist-mono)" }}
>
<li className="mb-2"> <li className="mb-2">
Get started by editing{" "} Get started by editing{" "}
<code className="bg-black/[.05] dark:bg-white/[.06] px-1 py-0.5 rounded font-semibold"> <code className="bg-black/[.05] dark:bg-white/[.06] px-1 py-0.5 rounded font-semibold">
......
...@@ -12,10 +12,6 @@ const config: Config = { ...@@ -12,10 +12,6 @@ const config: Config = {
background: "var(--background)", background: "var(--background)",
foreground: "var(--foreground)", foreground: "var(--foreground)",
}, },
fontFamily: {
sans: ["var(--font-geist-sans)"],
mono: ["var(--font-geist-mono)"],
},
}, },
}, },
plugins: [], plugins: [],
......
...@@ -19,6 +19,7 @@ body { ...@@ -19,6 +19,7 @@ body {
body { body {
color: var(--foreground); color: var(--foreground);
background: var(--background); background: var(--background);
font-family: Arial, Helvetica, sans-serif;
} }
* { * {
......
...@@ -4,10 +4,12 @@ import "./globals.css"; ...@@ -4,10 +4,12 @@ import "./globals.css";
const geistSans = localFont({ const geistSans = localFont({
src: "./fonts/GeistVF.woff", src: "./fonts/GeistVF.woff",
variable: "--font-geist-sans", variable: "--font-geist-sans",
weight: "100 900",
}); });
const geistMono = localFont({ const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff", src: "./fonts/GeistMonoVF.woff",
variable: "--font-geist-mono", variable: "--font-geist-mono",
weight: "100 900",
}); });
export const metadata = { export const metadata = {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
min-height: 100svh; min-height: 100svh;
padding: 80px; padding: 80px;
gap: 64px; gap: 64px;
font-synthesis: none; font-family: var(--font-geist-sans);
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
...@@ -67,7 +67,6 @@ ...@@ -67,7 +67,6 @@
height: 48px; height: 48px;
padding: 0 20px; padding: 0 20px;
border: none; border: none;
font-family: var(--font-geist-sans);
border: 1px solid transparent; border: 1px solid transparent;
transition: transition:
background 0.2s, background 0.2s,
...@@ -94,7 +93,6 @@ a.secondary { ...@@ -94,7 +93,6 @@ a.secondary {
} }
.footer { .footer {
font-family: var(--font-geist-sans);
grid-row-start: 3; grid-row-start: 3;
display: flex; display: flex;
gap: 24px; gap: 24px;
......
...@@ -19,6 +19,7 @@ body { ...@@ -19,6 +19,7 @@ body {
body { body {
color: var(--foreground); color: var(--foreground);
background: var(--background); background: var(--background);
font-family: Arial, Helvetica, sans-serif;
} }
* { * {
......
...@@ -5,10 +5,12 @@ import "./globals.css"; ...@@ -5,10 +5,12 @@ import "./globals.css";
const geistSans = localFont({ const geistSans = localFont({
src: "./fonts/GeistVF.woff", src: "./fonts/GeistVF.woff",
variable: "--font-geist-sans", variable: "--font-geist-sans",
weight: "100 900",
}); });
const geistMono = localFont({ const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff", src: "./fonts/GeistMonoVF.woff",
variable: "--font-geist-mono", variable: "--font-geist-mono",
weight: "100 900",
}); });
export const metadata: Metadata = { export const metadata: Metadata = {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
min-height: 100svh; min-height: 100svh;
padding: 80px; padding: 80px;
gap: 64px; gap: 64px;
font-synthesis: none; font-family: var(--font-geist-sans);
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
...@@ -67,7 +67,6 @@ ...@@ -67,7 +67,6 @@
height: 48px; height: 48px;
padding: 0 20px; padding: 0 20px;
border: none; border: none;
font-family: var(--font-geist-sans);
border: 1px solid transparent; border: 1px solid transparent;
transition: transition:
background 0.2s, background 0.2s,
...@@ -94,7 +93,6 @@ a.secondary { ...@@ -94,7 +93,6 @@ a.secondary {
} }
.footer { .footer {
font-family: var(--font-geist-sans);
grid-row-start: 3; grid-row-start: 3;
display: flex; display: flex;
gap: 24px; gap: 24px;
......
...@@ -4,16 +4,21 @@ import localFont from "next/font/local"; ...@@ -4,16 +4,21 @@ import localFont from "next/font/local";
const geistSans = localFont({ const geistSans = localFont({
src: "./fonts/GeistVF.woff", src: "./fonts/GeistVF.woff",
variable: "--font-geist-sans", variable: "--font-geist-sans",
weight: "100 900",
}); });
const geistMono = localFont({ const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff", src: "./fonts/GeistMonoVF.woff",
variable: "--font-geist-mono", variable: "--font-geist-mono",
weight: "100 900",
}); });
export default function Home() { export default function Home() {
return ( return (
<div <div
className={`${geistSans.variable} ${geistMono.variable} grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20`} className={`${geistSans.variable} ${geistMono.variable} grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20`}
style={{
fontFamily: "var(--font-geist-sans)",
}}
> >
<main className="flex flex-col gap-8 row-start-2 items-center sm:items-start"> <main className="flex flex-col gap-8 row-start-2 items-center sm:items-start">
<Image <Image
...@@ -24,7 +29,12 @@ export default function Home() { ...@@ -24,7 +29,12 @@ export default function Home() {
height={38} height={38}
priority priority
/> />
<ol className="font-mono list-inside list-decimal text-sm text-center sm:text-left"> <ol
className="list-inside list-decimal text-sm text-center sm:text-left"
style={{
fontFamily: "var(--font-geist-mono)",
}}
>
<li className="mb-2"> <li className="mb-2">
Get started by editing{" "} Get started by editing{" "}
<code className="bg-black/[.05] dark:bg-white/[.06] px-1 py-0.5 rounded font-semibold"> <code className="bg-black/[.05] dark:bg-white/[.06] px-1 py-0.5 rounded font-semibold">
...@@ -34,7 +44,7 @@ export default function Home() { ...@@ -34,7 +44,7 @@ export default function Home() {
<li>Save and see your changes instantly.</li> <li>Save and see your changes instantly.</li>
</ol> </ol>
<div className="font-sans flex gap-4 items-center flex-col sm:flex-row"> <div className="flex gap-4 items-center flex-col sm:flex-row">
<a <a
className="rounded-full border border-solid border-transparent transition-colors flex items-center justify-center bg-foreground text-background gap-2 hover:bg-[#383838] dark:hover:bg-[#ccc] text-sm sm:text-base h-10 sm:h-12 px-4 sm:px-5" className="rounded-full border border-solid border-transparent transition-colors flex items-center justify-center bg-foreground text-background gap-2 hover:bg-[#383838] dark:hover:bg-[#ccc] text-sm sm:text-base h-10 sm:h-12 px-4 sm:px-5"
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template-tw&utm_campaign=create-next-app" href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template-tw&utm_campaign=create-next-app"
...@@ -60,7 +70,7 @@ export default function Home() { ...@@ -60,7 +70,7 @@ export default function Home() {
</a> </a>
</div> </div>
</main> </main>
<footer className="font-sans row-start-3 flex gap-6 flex-wrap items-center justify-center"> <footer className="row-start-3 flex gap-6 flex-wrap items-center justify-center">
<a <a
className="flex items-center gap-2 hover:underline hover:underline-offset-4" className="flex items-center gap-2 hover:underline hover:underline-offset-4"
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=default-template-tw&utm_campaign=create-next-app" href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=default-template-tw&utm_campaign=create-next-app"
......
...@@ -17,5 +17,5 @@ ...@@ -17,5 +17,5 @@
body { body {
color: var(--foreground); color: var(--foreground);
background: var(--background); background: var(--background);
font-synthesis: none; font-family: Arial, Helvetica, sans-serif;
} }
...@@ -11,10 +11,6 @@ module.exports = { ...@@ -11,10 +11,6 @@ module.exports = {
background: "var(--background)", background: "var(--background)",
foreground: "var(--foreground)", foreground: "var(--foreground)",
}, },
fontFamily: {
sans: ["var(--font-geist-sans)"],
mono: ["var(--font-geist-mono)"],
},
}, },
}, },
plugins: [], plugins: [],
......
...@@ -4,16 +4,21 @@ import localFont from "next/font/local"; ...@@ -4,16 +4,21 @@ import localFont from "next/font/local";
const geistSans = localFont({ const geistSans = localFont({
src: "./fonts/GeistVF.woff", src: "./fonts/GeistVF.woff",
variable: "--font-geist-sans", variable: "--font-geist-sans",
weight: "100 900",
}); });
const geistMono = localFont({ const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff", src: "./fonts/GeistMonoVF.woff",
variable: "--font-geist-mono", variable: "--font-geist-mono",
weight: "100 900",
}); });
export default function Home() { export default function Home() {
return ( return (
<div <div
className={`${geistSans.variable} ${geistMono.variable} grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20`} className={`${geistSans.variable} ${geistMono.variable} grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20`}
style={{
fontFamily: "var(--font-geist-sans)",
}}
> >
<main className="flex flex-col gap-8 row-start-2 items-center sm:items-start"> <main className="flex flex-col gap-8 row-start-2 items-center sm:items-start">
<Image <Image
...@@ -24,7 +29,12 @@ export default function Home() { ...@@ -24,7 +29,12 @@ export default function Home() {
height={38} height={38}
priority priority
/> />
<ol className="font-mono list-inside list-decimal text-sm text-center sm:text-left"> <ol
className="list-inside list-decimal text-sm text-center sm:text-left"
style={{
fontFamily: "var(--font-geist-mono)",
}}
>
<li className="mb-2"> <li className="mb-2">
Get started by editing{" "} Get started by editing{" "}
<code className="bg-black/[.05] dark:bg-white/[.06] px-1 py-0.5 rounded font-semibold"> <code className="bg-black/[.05] dark:bg-white/[.06] px-1 py-0.5 rounded font-semibold">
...@@ -34,7 +44,7 @@ export default function Home() { ...@@ -34,7 +44,7 @@ export default function Home() {
<li>Save and see your changes instantly.</li> <li>Save and see your changes instantly.</li>
</ol> </ol>
<div className="font-sans flex gap-4 items-center flex-col sm:flex-row"> <div className="flex gap-4 items-center flex-col sm:flex-row">
<a <a
className="rounded-full border border-solid border-transparent transition-colors flex items-center justify-center bg-foreground text-background gap-2 hover:bg-[#383838] dark:hover:bg-[#ccc] text-sm sm:text-base h-10 sm:h-12 px-4 sm:px-5" className="rounded-full border border-solid border-transparent transition-colors flex items-center justify-center bg-foreground text-background gap-2 hover:bg-[#383838] dark:hover:bg-[#ccc] text-sm sm:text-base h-10 sm:h-12 px-4 sm:px-5"
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template-tw&utm_campaign=create-next-app" href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template-tw&utm_campaign=create-next-app"
...@@ -60,7 +70,7 @@ export default function Home() { ...@@ -60,7 +70,7 @@ export default function Home() {
</a> </a>
</div> </div>
</main> </main>
<footer className="font-sans row-start-3 flex gap-6 flex-wrap items-center justify-center"> <footer className="row-start-3 flex gap-6 flex-wrap items-center justify-center">
<a <a
className="flex items-center gap-2 hover:underline hover:underline-offset-4" className="flex items-center gap-2 hover:underline hover:underline-offset-4"
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=default-template-tw&utm_campaign=create-next-app" href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=default-template-tw&utm_campaign=create-next-app"
......
...@@ -17,5 +17,5 @@ ...@@ -17,5 +17,5 @@
body { body {
color: var(--foreground); color: var(--foreground);
background: var(--background); background: var(--background);
font-synthesis: none; font-family: Arial, Helvetica, sans-serif;
} }
...@@ -12,10 +12,6 @@ const config: Config = { ...@@ -12,10 +12,6 @@ const config: Config = {
background: "var(--background)", background: "var(--background)",
foreground: "var(--foreground)", foreground: "var(--foreground)",
}, },
fontFamily: {
sans: ["var(--font-geist-sans)"],
mono: ["var(--font-geist-mono)"],
},
}, },
}, },
plugins: [], plugins: [],
......
...@@ -6,10 +6,12 @@ import styles from "@/styles/Home.module.css"; ...@@ -6,10 +6,12 @@ import styles from "@/styles/Home.module.css";
const geistSans = localFont({ const geistSans = localFont({
src: "./fonts/GeistVF.woff", src: "./fonts/GeistVF.woff",
variable: "--font-geist-sans", variable: "--font-geist-sans",
weight: "100 900",
}); });
const geistMono = localFont({ const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff", src: "./fonts/GeistMonoVF.woff",
variable: "--font-geist-mono", variable: "--font-geist-mono",
weight: "100 900",
}); });
export default function Home() { export default function Home() {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
min-height: 100svh; min-height: 100svh;
padding: 80px; padding: 80px;
gap: 64px; gap: 64px;
font-synthesis: none; font-family: var(--font-geist-sans);
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
...@@ -67,7 +67,6 @@ ...@@ -67,7 +67,6 @@
height: 48px; height: 48px;
padding: 0 20px; padding: 0 20px;
border: none; border: none;
font-family: var(--font-geist-sans);
border: 1px solid transparent; border: 1px solid transparent;
transition: transition:
background 0.2s, background 0.2s,
...@@ -94,7 +93,6 @@ a.secondary { ...@@ -94,7 +93,6 @@ a.secondary {
} }
.footer { .footer {
font-family: var(--font-geist-sans);
grid-row-start: 3; grid-row-start: 3;
display: flex; display: flex;
gap: 24px; gap: 24px;
......
...@@ -19,6 +19,7 @@ body { ...@@ -19,6 +19,7 @@ body {
body { body {
color: var(--foreground); color: var(--foreground);
background: var(--background); background: var(--background);
font-family: Arial, Helvetica, sans-serif;
} }
* { * {
......
...@@ -6,10 +6,12 @@ import styles from "@/styles/Home.module.css"; ...@@ -6,10 +6,12 @@ import styles from "@/styles/Home.module.css";
const geistSans = localFont({ const geistSans = localFont({
src: "./fonts/GeistVF.woff", src: "./fonts/GeistVF.woff",
variable: "--font-geist-sans", variable: "--font-geist-sans",
weight: "100 900",
}); });
const geistMono = localFont({ const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff", src: "./fonts/GeistMonoVF.woff",
variable: "--font-geist-mono", variable: "--font-geist-mono",
weight: "100 900",
}); });
export default function Home() { export default function Home() {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
min-height: 100svh; min-height: 100svh;
padding: 80px; padding: 80px;
gap: 64px; gap: 64px;
font-synthesis: none; font-family: var(--font-geist-sans);
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
...@@ -67,7 +67,6 @@ ...@@ -67,7 +67,6 @@
height: 48px; height: 48px;
padding: 0 20px; padding: 0 20px;
border: none; border: none;
font-family: var(--font-geist-sans);
border: 1px solid transparent; border: 1px solid transparent;
transition: transition:
background 0.2s, background 0.2s,
...@@ -94,7 +93,6 @@ a.secondary { ...@@ -94,7 +93,6 @@ a.secondary {
} }
.footer { .footer {
font-family: var(--font-geist-sans);
grid-row-start: 3; grid-row-start: 3;
display: flex; display: flex;
gap: 24px; gap: 24px;
......
...@@ -19,6 +19,7 @@ body { ...@@ -19,6 +19,7 @@ body {
body { body {
color: var(--foreground); color: var(--foreground);
background: var(--background); background: var(--background);
font-family: Arial, Helvetica, sans-serif;
} }
* { * {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment