Skip to content
Merged
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
14 changes: 8 additions & 6 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '../source/00-config/index.css';
import sourceSansPro from '../source/01-global/fonts/source-sans';
import '../source/01-global/index.css';
import '../source/06-utility/index.css';
import SourceSansFontStyle from '../source/01-global/fonts/source-sans';

const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
Expand Down Expand Up @@ -67,14 +67,16 @@ const withWritingDirection = (Story, context) => {
);
};

const withFont = Story => (
<>
<SourceSansFontStyle />
const withFonts = Story => (
<div
className={sourceSansPro.variable}
style={{ display: 'contents', fontFamily: 'var(--font-family-primary)' }}
>
<Story />
</>
</div>
);

const decorators = [withWritingDirection, withFont];
const decorators = [withWritingDirection, withFonts];

const preview = {
parameters,
Expand Down
5 changes: 2 additions & 3 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { JSX, PropsWithChildren } from 'react';
import '../source/00-config/index.css';
import SourceSansFontStyle from '../source/01-global/fonts/source-sans';
import sourceSansPro from '../source/01-global/fonts/source-sans';
import '../source/01-global/index.css';
import Footer from '../source/02-layouts/Footer/Footer';
import Header from '../source/02-layouts/Header/Header';
Expand All @@ -15,9 +15,8 @@ import '../source/06-utility/index.css';

function RootLayout({ children }: PropsWithChildren): JSX.Element {
return (
<html lang="en">
<html lang="en" className={sourceSansPro.variable}>
<body id="top">
<SourceSansFontStyle />
<Skiplink />
<SiteContainer>
<Header>
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nextjs-project",
"version": "1.1.0",
"version": "1.1.1",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
11 changes: 11 additions & 0 deletions source/01-global/fonts/source-sans.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Source_Sans_3 as SourceSansPro } from 'next/font/google';

const sourceSansPro = SourceSansPro({
display: 'auto',
subsets: ['latin'],
weight: 'variable',
fallback: ['Arial', 'sans-serif'],
variable: '--font-family-primary',
});

export default sourceSansPro;
27 changes: 0 additions & 27 deletions source/01-global/fonts/source-sans.tsx

This file was deleted.