"> // // Palette par défaut (si aucune valeur en BDD) : // Primaire : #1D7A43 (vert forêt) // Secondaire: #0C1F13 (vert très sombre / presque noir) // Texte : #1E2D26 // Fond : #F4F8F5 // ───────────────────────────────────────────────────────────────────────────── header('Content-Type: text/css; charset=UTF-8'); header('Cache-Control: public, max-age=3600'); header('Vary: Accept-Encoding'); // ── Bootstrap minimal ────────────────────────────────────────────────────── $_dvRoot = dirname(__DIR__, 2); if (!function_exists('setting')) { require_once $_dvRoot . '/core/config.php'; require_once $_dvRoot . '/core/settings.php'; } // ── Lecture des paramètres BDD avec fallbacks palette verte ───────────────── $primary = setting('site_color_primary', '#1D7A43'); // vert principal $secondary = setting('site_color_secondary', '#0C1F13'); // vert très sombre $text_dark = setting('site_color_text_dark', '#1E2D26'); // texte titres $gray = setting('site_color_gray', '#6B7E72'); // texte corps / muted $white = setting('site_color_white', '#FFFFFF'); // blanc $extra = setting('site_color_extra', '#F4F8F5'); // fond clair $bdr_color = setting('site_color_bdr', '#D7E6DB'); // bordures $bdr_radius = setting('site_bdr_radius', '10px'); // rayon global $bg = setting('site_color_bg', '#F4F8F5'); // fond pages // ── Helpers ──────────────────────────────────────────────────────────────── /** * Sanitize une valeur CSS : n'autorise que les caractères valides pour * une couleur hex, hsl(), rgb(), un nom de couleur ou une taille. */ $sc = fn(string $v): string => preg_replace('/[^a-zA-Z0-9#,.()%\s\/\-]/', '', trim($v)); /** * Sanitize un border-radius (chiffres, px, %, em, rem, espaces). */ $sr = fn(string $v): string => preg_replace('/[^0-9a-zA-Z.\s%]/', '', trim($v)); /** * Convertit un code hex en "R, G, B" utilisable dans rgba(). * Supporte #RGB, #RRGGBB. */ $rgb = function(string $hex): string { $h = ltrim($hex, '#'); if (strlen($h) === 3) { $h = $h[0].$h[0].$h[1].$h[1].$h[2].$h[2]; } if (strlen($h) !== 6) return '0, 0, 0'; return hexdec(substr($h, 0, 2)) . ', ' . hexdec(substr($h, 2, 2)) . ', ' . hexdec(substr($h, 4, 2)); }; /** * Assombrit ou éclaircit un hex d'un certain pourcentage. * $amount positif = plus sombre, négatif = plus clair. */ $adjustHex = function(string $hex, int $amount): string { $h = ltrim($hex, '#'); if (strlen($h) === 3) $h = $h[0].$h[0].$h[1].$h[1].$h[2].$h[2]; if (strlen($h) !== 6) return $hex; $r = max(0, min(255, hexdec(substr($h,0,2)) - $amount)); $g = max(0, min(255, hexdec(substr($h,2,2)) - $amount)); $b = max(0, min(255, hexdec(substr($h,4,2)) - $amount)); return sprintf('#%02x%02x%02x', $r, $g, $b); }; $primary_dk = $adjustHex($primary, 40); // version sombre du primaire $primary_lt_hex = $adjustHex($primary, -200); // version très claire (approx) ?> /* ═══════════════════════════════════════════════════════════════════════════════ VARIABLES DYNAMIQUES — Sas Conteneur Générées depuis admin → Couleurs du site Écrase les valeurs par défaut de style.css ══════════════════════════════════════════════════════════════════════════════ Pour modifier les couleurs : Admin → Paramètres → Apparence → Couleurs ═══════════════════════════════════════════════════════════════════════════ */ :root { /* ──────────────────────────────────────────── POLICES (fixes — pas en BDD) ──────────────────────────────────────────── */ --sc-font-head : 'Space Grotesk', 'Segoe UI', sans-serif; --sc-font-body : 'Inter', 'Segoe UI', sans-serif; /* Alias legacy pour compat */ --gorent-font : var(--sc-font-body); --gorent-font-two : var(--sc-font-head); /* ──────────────────────────────────────────── COULEUR PRIMAIRE — boutons, accents, hover, prix, badges, barres de progression ──────────────────────────────────────────── */ --color-primary :