Modèle:Badge/styles.css
De Nefald
Autres actions
/* ============================================
BADGE SYSTEM - Système modulaire et adaptable
============================================ */
/* === Base du badge === */
.badge {
display: inline-block;
font-size: 0.5em;
font-weight: 700;
padding: 0.4em 0.8em;
border-radius: 6px;
margin-left: 0.5em;
vertical-align: middle;
text-transform: uppercase;
letter-spacing: 0.8px;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
transition: all 0.3s ease;
white-space: nowrap;
line-height: 1.2;
}
.badge:hover {
transform: translateY(-1px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}
/* === Présets de couleurs (modifiables) === */
/* Default (gris neutre) */
.badge-default {
background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
color: white;
border: 1px solid rgba(255, 255, 255, 0.15);
}
/* Beta (violet) */
.badge-beta {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border: 1px solid rgba(255, 255, 255, 0.15);
}
/* Alpha (orange) */
.badge-alpha {
background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
color: white;
border: 1px solid rgba(255, 255, 255, 0.15);
}
/* New (vert) */
.badge-new {
background: linear-gradient(135deg, #10b981 0%, #059669 100%);
color: white;
border: 1px solid rgba(255, 255, 255, 0.15);
}
/* Stable (bleu) */
.badge-stable {
background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
color: white;
border: 1px solid rgba(255, 255, 255, 0.15);
}
/* Deprecated (rouge) */
.badge-deprecated {
background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
color: white;
border: 1px solid rgba(255, 255, 255, 0.15);
}
/* WIP (violet foncé) */
.badge-wip {
background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
color: white;
border: 1px solid rgba(255, 255, 255, 0.15);
}
/* Experimental (rose) */
.badge-experimental {
background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
color: white;
border: 1px solid rgba(255, 255, 255, 0.15);
}
/* Info (cyan) */
.badge-info {
background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
color: white;
border: 1px solid rgba(255, 255, 255, 0.2);
}
/* Warning (jaune) */
.badge-warning {
background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
color: #1f2937;
border: 1px solid rgba(0, 0, 0, 0.1);
}
/* Success (vert clair) */
.badge-success {
background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
color: white;
border: 1px solid rgba(255, 255, 255, 0.15);
}
/* Danger (rouge vif) */
.badge-danger {
background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
color: white;
border: 1px solid rgba(255, 255, 255, 0.15);
}
/* Premium (or) */
.badge-premium {
background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%, #d97706 100%);
color: #1f2937;
border: 1px solid rgba(251, 191, 36, 0.5);
box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}
/* Dark (noir) */
.badge-dark {
background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
color: white;
border: 1px solid rgba(255, 255, 255, 0.1);
}
/* Light (blanc) */
.badge-light {
background: linear-gradient(135deg, #f9fafb 0%, #e5e7eb 100%);
color: #1f2937;
border: 1px solid rgba(0, 0, 0, 0.1);
}
/* === Icônes FontAwesome === */
.badge .fa-solid,
.badge .fa-regular,
.badge .fa-brands {
margin-right: 0.4em;
font-size: 1.1em;
vertical-align: middle;
}
/* Icône seule (sans texte) */
.badge .fa-solid:last-child,
.badge .fa-regular:last-child,
.badge .fa-brands:last-child {
margin-right: 0;
}
/* === Variantes de taille === */
.badge-sm {
font-size: 0.4em;
padding: 0.3em 0.6em;
}
.badge-lg {
font-size: 0.6em;
padding: 0.5em 1em;
}
.badge-xl {
font-size: 0.7em;
padding: 0.6em 1.2em;
}
/* === Variantes de style === */
/* Badge plat (sans gradient) */
.badge-flat {
background: currentColor !important;
box-shadow: none;
}
/* Badge outline */
.badge-outline {
background: transparent !important;
border: 2px solid currentColor;
box-shadow: none;
}
/* Badge pill (arrondi complet) */
.badge-pill {
border-radius: 50px;
}
/* === Animations optionnelles === */
.badge-pulse {
animation: badge-pulse 2s ease-in-out infinite;
}
@keyframes badge-pulse {
0%, 100% {
opacity: 1;
transform: scale(1);
}
50% {
opacity: 0.85;
transform: scale(1.03);
}
}
.badge-glow {
animation: badge-glow 2s ease-in-out infinite alternate;
}
@keyframes badge-glow {
from {
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
to {
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.6);
}
}
/* === Responsive === */
@media (max-width: 768px) {
.badge {
font-size: 0.45em;
padding: 0.35em 0.7em;
margin-left: 0.3em;
letter-spacing: 0.5px;
}
.badge-sm {
font-size: 0.35em;
}
.badge-lg {
font-size: 0.5em;
}
}
/* === Accessibilité === */
.badge:focus {
outline: 2px solid currentColor;
outline-offset: 2px;
}
/* Support du mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
.badge {
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.badge-light {
background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
color: #f9fafb;
border: 1px solid rgba(255, 255, 255, 0.1);
}
}
/* === Classes utilitaires === */
/* Désactiver la transformation majuscule */
.badge-no-uppercase {
text-transform: none;
}
/* Désactiver l'effet hover */
.badge-no-hover:hover {
transform: none;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}