Files
myeasycms-v2/apps/web/lib/fonts.ts
Giancarlo Buomprisco 4e91f267e0 Tailwind CSS 4 Migration (#100)
* Updated to TailwindCSS v4
* Moved CSS module to its own CSS file because of lightingcss strict validation
* Respect next parameter in middleware
* Updated all packages. 
* Split CSSs for better organization.
* Redesigned theme and auth pages
* Improved pill and header design
* Formatted files using Prettier
* Better footer layout
* Better auth layout
* Bump version of the repository to 2.0.0
2025-01-28 14:19:52 +08:00

50 lines
1.0 KiB
TypeScript

import { Inter as SansFont } from 'next/font/google';
import { cn } from '@kit/ui/utils';
/**
* @sans
* @description Define here the sans font.
* By default, it uses the Inter font from Google Fonts.
*/
const sans = SansFont({
subsets: ['latin'],
variable: '--font-sans',
fallback: ['system-ui', 'Helvetica Neue', 'Helvetica', 'Arial'],
preload: true,
weight: ['300', '400', '500', '600', '700'],
});
/**
* @heading
* @description Define here the heading font.
*/
const heading = sans;
// we export these fonts into the root layout
export { sans, heading };
/**
* @name getFontsClassName
* @description Get the class name for the root layout.
* @param theme
*/
export function getFontsClassName(theme?: string) {
const dark = theme === 'dark';
const light = !dark;
const font = [sans.variable, heading.variable].reduce<string[]>(
(acc, curr) => {
if (acc.includes(curr)) return acc;
return [...acc, curr];
},
[],
);
return cn('bg-background min-h-screen antialiased', ...font, {
dark,
light,
});
}