Skip to content

Commit

Permalink
feat: replace Atyp font with Roboto Flex
Browse files Browse the repository at this point in the history
  • Loading branch information
Aerilym committed Sep 25, 2024
1 parent a1c6abf commit d4413ef
Show file tree
Hide file tree
Showing 28 changed files with 14 additions and 130 deletions.
7 changes: 4 additions & 3 deletions apps/staking/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isProduction, NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID } from '@/lib/env';
import { getLocalizationData } from '@/lib/locale-server';
import { Toaster } from '@session/ui/components/ui/sonner';
import { AtypDisplay, AtypText, MonumentExtended } from '@session/ui/fonts';
import { MonumentExtended, RobotoFlex } from '@session/ui/fonts';

import { DevSheet } from '@/components/DevSheet';
import { siteMetadata, wagmiMetadata } from '@/lib/metadata';
Expand All @@ -17,6 +17,7 @@ import { FeatureFlagProvider } from '@/lib/feature-flags-client';
import RemoteBanner from '@/components/RemoteBanner';
import Header from '@/components/Header';
import { Suspense } from 'react';
import { cn } from '@session/ui/lib/utils';

const wagmiConfig = createWagmiConfig({
projectId: NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID,
Expand All @@ -37,7 +38,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo
<html
lang={locale}
dir={direction}
className={`${AtypDisplay.variable} ${AtypText.variable} ${MonumentExtended.variable}`}
className={cn(RobotoFlex.variable, MonumentExtended.variable)}
>
<FeatureFlagProvider>
<GlobalProvider
Expand All @@ -46,7 +47,7 @@ export default async function RootLayout({ children }: { children: React.ReactNo
initialState={initialWagmiState}
wagmiMetadata={wagmiMetadata}
>
<body className="bg-session-black text-session-text font-atyp-text overflow-x-hidden">
<body className="bg-session-black font-roboto-flex text-session-text overflow-x-hidden">
<ChainBanner />
<Suspense>
<RemoteBanner />
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/components/ui/sonner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const Toaster = ({ ...props }: ToasterProps) => {
},
classNames: {
toast:
'group toast group-[.toaster]:bg-session-black group-[.toaster]:shadow-lg group-[.toaster]:font-atyp-display group-[.toaster]:text-[15px] group-[.toaster]:px-8 group-[.toaster]:py-5 group-[.toast-action]:bg-session-green',
'group toast group-[.toaster]:bg-session-black group-[.toaster]:shadow-lg group-[.toaster]:font-roboto-flex group-[.toaster]:text-[15px] group-[.toaster]:px-8 group-[.toaster]:py-5 group-[.toast-action]:bg-session-green',
description: 'text-muted-foreground',
icon: 'inline w-6 h-6 *:w-6 *:h-6',
success: 'toast-success bg-session-black text-session-green border border-session-green',
Expand Down
Binary file removed packages/ui/fonts/AtypDisplay/AtypDisplay-Bold.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed packages/ui/fonts/AtypDisplay/AtypDisplay-Light.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed packages/ui/fonts/AtypDisplay/AtypDisplay-Thin.ttf
Binary file not shown.
Binary file not shown.
Binary file removed packages/ui/fonts/AtypText/AtypText-Bold.ttf
Binary file not shown.
Binary file removed packages/ui/fonts/AtypText/AtypText-BoldItalic.ttf
Binary file not shown.
Binary file removed packages/ui/fonts/AtypText/AtypText-Italic.ttf
Binary file not shown.
Binary file removed packages/ui/fonts/AtypText/AtypText-Light.ttf
Binary file not shown.
Binary file removed packages/ui/fonts/AtypText/AtypText-LightItalic.ttf
Binary file not shown.
Binary file removed packages/ui/fonts/AtypText/AtypText-Medium.ttf
Binary file not shown.
Binary file not shown.
Binary file removed packages/ui/fonts/AtypText/AtypText-Regular.ttf
Binary file not shown.
Binary file removed packages/ui/fonts/AtypText/AtypText-SemiBold.ttf
Binary file not shown.
Binary file not shown.
Binary file removed packages/ui/fonts/AtypText/AtypText-Thin.ttf
Binary file not shown.
Binary file removed packages/ui/fonts/AtypText/AtypText-ThinItalic.ttf
Binary file not shown.
132 changes: 8 additions & 124 deletions packages/ui/fonts/fonts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import localFont from 'next/font/local';
import { Roboto_Flex } from 'next/font/google';

type FontWeight =
| 'Thin'
Expand All @@ -14,144 +15,27 @@ type FontWeight =
| 'SemiBoldItalic'
| 'BoldItalic';

type FontPath = `${string}-${FontWeight}.ttf`;

type FontPath = `${string}-${FontWeight}.${'ttf' | 'woff2'}`;
type FontSrc = Array<{
path: FontPath;
weight: string;
weight?: string;
style?: string;
}>;

const AtypDisplay = localFont({
src: [
{
path: './AtypDisplay/AtypDisplay-Thin.ttf',
weight: '100',
},
{
path: './AtypDisplay/AtypDisplay-Light.ttf',
weight: '300',
},
{
path: './AtypDisplay/AtypDisplay-Regular.ttf',
weight: '400',
},
{
path: './AtypDisplay/AtypDisplay-Medium.ttf',
weight: '500',
},
{
path: './AtypDisplay/AtypDisplay-SemiBold.ttf',
weight: '600',
},
{
path: './AtypDisplay/AtypDisplay-Bold.ttf',
weight: '700',
},
{
path: './AtypDisplay/AtypDisplay-ThinItalic.ttf',
weight: '100',
style: 'italic',
},
{
path: './AtypDisplay/AtypDisplay-LightItalic.ttf',
weight: '300',
style: 'italic',
},
{
path: './AtypDisplay/AtypDisplay-Italic.ttf',
weight: '400',
style: 'italic',
},
{
path: './AtypDisplay/AtypDisplay-MediumItalic.ttf',
weight: '500',
style: 'italic',
},
{
path: './AtypDisplay/AtypDisplay-SemiBoldItalic.ttf',
weight: '600',
style: 'italic',
},
{
path: './AtypDisplay/AtypDisplay-BoldItalic.ttf',
weight: '700',
style: 'italic',
},
] satisfies FontSrc,
variable: '--font-atyp-display',
display: 'swap',
});

const AtypText = localFont({
src: [
{
path: './AtypText/AtypText-Thin.ttf',
weight: '100',
},
{
path: './AtypText/AtypText-Light.ttf',
weight: '300',
},
{
path: './AtypText/AtypText-Regular.ttf',
weight: '400',
},
{
path: './AtypText/AtypText-Medium.ttf',
weight: '500',
},
{
path: './AtypText/AtypText-SemiBold.ttf',
weight: '600',
},
{
path: './AtypText/AtypText-Bold.ttf',
weight: '700',
},
{
path: './AtypText/AtypText-ThinItalic.ttf',
weight: '100',
style: 'italic',
},
{
path: './AtypText/AtypText-LightItalic.ttf',
weight: '300',
style: 'italic',
},
{
path: './AtypText/AtypText-Italic.ttf',
weight: '400',
style: 'italic',
},
{
path: './AtypText/AtypText-MediumItalic.ttf',
weight: '500',
style: 'italic',
},
{
path: './AtypText/AtypText-SemiBoldItalic.ttf',
weight: '600',
style: 'italic',
},
{
path: './AtypText/AtypText-BoldItalic.ttf',
weight: '700',
style: 'italic',
},
] satisfies FontSrc,
variable: '--font-atyp-text',
const RobotoFlex = Roboto_Flex({
display: 'swap',
subsets: ['latin-ext', 'cyrillic-ext', 'greek', 'vietnamese'],
variable: '--font-roboto-flex',
});

const MonumentExtended = localFont({
src: [
{
path: './MonumentExtended/MonumentExtended-Regular.woff2',
},
],
] satisfies FontSrc,
variable: '--font-monument-extended',
display: 'swap',
});

export { AtypDisplay, AtypText, MonumentExtended };
export { RobotoFlex, MonumentExtended };
3 changes: 1 addition & 2 deletions packages/ui/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ export default {
'3xl': '1920px',
},
fontFamily: {
'atyp-display': ['var(--font-atyp-display)'],
'atyp-text': ['var(--font-atyp-text)'],
'roboto-flex': ['var(--font-roboto-flex)'],
'monument-extended': ['var(--font-monument-extended)'],
},
extend: {
Expand Down

0 comments on commit d4413ef

Please sign in to comment.