Skip to content

new conf design — fonts #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/app/conf/2023/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Header } from "../_components/header"
import { Footer } from "../_components/footer"
import { GraphQLConf, HostedByGraphQLFoundation } from "@/icons"
import NextLink from "next/link"
import { OldFontsStyleTag } from "../../fonts/old-fonts"

export const metadata = {
description:
Expand Down Expand Up @@ -33,6 +34,7 @@ export default function ConfLayout({
const hover = "#c026d3"
return (
<>
<OldFontsStyleTag />
<style>{`
.text-primary,
.hover\\:text-primary:hover {
Expand Down
2 changes: 2 additions & 0 deletions src/app/conf/2024/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Header } from "../_components/header"
import { Footer } from "../_components/footer"
import { GraphQLConf, HostedByGraphQLFoundation } from "@/icons"
import NextLink from "next/link"
import { OldFontsStyleTag } from "../../fonts/old-fonts"

export const metadata = {
description:
Expand All @@ -30,6 +31,7 @@ export default function Layout({
}): ReactElement {
return (
<>
<OldFontsStyleTag />
<Header
logo={
<NextLink
Expand Down
16 changes: 3 additions & 13 deletions src/app/conf/2025/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ import { Header } from "../_components/header"
import { Footer } from "../_components/footer"
import { GraphQLConf, HostedByGraphQLFoundation } from "@/icons"
import NextLink from "next/link"
import { Rubik } from "next/font/google"

const rubik = Rubik({
weight: ["700", "600", "500", "400", "300"],
subsets: ["latin"],
})
import { NewFontsStyleTag } from "../../fonts"

export const metadata = {
description:
Expand All @@ -36,6 +31,7 @@ export default function Layout({
}): ReactElement {
return (
<>
<NewFontsStyleTag />
<Header
logo={
<NextLink
Expand All @@ -56,13 +52,7 @@ export default function Layout({
]}
is2025
/>
<div
style={{
fontFamily: rubik.style.fontFamily,
}}
>
{children}
</div>
<div>{children}</div>
<Footer
logo={
<NextLink href="/conf/2025" className="nextra-logo text-white">
Expand Down
Binary file added src/app/fonts/CommitMono-VariableFont.woff2
Binary file not shown.
Binary file not shown.
Binary file added src/app/fonts/HostGrotesk-VariableFont_wght.woff2
Binary file not shown.
30 changes: 30 additions & 0 deletions src/app/fonts/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import localFont from "next/font/local"

export const hostGrotesk = localFont({
src: [
{ path: "./HostGrotesk-VariableFont_wght.woff2" },
{ path: "./HostGrotesk-Italic-VariableFont_wght.woff2", style: "italic" },
],
weight: "300 800",
})

export const commitMono = localFont({
src: "./CommitMono-VariableFont.woff2",
weight: "200 700",
declarations: [
{
prop: "font-feature-settings",
value: "'ss01' on, 'ss02' on, 'ss04' on, 'ss05' on, 'cv08' on",
},
],
})

const newFontsStyles = /* css */ `
html {
--font-sans: ${hostGrotesk.style.fontFamily};
--font-mono: ${commitMono.style.fontFamily};
}`

export const NewFontsStyleTag = () => {
return <style dangerouslySetInnerHTML={{ __html: newFontsStyles }} />
}
14 changes: 14 additions & 0 deletions src/app/fonts/old-fonts.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Roboto_Flex } from "next/font/google"

export const robotoFlex = Roboto_Flex({
subsets: ["latin"],
})

const oldFontsStyles = /* css */ `
html {
--font-sans: ${robotoFlex.style.fontFamily};
}`

export const OldFontsStyleTag = () => {
return <style dangerouslySetInnerHTML={{ __html: oldFontsStyles }} />
}
7 changes: 1 addition & 6 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import { ReactElement, ReactNode } from "react"
import { Metadata } from "next"
import { Roboto_Flex } from "next/font/google"
import GoogleAnalytics from "@/app/ga"
import "../globals.css"

const font = Roboto_Flex({
subsets: ["latin"],
})

export const metadata: Metadata = {
twitter: {
site: "@graphql",
Expand All @@ -28,7 +23,7 @@ export default function RootLayout({
children: ReactNode
}): ReactElement {
return (
<html lang="en" className={`scroll-smooth ${font.className}`}>
<html lang="en" className="scroll-smooth">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we still need <OldFonts/> applied to the rest of the pages like the blog

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The blog is in Pages router / Nextra 3, so it still has the font in _app.tsx.

Uri told me I can spend a moment refactoring this and migrating libraries, but... I just don't wanna do it yet. Let's get this conf website up, and then we can think about bumping Tailwind and unifying the routers, and doing whatever else

I kinda aligned on @kamilkisiela's opinion on SSG metaframeworks after reading some newest changelogs.

<head>
<style>{`html { scroll-padding-top: 5rem }`}</style>
</head>
Expand Down
11 changes: 11 additions & 0 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Config } from "tailwindcss"
import typography from "@tailwindcss/typography"
import { fontFamily } from "tailwindcss/defaultTheme"

const config: Config = {
content: ["./src/**/*.{js,ts,jsx,tsx,mdx}", "./theme.config.tsx"],
Expand All @@ -9,6 +10,16 @@ const config: Config = {
padding: "1rem",
},
extend: {
fontFamily: {
sans: [
`var(--font-sans, ${fontFamily.sans.slice(0, 3).join(", ")})`,
...fontFamily.sans,
],
mono: [
`var(--font-mono, ${fontFamily.mono.slice(0, 3).join(", ")})`,
...fontFamily.mono,
],
},
colors: {
primary: "#e10098",
"conf-black": "#0e031c",
Expand Down