« Modèle:Card/styles.css » : différence entre les versions
De Nefald
Autres actions
Aucun résumé des modifications |
Aucun résumé des modifications |
||
| (4 versions intermédiaires par le même utilisateur non affichées) | |||
| Ligne 240 : | Ligne 240 : | ||
color: var(--color-progressive, #4d90fe); | color: var(--color-progressive, #4d90fe); | ||
} | } | ||
/* ============================================================================= | /* ============================================================================= | ||
GRILLES - Layouts multiples | GRILLES - Layouts multiples AVEC ESPACEMENTS RÉDUITS | ||
============================================================================= */ | ============================================================================= */ | ||
| Ligne 250 : | Ligne 249 : | ||
.home-cards-grid-3 { | .home-cards-grid-3 { | ||
display: grid; | display: grid; | ||
gap: 24px | gap: 12px; /* ← RÉDUIT de 24px à 12px */ | ||
margin: | margin: 0 !important; /* ← SUPPRIMÉ margin 24px */ | ||
width: 100%; | width: 100%; | ||
} | } | ||
| Ligne 277 : | Ligne 276 : | ||
/* ============================================================================= | /* ============================================================================= | ||
LAYOUT AVEC SIDEBAR - ESPACEMENTS OPTIMISÉS | |||
LAYOUT AVEC SIDEBAR | |||
============================================================================= */ | ============================================================================= */ | ||
.home-layout-with-sidebar { | .home-layout-with-sidebar { | ||
display: grid; | display: grid; | ||
grid-template-columns: 1fr | grid-template-columns: 1fr 300px; | ||
gap: | gap: 0 16px; /* ← 0 vertical, 16px horizontal */ | ||
margin: | margin: 0 !important; | ||
padding: 0 !important; | |||
width: 100%; | width: 100%; | ||
align-items: start; | align-items: start; | ||
| Ligne 362 : | Ligne 293 : | ||
display: flex; | display: flex; | ||
flex-direction: column; | flex-direction: column; | ||
gap: | gap: 12px; /* ← Espacement entre sections */ | ||
margin: 0 !important; | |||
padding: 0 !important; | |||
} | } | ||
| Ligne 371 : | Ligne 304 : | ||
display: flex; | display: flex; | ||
flex-direction: column; | flex-direction: column; | ||
gap: | 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; | |||
} | } | ||
/* | /* ============================================================================= | ||
.home- | SUPPRESSION DES MARGES MEDIAWIKI PAR DÉFAUT | ||
.home- | ============================================================================= */ | ||
/* 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 */ | |||
.home-card-compact .home-card__content { | |||
padding: 12px !important; | |||
} | } | ||
.home- | .home-card-compact .home-card__image { | ||
height: 160px !important; | |||
margin-bottom: 8px !important; | |||
} | } | ||
.home- | .home-card-compact .home-card__title { | ||
margin-bottom: 6px !important; | |||
font-size: 1.1rem !important; | |||
} | } | ||
| Ligne 395 : | Ligne 365 : | ||
@media (max-width: 1024px) { | @media (max-width: 1024px) { | ||
/* Grille 3 colonnes → 2 colonnes */ | |||
.home-cards-grid-3 { | |||
grid-template-columns: repeat(2, 1fr); | |||
} | |||
/* Layout sidebar → empilé */ | |||
.home-layout-with-sidebar { | .home-layout-with-sidebar { | ||
grid-template-columns: 1fr; | grid-template-columns: 1fr; | ||
gap: | gap: 12px; | ||
} | } | ||
.home-sidebar { | .home-sidebar { | ||
position: static; | position: static; | ||
order: -1; /* Sidebar en haut sur | order: -1; /* Sidebar en haut sur tablette */ | ||
} | } | ||
} | } | ||
@media (max-width: 768px) { | @media (max-width: 768px) { | ||
.home-cards-grid-2 { | /* Toutes les grilles → 1 colonne */ | ||
.home-cards-grid, | |||
.home-cards-grid-2, | |||
.home-cards-grid-3 { | |||
grid-template-columns: 1fr; | grid-template-columns: 1fr; | ||
gap: | gap: 12px; | ||
} | |||
.home-layout-with-sidebar, | |||
.home-main-content, | |||
.home-sidebar { | |||
gap: 12px; | |||
} | } | ||
.home-card__image { | |||
height: 200px; | |||
} | |||
.home-card__content { | |||
padding: 16px; | |||
} | |||
.home-card__title { | |||
font-size: 1.25rem; | |||
} | |||
} | |||
@media (max-width: 480px) { | |||
/* Mobile très petit → espacement minimal */ | |||
.home-cards-grid, | |||
.home-cards-grid-1, | |||
.home-cards-grid-2, | |||
.home-cards-grid-3 { | |||
gap: 8px; | |||
} | |||
.home-layout-with-sidebar, | |||
.home-main-content, | |||
.home-sidebar { | |||
gap: 8px; | |||
} | |||
.home-card__image { | |||
height: 180px; | |||
} | |||
.home-card__content { | |||
padding: 12px; | |||
} | |||
} | |||
/* ============================================================================= | |||
NETTOYAGE FINAL - FORCE TOUT À 0 SI PROBLÈME PERSISTE | |||
============================================================================= */ | |||
/* Décommenter si l'espacement persiste malgré tout */ | |||
/* | |||
.home-layout-with-sidebar, | |||
.home-layout-with-sidebar *, | |||
.home-main-content, | |||
.home-main-content *, | |||
.home-sidebar, | |||
.home-sidebar * { | |||
margin-top: 0 !important; | |||
margin-bottom: 0 !important; | |||
} | } | ||
*/ | |||
Dernière version du 31 octobre 2025 à 20:20
/* =============================================================================
HOME CARD COMPONENT
Composant de carte stylisé pour affichage de contenu avec image
Compatible dark/light mode avec Citizen skin
============================================================================= */
/* -----------------------------------------------------------------------------
STRUCTURE DE BASE
----------------------------------------------------------------------------- */
.home-card {
/* Layout */
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
/* Style */
background: var(--color-surface-1);
border: 1px solid var(--border-color-base, rgba(0, 0, 0, 0.1));
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
/* Animation */
transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.home-card:hover {
transform: translateY(-4px);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
border-color: var(--color-progressive, #36c);
}
/* Dark mode - Card base */
.skin-theme-clientpref-night .home-card {
border-color: var(--border-color-subtle, rgba(255, 255, 255, 0.1));
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.skin-theme-clientpref-night .home-card:hover {
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
}
/* -----------------------------------------------------------------------------
IMAGE - Section supérieure PLEINE LARGEUR
----------------------------------------------------------------------------- */
.home-card__image {
position: relative;
width: 100%;
height: 250px;
flex-shrink: 0;
overflow: hidden;
margin: 0;
padding: 0;
background: var(--color-surface-2);
display: flex;
align-items: center;
justify-content: center;
}
/* Forcer TOUS les éléments MediaWiki à être en pleine largeur */
.home-card__image * {
margin: 0 !important;
padding: 0 !important;
border: none !important;
background: transparent !important;
}
.home-card__image .thumb,
.home-card__image .thumbinner,
.home-card__image .thumbcaption,
.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;
width: 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 {
/* Layout */
display: flex;
flex-direction: column;
flex-grow: 1;
gap: 12px;
padding: 24px;
}
/* -----------------------------------------------------------------------------
TITLE - Titre principal
----------------------------------------------------------------------------- */
.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);
}
/* Dark mode - Title */
.skin-theme-clientpref-night .home-card__title {
color: var(--color-emphasized, #fff);
}
/* -----------------------------------------------------------------------------
SUBTITLE - Sous-titre
----------------------------------------------------------------------------- */
.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, #aaa);
}
/* -----------------------------------------------------------------------------
TEXT - Corps de texte (supporte wikitext)
----------------------------------------------------------------------------- */
.home-card__text {
margin: 0;
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));
}
/* 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 */
.home-card-compact .home-card__content {
padding: 12px !important;
}
.home-card-compact .home-card__image {
height: 160px !important;
margin-bottom: 8px !important;
}
.home-card-compact .home-card__title {
margin-bottom: 6px !important;
font-size: 1.1rem !important;
}
/* =============================================================================
RESPONSIVE - Adaptation mobile
============================================================================= */
@media (max-width: 1024px) {
/* Grille 3 colonnes → 2 colonnes */
.home-cards-grid-3 {
grid-template-columns: repeat(2, 1fr);
}
/* Layout sidebar → empilé */
.home-layout-with-sidebar {
grid-template-columns: 1fr;
gap: 12px;
}
.home-sidebar {
position: static;
order: -1; /* Sidebar en haut sur tablette */
}
}
@media (max-width: 768px) {
/* Toutes les grilles → 1 colonne */
.home-cards-grid,
.home-cards-grid-2,
.home-cards-grid-3 {
grid-template-columns: 1fr;
gap: 12px;
}
.home-layout-with-sidebar,
.home-main-content,
.home-sidebar {
gap: 12px;
}
.home-card__image {
height: 200px;
}
.home-card__content {
padding: 16px;
}
.home-card__title {
font-size: 1.25rem;
}
}
@media (max-width: 480px) {
/* Mobile très petit → espacement minimal */
.home-cards-grid,
.home-cards-grid-1,
.home-cards-grid-2,
.home-cards-grid-3 {
gap: 8px;
}
.home-layout-with-sidebar,
.home-main-content,
.home-sidebar {
gap: 8px;
}
.home-card__image {
height: 180px;
}
.home-card__content {
padding: 12px;
}
}
/* =============================================================================
NETTOYAGE FINAL - FORCE TOUT À 0 SI PROBLÈME PERSISTE
============================================================================= */
/* Décommenter si l'espacement persiste malgré tout */
/*
.home-layout-with-sidebar,
.home-layout-with-sidebar *,
.home-main-content,
.home-main-content *,
.home-sidebar,
.home-sidebar * {
margin-top: 0 !important;
margin-bottom: 0 !important;
}
*/