MediaWiki:Common.css: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
/* 1. Force the container to stay the right size */ | |||
/* 1. | |||
.coverSmall { | .coverSmall { | ||
display: block; | display: block; | ||
width: 60px; | width: 60px !important; | ||
height: 80px; | height: 80px !important; | ||
overflow: hidden; /* | overflow: hidden; /* This acts as the "crop" */ | ||
position: relative; | |||
border: 1px solid #ddd; | border: 1px solid #ddd; | ||
} | } | ||
/* 2. | /* 2. Force the 300px image to "shrink" into the 60x80 box */ | ||
.mw-parser-output .coverSmall img.zoom-img { | .mw-parser-output .coverSmall img.zoom-img { | ||
width: 60px !important; | width: 60px !important; | ||
height: 80px !important; | height: 80px !important; | ||
object-fit: cover; /* | object-fit: cover; /* Keeps aspect ratio neat without stretching */ | ||
transition: transform 0.2s ease-in-out | display: block; | ||
transition: transform 0.2s ease-in-out !important; | |||
} | } | ||
/* 3. The Hover State - Magnification */ | |||
.coverThumb:hover .coverSmall { | .coverThumb:hover .coverSmall { | ||
overflow: visible; /* Let the image | overflow: visible; /* Let the image break out of the 60x80 box */ | ||
} | } | ||
.coverThumb:hover .coverSmall img.zoom-img { | .coverThumb:hover .coverSmall img.zoom-img { | ||
/* | position: absolute; | ||
width: | top: 0; | ||
left: 0; | |||
/* This defines the size of the "magnified" preview */ | |||
width: 250px !important; | |||
height: auto !important; | height: auto !important; | ||
/* | /* Move it to the right so it doesn't cover the name column */ | ||
transform: translate(70px, -20px) !important; | |||
transform: translate( | |||
z-index: 10000 !important; | z-index: 10000 !important; | ||
box-shadow: 0 5px 20px rgba(0,0,0,0.5); | |||
border: 1px solid #888; | |||
background: #fff; | |||
max-width: none !important; | |||
} | } | ||
Revision as of 09:45, 29 January 2026
/* 1. Force the container to stay the right size */
.coverSmall {
display: block;
width: 60px !important;
height: 80px !important;
overflow: hidden; /* This acts as the "crop" */
position: relative;
border: 1px solid #ddd;
}
/* 2. Force the 300px image to "shrink" into the 60x80 box */
.mw-parser-output .coverSmall img.zoom-img {
width: 60px !important;
height: 80px !important;
object-fit: cover; /* Keeps aspect ratio neat without stretching */
display: block;
transition: transform 0.2s ease-in-out !important;
}
/* 3. The Hover State - Magnification */
.coverThumb:hover .coverSmall {
overflow: visible; /* Let the image break out of the 60x80 box */
}
.coverThumb:hover .coverSmall img.zoom-img {
position: absolute;
top: 0;
left: 0;
/* This defines the size of the "magnified" preview */
width: 250px !important;
height: auto !important;
/* Move it to the right so it doesn't cover the name column */
transform: translate(70px, -20px) !important;
z-index: 10000 !important;
box-shadow: 0 5px 20px rgba(0,0,0,0.5);
border: 1px solid #888;
background: #fff;
max-width: none !important;
}