perf(fonts): Self-host Poppins fonts
- Add WOFF2 font files for Poppins (400, 500, 600, 700 weights) - Create @font-face declarations in css-global-fonts.css - Remove Google Fonts dependency from enqueue-scripts.php - Remove preconnect hints for fonts.googleapis.com from seo.php Benefits: - Eliminates 36.2 kB external transfer from Google Fonts - Improves GDPR compliance (no Google tracking) - Reduces render-blocking requests - Faster font loading from local server 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -45,26 +45,22 @@
|
||||
*/
|
||||
|
||||
/* ============================================
|
||||
POPPINS (Opcional - Solo si se activa)
|
||||
POPPINS (Self-hosted)
|
||||
============================================
|
||||
|
||||
Las siguientes declaraciones @font-face solo
|
||||
se cargan cuando el usuario activa "Use Custom Fonts"
|
||||
en Apariencia > Personalizar > Tipografía.
|
||||
Fuentes Poppins alojadas localmente para:
|
||||
- Eliminar dependencia de Google Fonts
|
||||
- Mejorar rendimiento (sin requests externos)
|
||||
- Cumplimiento GDPR (sin tracking de Google)
|
||||
|
||||
Para activar Poppins:
|
||||
1. Descargar archivos WOFF2 de Google Fonts
|
||||
2. Colocar en assets/fonts/poppins/
|
||||
3. Descomentar las declaraciones @font-face
|
||||
4. Activar en Customizer
|
||||
Pesos incluidos: 400, 500, 600, 700
|
||||
Formato: WOFF2 (mejor compresión)
|
||||
|
||||
============================================ */
|
||||
|
||||
/*
|
||||
@font-face {
|
||||
font-family: 'Poppins';
|
||||
src: url('../fonts/poppins/Poppins-Regular.woff2') format('woff2'),
|
||||
url('../fonts/poppins/Poppins-Regular.woff') format('woff');
|
||||
src: url('../fonts/poppins-v24-latin-regular.woff2') format('woff2');
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
@@ -72,8 +68,7 @@
|
||||
|
||||
@font-face {
|
||||
font-family: 'Poppins';
|
||||
src: url('../fonts/poppins/Poppins-Medium.woff2') format('woff2'),
|
||||
url('../fonts/poppins/Poppins-Medium.woff') format('woff');
|
||||
src: url('../fonts/poppins-v24-latin-500.woff2') format('woff2');
|
||||
font-weight: 500;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
@@ -81,8 +76,7 @@
|
||||
|
||||
@font-face {
|
||||
font-family: 'Poppins';
|
||||
src: url('../fonts/poppins/Poppins-SemiBold.woff2') format('woff2'),
|
||||
url('../fonts/poppins/Poppins-SemiBold.woff') format('woff');
|
||||
src: url('../fonts/poppins-v24-latin-600.woff2') format('woff2');
|
||||
font-weight: 600;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
@@ -90,21 +84,11 @@
|
||||
|
||||
@font-face {
|
||||
font-family: 'Poppins';
|
||||
src: url('../fonts/poppins/Poppins-Bold.woff2') format('woff2'),
|
||||
url('../fonts/poppins/Poppins-Bold.woff') format('woff');
|
||||
src: url('../fonts/poppins-v24-latin-700.woff2') format('woff2');
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
}
|
||||
*/
|
||||
|
||||
/* Cuando Poppins esté activo, se aplica con clase .use-custom-fonts */
|
||||
/*
|
||||
.use-custom-fonts {
|
||||
--font-primary: 'Poppins', var(--font-system);
|
||||
--font-headings: 'Poppins', var(--font-system);
|
||||
}
|
||||
*/
|
||||
|
||||
/* ============================================
|
||||
UTILIDADES DE FUENTES
|
||||
|
||||
BIN
assets/fonts/poppins-v24-latin-500.woff2
Normal file
BIN
assets/fonts/poppins-v24-latin-500.woff2
Normal file
Binary file not shown.
BIN
assets/fonts/poppins-v24-latin-600.woff2
Normal file
BIN
assets/fonts/poppins-v24-latin-600.woff2
Normal file
Binary file not shown.
BIN
assets/fonts/poppins-v24-latin-700.woff2
Normal file
BIN
assets/fonts/poppins-v24-latin-700.woff2
Normal file
Binary file not shown.
BIN
assets/fonts/poppins-v24-latin-regular.woff2
Normal file
BIN
assets/fonts/poppins-v24-latin-regular.woff2
Normal file
Binary file not shown.
Reference in New Issue
Block a user