Skip to content

Commit

Permalink
Fixed usage of legacy font on related pages
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianLeChat committed Oct 21, 2023
1 parent 11ff1ec commit 0138a98
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
11 changes: 7 additions & 4 deletions app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { join } from "path";
import { Poppins, Open_Sans } from "next/font/google";
import { promises as fileSystem } from "fs";
import { unstable_setRequestLocale } from "next-intl/server";
import { Suspense, lazy, type ReactNode } from "react";
import { NextIntlClientProvider, useMessages } from "next-intl";
import { Suspense, lazy, type ReactNode, type CSSProperties } from "react";

// Importation des types.
import type { Metadata } from "next";
Expand Down Expand Up @@ -196,9 +196,12 @@ export default function Layout( {
return (
<html
lang={locale}
className={poppins.className}
data-modern-font={poppins.className}
data-legacy-font={openSans.className}
style={
{
"--modern-font": poppins.style.fontFamily,
"--legacy-font": openSans.style.fontFamily
} as CSSProperties
}
>
{/* Corps de la page */}
<body>
Expand Down
1 change: 1 addition & 0 deletions app/[locale]/styles/globals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ body
max-width: 1024px;
transition: background-color 100ms linear;
line-height: 1.5;
font-family: var(--modern-font);

@include themeColors()
{
Expand Down
2 changes: 1 addition & 1 deletion app/[locale]/styles/legacy.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ html
color: white;
hyphens: auto;
text-align: center;
font-family: "Open Sans", sans-serif;
font-family: var(--legacy-font), sans-serif;
text-rendering: optimizeSpeed;

// Disposition et affichage.
Expand Down

0 comments on commit 0138a98

Please sign in to comment.