perf(fonts): migra para next/font/google e elimina FOUT
All checks were successful
CI/CD Web + Desktop / Detect changes (push) Successful in 5s
CI/CD Web + Desktop / Deploy (VPS Linux) (push) Successful in 4m13s
CI/CD Web + Desktop / Deploy Convex functions (push) Has been skipped
Quality Checks / Lint, Test and Build (push) Successful in 4m45s

- Usa next/font/google para carregar Inter e JetBrains Mono
- Remove @font-face manuais do globals.css
- Corrige variaveis CSS confusas (--font-geist-* com 4 hifens)
- Remove duplicacao de @layer base
- Fontes agora sao otimizadas automaticamente (WOFF2, subset, preload)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
rever-tecnologia 2025-12-17 09:00:22 -03:00
parent 4669be0107
commit f617916fe7
2 changed files with 51 additions and 70 deletions

View file

@ -3,29 +3,11 @@
@custom-variant dark (&:is(.dark *)); @custom-variant dark (&:is(.dark *));
@font-face {
font-family: "InterVariable";
src: url("/fonts/Inter-VariableFont_opsz,wght.ttf") format("truetype");
font-weight: 100 900;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "InterVariable";
src: url("/fonts/Inter-Italic-VariableFont_opsz,wght.ttf") format("truetype");
font-weight: 100 900;
font-style: italic;
font-display: swap;
}
/* JetBrains Mono agora depende das fontes do sistema para evitar carregar um arquivo corrompido */
@theme inline { @theme inline {
--color-background: var(--background); --color-background: var(--background);
--color-foreground: var(--foreground); --color-foreground: var(--foreground);
--font-sans: var(--font-geist-sans); --font-sans: var(--font-inter);
--font-mono: var(--font-geist-mono); --font-mono: var(--font-mono);
--color-sidebar-ring: var(--sidebar-ring); --color-sidebar-ring: var(--sidebar-ring);
--color-sidebar-border: var(--sidebar-border); --color-sidebar-border: var(--sidebar-border);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground); --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
@ -60,9 +42,6 @@
--radius-lg: var(--radius); --radius-lg: var(--radius);
--radius-xl: calc(var(--radius) + 4px); --radius-xl: calc(var(--radius) + 4px);
--color-destructive-foreground: var(--destructive-foreground); --color-destructive-foreground: var(--destructive-foreground);
--font-geist-mono: var(----font-geist-mono);
--font-geist-sans: var(----font-geist-sans);
--radius: var(----radius);
} }
:root { :root {
@ -99,8 +78,6 @@
--sidebar-border: #cbd5e1; --sidebar-border: #cbd5e1;
--sidebar-ring: #00d6eb; --sidebar-ring: #00d6eb;
--destructive-foreground: oklch(1 0 0); --destructive-foreground: oklch(1 0 0);
--font-geist-sans: "InterVariable", "Inter", sans-serif;
--font-geist-mono: "JetBrains Mono", "Fira Code", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
} }
.dark { .dark {
@ -255,12 +232,3 @@
animation: recent-ticket-enter 0.45s ease-out; animation: recent-ticket-enter 0.45s ease-out;
} }
} }
@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
}

View file

@ -1,11 +1,24 @@
import { ensurePerformanceMeasurePatched } from "@/lib/performance-measure-polyfill" import { ensurePerformanceMeasurePatched } from "@/lib/performance-measure-polyfill"
import type { Metadata } from "next" import type { Metadata } from "next"
import { Inter, JetBrains_Mono } from "next/font/google"
import "./globals.css" import "./globals.css"
import { ConvexClientProvider } from "./ConvexClientProvider" import { ConvexClientProvider } from "./ConvexClientProvider"
import { AuthProvider } from "@/lib/auth-client" import { AuthProvider } from "@/lib/auth-client"
import { Toaster } from "@/components/ui/sonner" import { Toaster } from "@/components/ui/sonner"
import { ChatWidgetProvider } from "@/components/chat/chat-widget-provider" import { ChatWidgetProvider } from "@/components/chat/chat-widget-provider"
const inter = Inter({
subsets: ["latin"],
display: "swap",
variable: "--font-inter",
})
const jetbrainsMono = JetBrains_Mono({
subsets: ["latin"],
display: "swap",
variable: "--font-mono",
})
export const metadata: Metadata = { export const metadata: Metadata = {
title: "Raven - Sistema de chamados", title: "Raven - Sistema de chamados",
description: "Plataforma Raven da Rever", description: "Plataforma Raven da Rever",
@ -31,7 +44,7 @@ export default async function RootLayout({
children: React.ReactNode children: React.ReactNode
}>) { }>) {
return ( return (
<html lang="pt-BR" className="h-full" suppressHydrationWarning> <html lang="pt-BR" className={`${inter.variable} ${jetbrainsMono.variable} h-full`} suppressHydrationWarning>
<body className="min-h-screen bg-background text-foreground antialiased"> <body className="min-h-screen bg-background text-foreground antialiased">
<ConvexClientProvider> <ConvexClientProvider>
<AuthProvider> <AuthProvider>