« Modèle:Card/styles.css » : différence entre les versions
De Nefald
Autres actions
m gap + clean Balise : Révoqué |
Annulation des modifications 4482 de Hiob (discussion) Balise : Annulation |
||
| Ligne 1 : | Ligne 1 : | ||
/* ============================================================================= | /* ============================================================================= | ||
HOME CARD COMPONENT | HOME CARD COMPONENT | ||
Composant de carte stylisé pour affichage de contenu avec image | Composant de carte stylisé pour affichage de contenu avec image | ||
Compatible dark/light mode avec Citizen skin | Compatible dark/light mode avec Citizen skin | ||
============================================================================= */ | ============================================================================= */ | ||
/* ----------------------------------------------------------------------------- | /* ----------------------------------------------------------------------------- | ||
STRUCTURE DE BASE | STRUCTURE DE BASE | ||
----------------------------------------------------------------------------- */ | ----------------------------------------------------------------------------- */ | ||
.home-card { | .home-card { | ||
/* Layout */ | /* Layout */ | ||
display: flex; | display: flex; | ||
flex-direction: column; | flex-direction: column; | ||
height: 100%; | |||
height: 100%; | |||
overflow: hidden; | overflow: hidden; | ||
/* Style */ | /* Style */ | ||
background: var(--color-surface-1); | background: var(--color-surface-1); | ||
border: 1px solid var(--border-color-base, rgba(0, 0, 0, 0.1)); | border: 1px solid var(--border-color-base, rgba(0, 0, 0, 0.1)); | ||
border-radius: 12px; | |||
border-radius: | |||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); | ||
/* Animation */ | /* Animation */ | ||
transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease; | transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease; | ||
} | } | ||
.home-card:hover { | .home-card:hover { | ||
transform: translateY(-4px); | transform: translateY(-4px); | ||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); | box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); | ||
border-color: var(--color-progressive, #36c); | |||
border-color: var(--color- | |||
} | } | ||
/* Dark mode - Card base */ | /* Dark mode - Card base */ | ||
.skin-theme-clientpref-night .home-card { | .skin-theme-clientpref-night .home-card { | ||
border-color: var(--border-color-subtle, rgba(255, 255, 255, 0.1)); | border-color: var(--border-color-subtle, rgba(255, 255, 255, 0.1)); | ||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); | ||
} | } | ||
.skin-theme-clientpref-night .home-card:hover { | .skin-theme-clientpref-night .home-card:hover { | ||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7); | box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7); | ||
} | } | ||
/* ----------------------------------------------------------------------------- | /* ----------------------------------------------------------------------------- | ||
IMAGE - Section supérieure PLEINE LARGEUR | IMAGE - Section supérieure PLEINE LARGEUR | ||
----------------------------------------------------------------------------- */ | ----------------------------------------------------------------------------- */ | ||
.home-card__image { | .home-card__image { | ||
position: relative; | position: relative; | ||
width: 100%; | width: 100%; | ||
height: 250px; | |||
height: 250px; | |||
flex-shrink: 0; | flex-shrink: 0; | ||
overflow: hidden; | overflow: hidden; | ||
margin: 0; | |||
margin: 0; | |||
padding: 0; | padding: 0; | ||
background: var(--color-surface-2); | |||
background: var(--color-surface-2); | |||
display: flex; | display: flex; | ||
align-items: center; | align-items: center; | ||
justify-content: center; | justify-content: center; | ||
} | } | ||
/* Forcer TOUS les éléments MediaWiki à être en pleine largeur */ | /* Forcer TOUS les éléments MediaWiki à être en pleine largeur */ | ||
.home-card__image * { | .home-card__image * { | ||
margin: 0 !important; | margin: 0 !important; | ||
padding: 0 !important; | padding: 0 !important; | ||
border: none !important; | border: none !important; | ||
background: transparent !important; | background: transparent !important; | ||
} | } | ||
.home-card__image .thumb, | .home-card__image .thumb, | ||
.home-card__image .thumbinner, | .home-card__image .thumbinner, | ||
.home-card__image .thumbcaption, | .home-card__image .thumbcaption, | ||
.home-card__image .magnify { | .home-card__image .magnify { | ||
display: block !important; | |||
width: 100% !important; | |||
height: 100% !important; | |||
max-width: none !important; | |||
} | |||
/* L'image elle-même */ | |||
.home-card__image img { | |||
display: block !important; | display: block !important; | ||
width: 100% !important; | width: 100% !important; | ||
height: 100% !important; | height: 100% !important; | ||
max-width: none !important; | |||
max-height: none !important; | |||
object-fit: cover !important; | |||
transition: transform 0.3s ease; | |||
} | |||
.home-card:hover .home-card__image img { | |||
transform: scale(1.05); | |||
} | |||
/* Liens autour de l'image */ | |||
.home-card__image a { | |||
display: block !important; | |||
width: 100% !important; | |||
height: 100% !important; | |||
line-height: 0 !important; | |||
} | } | ||
/* Cacher les légendes et icônes de zoom */ | |||
.home-card__image .thumbcaption, | |||
.home-card__image .magnify { | |||
display: none !important; | |||
} | |||
/* ----------------------------------------------------------------------------- | |||
BADGE - Overlay sur l'image | |||
----------------------------------------------------------------------------- */ | |||
/* ---------- | .home-card__badge { | ||
/* Position */ | |||
position: absolute; | |||
top: 12px; | |||
right: 12px; | |||
z-index: 10; | |||
/* Style */ | |||
background: var(--color-progressive, #36c); | |||
color: #fff; | |||
padding: 6px 12px; | |||
border-radius: 6px; | |||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); | |||
/* Typography */ | |||
font-size: 0.75rem; | |||
font-weight: 600; | |||
text-transform: uppercase; | |||
letter-spacing: 0.5px; | |||
} | |||
/* Dark mode - Badge */ | |||
.skin-theme-clientpref-night .home-card__badge { | |||
background: var(--color-progressive, #4d90fe); | |||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); | |||
} | |||
/* ----------------------------------------------------------------------------- | |||
CONTENT - Zone de texte | |||
----------------------------------------------------------------------------- */ | ----------------------------------------------------------------------------- */ | ||
.home-card__content { | .home-card__content { | ||
/* Layout */ | |||
display: flex; | display: flex; | ||
flex-direction: column; | flex-direction: column; | ||
flex-grow: 1; | |||
gap: 12px; | |||
padding: 24px; | |||
} | } | ||
/* ----------------------------------------------------------------------------- | |||
TITLE - Titre principal | |||
----------------------------------------------------------------------------- */ | |||
.home-card__title { | .home-card__title { | ||
margin: 0; | |||
font-size: 1.5rem; | |||
font-weight: 600; | |||
line-height: 1.3; | |||
color: var(--color-emphasized, #000); | |||
} | |||
.home-card__title a { | |||
color: inherit; | |||
text-decoration: none; | |||
transition: color 0.2s ease; | |||
} | |||
.home-card__title a:hover { | |||
color: var(--color-progressive, #36c); | |||
color: var(--color- | } | ||
/* Dark mode - Title */ | |||
.skin-theme-clientpref-night .home-card__title { | |||
color: var(--color-emphasized, #fff); | |||
} | } | ||
/* ----------------------------------------------------------------------------- | |||
SUBTITLE - Sous-titre | |||
----------------------------------------------------------------------------- */ | |||
.home-card__subtitle { | .home-card__subtitle { | ||
margin: 0; | |||
font-size: 0.95rem; | |||
line-height: 1.5; | |||
color: var(--color-subtle, #666); | |||
} | |||
/* Dark mode - Subtitle */ | |||
.skin-theme-clientpref-night .home-card__subtitle { | |||
color: var(--color-subtle | color: var(--color-subtle, #aaa); | ||
} | } | ||
/* ----------------------------------------------------------------------------- | |||
TEXT - Corps de texte (supporte wikitext) | |||
----------------------------------------------------------------------------- */ | |||
.home-card__text { | .home-card__text { | ||
margin: 0; | |||
line-height: 1.6; | line-height: 1.6; | ||
flex-grow: 1; | |||
color: var(--color-base, #202122); | |||
} | |||
/* Dark mode - Text */ | |||
.skin-theme-clientpref-night .home-card__text { | |||
color: var(--color-base, #eee); | |||
} | |||
/* Paragraphes dans le texte */ | |||
.home-card__text p:first-child { | |||
margin-top: 0; | |||
} | } | ||
.home-card__text p:last-child { | |||
margin-bottom: 0; | |||
} | |||
/* Listes dans le texte */ | |||
.home-card__text ul, | |||
.home-card__text ol { | |||
margin: 8px 0; | |||
padding-left: 20px; | |||
} | |||
/* ----- | /* Liens dans le texte */ | ||
.home-card__text a { | |||
color: var(--color-progressive, #36c); | |||
text-decoration: none; | |||
} | |||
.home-card__text a:hover { | |||
text-decoration: underline; | |||
} | |||
/* Dark mode - Links */ | |||
.skin-theme-clientpref-night .home-card__text a { | |||
color: var(--color-progressive, #4d90fe); | |||
} | |||
/* ============================================================================= | |||
GRILLES - Layouts multiples AVEC ESPACEMENTS RÉDUITS | |||
============================================================================= */ | |||
.home-cards-grid, | |||
.home-cards-grid-1, | |||
.home-cards-grid-2, | |||
.home-cards-grid-3 { | |||
display: grid; | |||
gap: 12px; /* ← RÉDUIT de 24px à 12px */ | |||
margin: 0 !important; /* ← SUPPRIMÉ margin 24px */ | |||
width: 100%; | |||
} | |||
/* Auto-responsive (défaut) */ | |||
.home-cards-grid { | |||
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); | |||
} | |||
.home- | /* Layouts fixes */ | ||
.home-cards-grid-1 { | |||
grid-template-columns: 1fr; | |||
max-width: 600px; | |||
margin-left: auto; | |||
margin-right: auto; | |||
} | |||
.home-cards-grid-2 { | |||
grid-template-columns: repeat(2, 1fr); | |||
} | |||
.home-cards-grid-3 { | |||
grid-template-columns: repeat(3, 1fr); | |||
} | |||
/* ============================================================================= | |||
LAYOUT AVEC SIDEBAR - ESPACEMENTS OPTIMISÉS | |||
============================================================================= */ | |||
.home-layout-with-sidebar { | |||
display: grid; | |||
grid-template-columns: 1fr 300px; | |||
gap: 0 16px; /* ← 0 vertical, 16px horizontal */ | |||
margin: 0 !important; | |||
padding: 0 !important; | |||
width: 100%; | |||
align-items: start; | |||
} | |||
/* Colonne principale (gauche) */ | |||
.home-main-content { | |||
display: flex; | |||
flex-direction: column; | |||
gap: 12px; /* ← Espacement entre sections */ | |||
margin: 0 !important; | |||
padding: 0 !important; | |||
} | |||
/* Sidebar (droite) */ | |||
.home-sidebar { | |||
position: sticky; | |||
top: 20px; | |||
display: flex; | |||
flex-direction: column; | |||
gap: 12px; | |||
margin: 0 !important; | |||
padding: 0 !important; | |||
} | |||
/* Override des grilles dans le layout sidebar */ | |||
.home-layout-with-sidebar .home-cards-grid-1, | |||
.home-layout-with-sidebar .home-cards-grid-2, | |||
.home-layout-with-sidebar .home-cards-grid-3 { | |||
gap: 12px; | |||
margin: 0 !important; | |||
} | |||
/* ============================================================================= | |||
SUPPRESSION DES MARGES MEDIAWIKI PAR DÉFAUT | |||
============================================================================= */ | |||
/* Supprimer les marges des éléments générés par MediaWiki */ | |||
.home-layout-with-sidebar p, | |||
.home-main-content p, | |||
.home-sidebar p { | |||
margin: 0 !important; | |||
} | |||
/* Supprimer les marges des divs conteneurs */ | |||
.home-main-content > div, | |||
.home-sidebar > div { | |||
margin: 0 !important; | |||
} | |||
/* Forcer la suppression des marges inline */ | |||
.home-layout-with-sidebar [style*="margin"], | |||
.home-main-content [style*="margin"], | |||
.home-sidebar [style*="margin"] { | |||
margin: 0 !important; | |||
} | } | ||
/* ============================================================================= | |||
RÉDUCTION DES MARGES INTERNES DES CARDS | |||
============================================================================= */ | |||
/* Classe optionnelle pour cards encore plus compactes */ | |||
/* Classe optionnelle pour cards plus compactes */ | |||
.home-card-compact .home-card__content { | .home-card-compact .home-card__content { | ||
padding: 12px !important; | |||
padding: | |||
} | } | ||
.home-card-compact .home-card__image { | .home-card-compact .home-card__image { | ||
height: 160px !important; | height: 160px !important; | ||
margin-bottom: 8px !important; | |||
margin-bottom: | |||
} | } | ||
.home-card-compact .home-card__title { | .home-card-compact .home-card__title { | ||
margin-bottom: 6px !important; | |||
margin-bottom: | |||
font-size: 1.1rem !important; | font-size: 1.1rem !important; | ||
} | } | ||
/* ============================================================================= | /* ============================================================================= | ||
RESPONSIVE - Adaptation mobile | RESPONSIVE - Adaptation mobile | ||
============================================================================= */ | ============================================================================= */ | ||
@media (max-width: 1024px) { | @media (max-width: 1024px) { | ||
/* Grille 3 colonnes → 2 colonnes */ | /* Grille 3 colonnes → 2 colonnes */ | ||
.home-cards-grid-3 { | .home-cards-grid-3 { | ||
grid-template-columns: repeat(2, 1fr); | grid-template-columns: repeat(2, 1fr); | ||
} | } | ||
/* Layout sidebar → empilé */ | /* Layout sidebar → empilé */ | ||
.home-layout-with-sidebar { | .home-layout-with-sidebar { | ||
grid-template-columns: 1fr; | grid-template-columns: 1fr; | ||
gap: 12px; | |||
gap: | |||
} | } | ||
.home-sidebar { | .home-sidebar { | ||
position: static; | position: static; | ||
order: -1; /* Sidebar en haut sur tablette */ | order: -1; /* Sidebar en haut sur tablette */ | ||
} | } | ||
} | } | ||
@media (max-width: 768px) { | @media (max-width: 768px) { | ||
/* Toutes les grilles → 1 colonne */ | /* Toutes les grilles → 1 colonne */ | ||
.home-cards-grid, | .home-cards-grid, | ||
.home-cards-grid-2, | |||
.home-cards-grid-2, | |||
.home-cards-grid-3 { | .home-cards-grid-3 { | ||
grid-template-columns: 1fr; | grid-template-columns: 1fr; | ||
gap: 12px; | |||
gap: | |||
} | } | ||
.home-layout-with-sidebar, | .home-layout-with-sidebar, | ||
.home-main-content, | .home-main-content, | ||
.home-sidebar { | .home-sidebar { | ||
gap: 12px; | |||
gap: | |||
} | } | ||
.home-card__image { | .home-card__image { | ||
height: 200px; | height: 200px; | ||
} | } | ||
.home-card__content { | .home-card__content { | ||
padding: 16px; | |||
padding: | |||
} | } | ||
.home-card__title { | .home-card__title { | ||
font-size: 1.25rem; | font-size: 1.25rem; | ||
} | } | ||
} | } | ||
@media (max-width: 480px) { | @media (max-width: 480px) { | ||
/* Mobile très petit → espacement minimal */ | /* Mobile très petit → espacement minimal */ | ||
.home-cards-grid, | .home-cards-grid, | ||
.home-cards-grid-1, | .home-cards-grid-1, | ||
.home-cards-grid-2, | |||
.home-cards-grid-2, | |||
.home-cards-grid-3 { | .home-cards-grid-3 { | ||
gap: 8px; | |||
gap: | |||
} | } | ||
.home-layout-with-sidebar, | .home-layout-with-sidebar, | ||
.home-main-content, | .home-main-content, | ||
.home-sidebar { | .home-sidebar { | ||
gap: 8px; | |||
gap: | |||
} | } | ||
.home-card__image { | .home-card__image { | ||
height: 180px; | height: 180px; | ||
} | } | ||
.home-card__content { | .home-card__content { | ||
padding: 12px; | |||
padding: | |||
} | } | ||
} | } | ||
/* ============================================================================= | /* ============================================================================= | ||
NETTOYAGE FINAL - FORCE TOUT À 0 SI PROBLÈME PERSISTE | NETTOYAGE FINAL - FORCE TOUT À 0 SI PROBLÈME PERSISTE | ||
============================================================================= */ | ============================================================================= */ | ||
/* Décommenter si l'espacement persiste malgré tout */ | /* Décommenter si l'espacement persiste malgré tout */ | ||
/* | /* | ||
.home-layout-with-sidebar, | .home-layout-with-sidebar, | ||
.home-layout-with-sidebar *, | .home-layout-with-sidebar *, | ||
.home-main-content, | .home-main-content, | ||
.home-main-content *, | .home-main-content *, | ||
.home-sidebar, | .home-sidebar, | ||
.home-sidebar * { | .home-sidebar * { | ||
margin-top: 0 !important; | margin-top: 0 !important; | ||
margin-bottom: 0 !important; | margin-bottom: 0 !important; | ||
} | } | ||
*/ | */ | ||