Skip to content

Commit

Permalink
SOEOPSFY24-206 | add ds sans font
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccahongsf committed Oct 2, 2024
1 parent c934f47 commit bfd021f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions app/components/Typography/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type TypographyProps = {
variant?: types.TextVariantType;
leading?: types.FontLeadingType;
/**
* If true, use default tracking for the font - for Druk and Druk Wide
* If true, use default tracking for the font - for DM Sans
*/
useDefaultTracking?: boolean;
italic?: boolean;
Expand All @@ -38,10 +38,10 @@ export const Text = ({
color = 'default',
variant,
leading,
useDefaultTracking = font === 'druk-wide',
useDefaultTracking = font === 'ds-sans',
italic,
srOnly,
uppercase = font === 'druk',
uppercase = font === 'ds-sans',
icon,
iconProps,
className,
Expand All @@ -66,7 +66,7 @@ export const Text = ({
srOnly ? 'sr-only' : '',
uppercase ? 'uppercase' : '',
useDefaultTracking ? 'tracking-normal' : '',
font === 'druk' ? 'tracking-normal sm:tracking-wide' : '',
font === 'ds-sans' ? 'tracking-normal sm:tracking-wide' : '',
className,
)
}
Expand Down
1 change: 1 addition & 0 deletions app/components/Typography/typography.styles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export const fontFamilies = {
sans: 'font-sans',
serif: 'font-serif',
'ds-sans': 'font-ds-sans',
};

export const fontWeights = {
Expand Down
13 changes: 6 additions & 7 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
import './globals.css';
import localFont from 'next/font/local';
import { Source_Sans_3, Source_Serif_4 } from 'next/font/google';
import { Source_Sans_3, DM_Sans } from 'next/font/google';
import { cnb } from 'cnbuilder';


const source_sans = Source_Sans_3({
const dm_sans = DM_Sans({
subsets: ['latin'],
style: ['italic','normal'],
display: 'swap',
variable: '--font-source-sans',
variable: '--font-dm-sans',
});

const source_serif = Source_Serif_4({
const source_sans = Source_Sans_3({
subsets: ['latin'],
style: ['italic','normal'],
display: 'swap',
variable: '--font-source-serif',
variable: '--font-source-sans',
});

const stanford = localFont({
Expand All @@ -33,8 +32,8 @@ export default function RootLayout({
<html lang="en">
<body
className={cnb(
dm_sans.variable,
source_sans.variable,
source_serif.variable,
stanford.variable,
)}
>
Expand Down
4 changes: 2 additions & 2 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { TimelineBanner } from './components/TimelineBanner';
import { Heading } from './components/Typography';

export default function Home() {
return (
<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 font-[family-name:var(--font-geist-sans)]">
<TimelineBanner />
<Heading>SOE Centennial</Heading>
</div>
);
}

0 comments on commit bfd021f

Please sign in to comment.