jargaezx / theme-customizer
CakePHP plugin para personalizar el tema Bootstrap vía .env
Package info
github.com/jargaezx/theme-customizer
Type:cakephp-plugin
pkg:composer/jargaezx/theme-customizer
dev-main
2025-04-29 18:32 UTC
Requires
- cakephp/cakephp: ^5.0
This package is auto-updated.
Last update: 2026-03-29 01:12:49 UTC
README
Plugin de CakePHP 5 para inyectar dinámicamente variables CSS desde .env.
📦 Instalación
Clona el plugin dentro del directorio plugins/:
cd plugins
git clone https://github.com/jargaezx/theme-customizer.git ThemeCustomizer
O bien, añádelo como submódulo Git:
git submodule add https://github.com/jargaezx/theme-customizer.git plugins/ThemeCustomizer
⚙️ Configuración
En src/Application.php, agrega:
$this->addPlugin('ThemeCustomizer');
En tu layout principal (templates/layout/default.php), dentro del <head>:
<?= $this->Theme->injectVariables() ?>
🎨 Personalización
Agrega los colores al archivo .env:
BOOTSTRAP_PRIMARY_COLOR="#1a73e8" BOOTSTRAP_SECONDARY_COLOR="#6c757d" BOOTSTRAP_SUCCESS_COLOR="#28a745" BOOTSTRAP_INFO_COLOR="#17a2b8" BOOTSTRAP_WARNING_COLOR="#ffc107" BOOTSTRAP_DANGER_COLOR="#dc3545" BOOTSTRAP_BODY_COLOR="#212529" BOOTSTRAP_BODY_BG="#ffffff"
✅ Resultado
El plugin genera automáticamente un bloque <style> con las variables CSS basadas en el entorno.
:root {
--bs-primary: #1a73e8;
...
}
¡Listo! Ya puedes personalizar el sistema sin tocar el CSS.