111 lines
3.2 KiB
CSS
111 lines
3.2 KiB
CSS
/* ===========================
|
|
SE Switcher (SE1 / SE2)
|
|
=========================== */
|
|
|
|
.se-switch {
|
|
--se-bg: hsl(220 14% 18% / 0.6);
|
|
--se-border: hsl(220 14% 28% / 0.6);
|
|
--se-hover: hsl(220 14% 24% / 0.8);
|
|
--se-active-bg: #a29b78; /* couleur actif */
|
|
--se-active-text: #fff;
|
|
--se-text: #fff;
|
|
--se-radius: 999px;
|
|
--se-gap: 4px;
|
|
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: var(--se-gap);
|
|
padding: 2px;
|
|
border: 1px solid var(--se-border);
|
|
border-radius: var(--se-radius);
|
|
background: var(--se-bg);
|
|
backdrop-filter: saturate(120%) blur(6px);
|
|
-webkit-backdrop-filter: saturate(120%) blur(6px);
|
|
line-height: 1;
|
|
|
|
z-index: 10;
|
|
}
|
|
|
|
.se-switch__btn {
|
|
display: inline-block;
|
|
min-width: 2.8rem; /* compact mais lisible */
|
|
padding: 6px 12px;
|
|
border-radius: var(--se-radius);
|
|
text-decoration: none;
|
|
font: 600 14px/1 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
|
|
color: var(--se-text);
|
|
border: 1px solid transparent;
|
|
transition: background-color .18s ease, border-color .18s ease, transform .04s ease;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.se-switch__btn:hover,
|
|
.se-switch__btn:focus-visible {
|
|
background: var(--se-hover);
|
|
border-color: var(--se-border);
|
|
outline: none;
|
|
}
|
|
|
|
/* État actif de base */
|
|
.se-switch__btn.is-active,
|
|
.se-switch__btn[aria-current="page"] {
|
|
background: var(--se-active-bg);
|
|
color: var(--se-active-text);
|
|
border-color: transparent;
|
|
}
|
|
|
|
/* 🔒 Verrouillage fort de l'actif au survol/focus :
|
|
- Empêche toute règle globale de type a:hover { color: ... } de prendre le dessus
|
|
- Neutralise aussi un éventuel soulignement global */
|
|
.se-switch__btn.is-active,
|
|
.se-switch__btn.is-active:hover,
|
|
.se-switch__btn.is-active:focus,
|
|
.se-switch__btn.is-active:focus-visible,
|
|
.se-switch__btn[aria-current="page"],
|
|
.se-switch__btn[aria-current="page"]:hover,
|
|
.se-switch__btn[aria-current="page"]:focus,
|
|
.se-switch__btn[aria-current="page"]:focus-visible {
|
|
background: var(--se-active-bg) !important;
|
|
color: var(--se-active-text) !important;
|
|
border-color: transparent !important;
|
|
text-decoration: none !important;
|
|
}
|
|
|
|
/* Optionnel : si tu veux empêcher TOUT effet hover sur l'actif (y compris le curseur "main") */
|
|
.se-switch__btn.is-active,
|
|
.se-switch__btn[aria-current="page"] {
|
|
cursor: default;
|
|
/* Décommente la ligne suivante pour désactiver totalement le hover et le clic sur l'actif :
|
|
pointer-events: none; */
|
|
}
|
|
|
|
.se-switch__btn:active {
|
|
transform: translateY(1px);
|
|
}
|
|
|
|
/* Ajustements en thèmes clairs/sombres selon préférences système */
|
|
@media (prefers-color-scheme: light) {
|
|
.se-switch {
|
|
--se-bg: hsl(0 0% 100% / 0.7);
|
|
--se-border: hsl(220 12% 80%);
|
|
--se-hover: hsl(220 16% 95%);
|
|
--se-active-bg: hsl(201 100% 38%);
|
|
--se-text: hsl(220 25% 18%);
|
|
}
|
|
}
|
|
|
|
/* Variante compacte si besoin : ajouter la classe .se-switch--sm au conteneur */
|
|
.se-switch.se-switch--sm .se-switch__btn {
|
|
padding: 4px 10px;
|
|
min-width: 2.4rem;
|
|
font-weight: 600;
|
|
font-size: 11px;
|
|
}
|
|
|
|
.switch-center {
|
|
position: absolute;
|
|
top: 50px;
|
|
left: 50%;
|
|
transform: translate(-50%, -50%);
|
|
height: 40px;
|
|
} |