Template:Main Page/Sandbox/card/styles.css: Difference between revisions
Template page
More actions
No edit summary |
No edit summary |
||
| (5 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
/* Container for the tile grid */ | /* Container for the tile grid - flex wrap so cards fill each row and wrap to next line */ | ||
.resonite-home-grid { | .resonite-home-grid { | ||
display: | display: flex; | ||
flex-wrap: wrap; | |||
gap: 12px; | gap: 12px; | ||
margin: 1em 0 2em 0; | margin: 1em 0 2em 0; | ||
align-items: stretch; | |||
} | |||
.resonite-home-grid > .home-card { | |||
flex: 1 1 170px; | |||
min-width: 170px; | |||
} | } | ||
| Line 26: | Line 32: | ||
} | } | ||
/* Default hover when no | /* Default hover when no color modifier */ | ||
.home-card:not(.home-card--red):not(.home-card--orange):hover { | .home-card:not(.home-card--red):not(.home-card--orange):not(.home-card--yellow):not(.home-card--green):not(.home-card--blue):not(.home-card--purple):hover { | ||
background: #21262d; | background: #21262d; | ||
border-color: #8b949e; | border-color: #8b949e; | ||
} | } | ||
/* Icon: ensure emoji displays (no code-block styling) */ | /* Icon: ensure emoji or image displays (no code-block styling) */ | ||
.home-card__icon { | .home-card__icon { | ||
font-size: 2.5em; | font-size: 2.5em; | ||
| Line 41: | Line 47: | ||
font-family: inherit; | font-family: inherit; | ||
white-space: normal; | white-space: normal; | ||
} | |||
.home-card__icon img { | |||
max-height: 2.5em; | |||
width: auto; | |||
vertical-align: middle; | |||
} | } | ||
| Line 90: | Line 102: | ||
} | } | ||
/* White text on | /* External link: show only label + small icon (no full URL) */ | ||
.home-card--external .home-card__label a { | |||
overflow: hidden; | |||
text-overflow: ellipsis; | |||
white-space: nowrap; | |||
} | |||
.home-card--external .home-card__label a::after { | |||
content: " \29C9"; | |||
font-size: 0.75em; | |||
opacity: 0.85; | |||
white-space: nowrap; | |||
} | |||
/* White text on all full-color cards */ | |||
.home-card--red .home-card__label a, | .home-card--red .home-card__label a, | ||
.home-card--orange .home-card__label a { | .home-card--orange .home-card__label a, | ||
.home-card--yellow .home-card__label a, | |||
.home-card--green .home-card__label a, | |||
.home-card--blue .home-card__label a, | |||
.home-card--purple .home-card__label a { | |||
color: #fff !important; | color: #fff !important; | ||
} | } | ||
.home-card--red .home-card__icon, | .home-card--red .home-card__icon, | ||
.home-card--orange .home-card__icon { | .home-card--orange .home-card__icon, | ||
.home-card--yellow .home-card__icon, | |||
.home-card--green .home-card__icon, | |||
.home-card--blue .home-card__icon, | |||
.home-card--purple .home-card__icon { | |||
filter: none; | filter: none; | ||
} | } | ||
/* Color variants: | /* Color variants: full fill + brighter border (all sides) */ | ||
.home-card--red { | .home-card--red { | ||
background: #5c1a1a; | background: #5c1a1a; | ||
border: | border: 2px solid #e5534b; | ||
} | } | ||
.home-card--red:hover { | .home-card--red:hover { | ||
background: #6e2222; | background: #6e2222; | ||
border-color: # | border-color: #f85149; | ||
} | } | ||
.home-card--orange { | .home-card--orange { | ||
background: # | background: #3b2e25; | ||
border: | border: 2px solid #664c38; | ||
} | } | ||
.home-card--orange:hover { | .home-card--orange:hover { | ||
background: # | background: #4a3828; | ||
border-color: # | border-color: #f0883e; | ||
} | } | ||
.home-card--yellow { | .home-card--yellow { | ||
background: # | background: #3d3520; | ||
border: | border: 2px solid #d4a72c; | ||
border- | } | ||
.home-card--yellow:hover { | |||
background: #4a4020; | |||
border-color: #e5b82e; | |||
} | } | ||
.home-card--green { | .home-card--green { | ||
background: # | background: #1a2e1a; | ||
border: | border: 2px solid #3fb950; | ||
border- | } | ||
.home-card--green:hover { | |||
background: #1e3d1e; | |||
border-color: #56d364; | |||
} | } | ||
.home-card--blue { | .home-card--blue { | ||
background: # | background: #1a2433; | ||
border: | border: 2px solid #58a6ff; | ||
border- | } | ||
.home-card--blue:hover { | |||
background: #1e2d44; | |||
border-color: #79c0ff; | |||
} | } | ||
.home-card--purple { | .home-card--purple { | ||
background: # | background: #2a1a3d; | ||
border: | border: 2px solid #bc8cff; | ||
border- | } | ||
.home-card--purple:hover { | |||
background: #35204a; | |||
border-color: #d2a8ff; | |||
} | |||
/* Light theme support. | |||
Per MediaWiki recommendations: support explicit (skin-theme-clientpref-day) | |||
and automatic/OS mode (skin-theme-clientpref-os + prefers-color-scheme: light). */ | |||
@media screen { | |||
html.skin-theme-clientpref-day .home-card { | |||
background: #f6f8fa; | |||
border-color: #d0d7de; | |||
} | |||
html.skin-theme-clientpref-day .home-card:not(.home-card--red):not(.home-card--orange):not(.home-card--yellow):not(.home-card--green):not(.home-card--blue):not(.home-card--purple):hover { | |||
background: #eaeef2; | |||
border-color: #8b949e; | |||
} | |||
html.skin-theme-clientpref-day .home-card__label a { | |||
color: #24292f !important; | |||
} | |||
html.skin-theme-clientpref-day .home-card__icon img { | |||
filter: invert(1); | |||
} | |||
/* Light theme: dark text on light pastel backgrounds for readability */ | |||
html.skin-theme-clientpref-day .home-card--red .home-card__label a, | |||
html.skin-theme-clientpref-day .home-card--orange .home-card__label a, | |||
html.skin-theme-clientpref-day .home-card--yellow .home-card__label a, | |||
html.skin-theme-clientpref-day .home-card--green .home-card__label a, | |||
html.skin-theme-clientpref-day .home-card--blue .home-card__label a, | |||
html.skin-theme-clientpref-day .home-card--purple .home-card__label a { | |||
color: #24292f !important; | |||
} | |||
/* Invert white icons so they're visible on light backgrounds */ | |||
html.skin-theme-clientpref-day .home-card--red .home-card__icon img, | |||
html.skin-theme-clientpref-day .home-card--orange .home-card__icon img, | |||
html.skin-theme-clientpref-day .home-card--yellow .home-card__icon img, | |||
html.skin-theme-clientpref-day .home-card--green .home-card__icon img, | |||
html.skin-theme-clientpref-day .home-card--blue .home-card__icon img, | |||
html.skin-theme-clientpref-day .home-card--purple .home-card__icon img { | |||
filter: invert(1); | |||
} | |||
/* Light theme color variants */ | |||
html.skin-theme-clientpref-day .home-card--red { | |||
background: #ffebe9; | |||
border-color: #cf222e; | |||
} | |||
html.skin-theme-clientpref-day .home-card--red:hover { | |||
background: #ffcecb; | |||
border-color: #cf222e; | |||
} | |||
html.skin-theme-clientpref-day .home-card--orange { | |||
background: #fff8c5; | |||
border-color: #9a6700; | |||
} | |||
html.skin-theme-clientpref-day .home-card--orange:hover { | |||
background: #fae17d; | |||
border-color: #9a6700; | |||
} | |||
html.skin-theme-clientpref-day .home-card--yellow { | |||
background: #fff8c5; | |||
border-color: #9a6700; | |||
} | |||
html.skin-theme-clientpref-day .home-card--yellow:hover { | |||
background: #fae17d; | |||
border-color: #9a6700; | |||
} | |||
html.skin-theme-clientpref-day .home-card--green { | |||
background: #dafbe1; | |||
border-color: #2da44e; | |||
} | |||
html.skin-theme-clientpref-day .home-card--green:hover { | |||
background: #aceebb; | |||
border-color: #2da44e; | |||
} | |||
html.skin-theme-clientpref-day .home-card--blue { | |||
background: #ddf4ff; | |||
border-color: #0969da; | |||
} | |||
html.skin-theme-clientpref-day .home-card--blue:hover { | |||
background: #b6e3ff; | |||
border-color: #0969da; | |||
} | |||
html.skin-theme-clientpref-day .home-card--purple { | |||
background: #fbefff; | |||
border-color: #8250df; | |||
} | |||
html.skin-theme-clientpref-day .home-card--purple:hover { | |||
background: #ecd8ff; | |||
border-color: #8250df; | |||
} | |||
} | |||
@media screen and (prefers-color-scheme: light) { | |||
html.skin-theme-clientpref-os .home-card { | |||
background: #f6f8fa; | |||
border-color: #d0d7de; | |||
} | |||
html.skin-theme-clientpref-os .home-card:not(.home-card--red):not(.home-card--orange):not(.home-card--yellow):not(.home-card--green):not(.home-card--blue):not(.home-card--purple):hover { | |||
background: #eaeef2; | |||
border-color: #8b949e; | |||
} | |||
html.skin-theme-clientpref-os .home-card__label a { | |||
color: #24292f !important; | |||
} | |||
html.skin-theme-clientpref-os .home-card__icon img { | |||
filter: invert(1); | |||
} | |||
html.skin-theme-clientpref-os .home-card--red .home-card__label a, | |||
html.skin-theme-clientpref-os .home-card--orange .home-card__label a, | |||
html.skin-theme-clientpref-os .home-card--yellow .home-card__label a, | |||
html.skin-theme-clientpref-os .home-card--green .home-card__label a, | |||
html.skin-theme-clientpref-os .home-card--blue .home-card__label a, | |||
html.skin-theme-clientpref-os .home-card--purple .home-card__label a { | |||
color: #24292f !important; | |||
} | |||
html.skin-theme-clientpref-os .home-card--red .home-card__icon img, | |||
html.skin-theme-clientpref-os .home-card--orange .home-card__icon img, | |||
html.skin-theme-clientpref-os .home-card--yellow .home-card__icon img, | |||
html.skin-theme-clientpref-os .home-card--green .home-card__icon img, | |||
html.skin-theme-clientpref-os .home-card--blue .home-card__icon img, | |||
html.skin-theme-clientpref-os .home-card--purple .home-card__icon img { | |||
filter: invert(1); | |||
} | |||
html.skin-theme-clientpref-os .home-card--red { | |||
background: #ffebe9; | |||
border-color: #cf222e; | |||
} | |||
html.skin-theme-clientpref-os .home-card--red:hover { | |||
background: #ffcecb; | |||
border-color: #cf222e; | |||
} | |||
html.skin-theme-clientpref-os .home-card--orange { | |||
background: #fff8c5; | |||
border-color: #9a6700; | |||
} | |||
html.skin-theme-clientpref-os .home-card--orange:hover { | |||
background: #fae17d; | |||
border-color: #9a6700; | |||
} | |||
html.skin-theme-clientpref-os .home-card--yellow { | |||
background: #fff8c5; | |||
border-color: #9a6700; | |||
} | |||
html.skin-theme-clientpref-os .home-card--yellow:hover { | |||
background: #fae17d; | |||
border-color: #9a6700; | |||
} | |||
html.skin-theme-clientpref-os .home-card--green { | |||
background: #dafbe1; | |||
border-color: #2da44e; | |||
} | |||
html.skin-theme-clientpref-os .home-card--green:hover { | |||
background: #aceebb; | |||
border-color: #2da44e; | |||
} | |||
html.skin-theme-clientpref-os .home-card--blue { | |||
background: #ddf4ff; | |||
border-color: #0969da; | |||
} | |||
html.skin-theme-clientpref-os .home-card--blue:hover { | |||
background: #b6e3ff; | |||
border-color: #0969da; | |||
} | |||
html.skin-theme-clientpref-os .home-card--purple { | |||
background: #fbefff; | |||
border-color: #8250df; | |||
} | |||
html.skin-theme-clientpref-os .home-card--purple:hover { | |||
background: #ecd8ff; | |||
border-color: #8250df; | |||
} | |||
} | } | ||
Latest revision as of 23:23, 3 February 2026
/* Container for the tile grid - flex wrap so cards fill each row and wrap to next line */
.resonite-home-grid {
display: flex;
flex-wrap: wrap;
gap: 12px;
margin: 1em 0 2em 0;
align-items: stretch;
}
.resonite-home-grid > .home-card {
flex: 1 1 170px;
min-width: 170px;
}
/* The Card/Tile */
.home-card {
position: relative;
cursor: pointer;
background: #161b22;
border: 1px solid #30363d;
border-radius: 8px;
padding: 24px 10px;
text-align: center;
transition: background 0.2s, transform 0.1s;
display: flex;
flex-direction: column;
align-items: center;
}
.home-card:hover {
transform: translateY(-2px);
}
/* Default hover when no color modifier */
.home-card:not(.home-card--red):not(.home-card--orange):not(.home-card--yellow):not(.home-card--green):not(.home-card--blue):not(.home-card--purple):hover {
background: #21262d;
border-color: #8b949e;
}
/* Icon: ensure emoji or image displays (no code-block styling) */
.home-card__icon {
font-size: 2.5em;
margin-bottom: 12px;
line-height: 1;
position: relative;
z-index: 0;
font-family: inherit;
white-space: normal;
}
.home-card__icon img {
max-height: 2.5em;
width: auto;
vertical-align: middle;
}
/* Undo code-block appearance if parser wraps label in <pre> */
.home-card__label pre {
display: inline;
margin: 0;
padding: 0;
font-family: inherit;
font-size: inherit;
white-space: normal;
background: none;
border: none;
}
/* Label: stretch over entire card so the link fills the card (one clickable area) */
.home-card__label {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
flex-direction: column;
justify-content: flex-end;
align-items: center;
padding-bottom: 1em;
}
.home-card__label a {
display: flex;
flex-direction: column;
justify-content: flex-end;
align-items: center;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
color: #c9d1d9 !important;
font-weight: bold;
text-decoration: none !important;
font-size: 0.95em;
background: none !important;
border: none !important;
border-radius: 0 !important;
padding: 0 !important;
box-shadow: none !important;
}
/* External link: show only label + small icon (no full URL) */
.home-card--external .home-card__label a {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.home-card--external .home-card__label a::after {
content: " \29C9";
font-size: 0.75em;
opacity: 0.85;
white-space: nowrap;
}
/* White text on all full-color cards */
.home-card--red .home-card__label a,
.home-card--orange .home-card__label a,
.home-card--yellow .home-card__label a,
.home-card--green .home-card__label a,
.home-card--blue .home-card__label a,
.home-card--purple .home-card__label a {
color: #fff !important;
}
.home-card--red .home-card__icon,
.home-card--orange .home-card__icon,
.home-card--yellow .home-card__icon,
.home-card--green .home-card__icon,
.home-card--blue .home-card__icon,
.home-card--purple .home-card__icon {
filter: none;
}
/* Color variants: full fill + brighter border (all sides) */
.home-card--red {
background: #5c1a1a;
border: 2px solid #e5534b;
}
.home-card--red:hover {
background: #6e2222;
border-color: #f85149;
}
.home-card--orange {
background: #3b2e25;
border: 2px solid #664c38;
}
.home-card--orange:hover {
background: #4a3828;
border-color: #f0883e;
}
.home-card--yellow {
background: #3d3520;
border: 2px solid #d4a72c;
}
.home-card--yellow:hover {
background: #4a4020;
border-color: #e5b82e;
}
.home-card--green {
background: #1a2e1a;
border: 2px solid #3fb950;
}
.home-card--green:hover {
background: #1e3d1e;
border-color: #56d364;
}
.home-card--blue {
background: #1a2433;
border: 2px solid #58a6ff;
}
.home-card--blue:hover {
background: #1e2d44;
border-color: #79c0ff;
}
.home-card--purple {
background: #2a1a3d;
border: 2px solid #bc8cff;
}
.home-card--purple:hover {
background: #35204a;
border-color: #d2a8ff;
}
/* Light theme support.
Per MediaWiki recommendations: support explicit (skin-theme-clientpref-day)
and automatic/OS mode (skin-theme-clientpref-os + prefers-color-scheme: light). */
@media screen {
html.skin-theme-clientpref-day .home-card {
background: #f6f8fa;
border-color: #d0d7de;
}
html.skin-theme-clientpref-day .home-card:not(.home-card--red):not(.home-card--orange):not(.home-card--yellow):not(.home-card--green):not(.home-card--blue):not(.home-card--purple):hover {
background: #eaeef2;
border-color: #8b949e;
}
html.skin-theme-clientpref-day .home-card__label a {
color: #24292f !important;
}
html.skin-theme-clientpref-day .home-card__icon img {
filter: invert(1);
}
/* Light theme: dark text on light pastel backgrounds for readability */
html.skin-theme-clientpref-day .home-card--red .home-card__label a,
html.skin-theme-clientpref-day .home-card--orange .home-card__label a,
html.skin-theme-clientpref-day .home-card--yellow .home-card__label a,
html.skin-theme-clientpref-day .home-card--green .home-card__label a,
html.skin-theme-clientpref-day .home-card--blue .home-card__label a,
html.skin-theme-clientpref-day .home-card--purple .home-card__label a {
color: #24292f !important;
}
/* Invert white icons so they're visible on light backgrounds */
html.skin-theme-clientpref-day .home-card--red .home-card__icon img,
html.skin-theme-clientpref-day .home-card--orange .home-card__icon img,
html.skin-theme-clientpref-day .home-card--yellow .home-card__icon img,
html.skin-theme-clientpref-day .home-card--green .home-card__icon img,
html.skin-theme-clientpref-day .home-card--blue .home-card__icon img,
html.skin-theme-clientpref-day .home-card--purple .home-card__icon img {
filter: invert(1);
}
/* Light theme color variants */
html.skin-theme-clientpref-day .home-card--red {
background: #ffebe9;
border-color: #cf222e;
}
html.skin-theme-clientpref-day .home-card--red:hover {
background: #ffcecb;
border-color: #cf222e;
}
html.skin-theme-clientpref-day .home-card--orange {
background: #fff8c5;
border-color: #9a6700;
}
html.skin-theme-clientpref-day .home-card--orange:hover {
background: #fae17d;
border-color: #9a6700;
}
html.skin-theme-clientpref-day .home-card--yellow {
background: #fff8c5;
border-color: #9a6700;
}
html.skin-theme-clientpref-day .home-card--yellow:hover {
background: #fae17d;
border-color: #9a6700;
}
html.skin-theme-clientpref-day .home-card--green {
background: #dafbe1;
border-color: #2da44e;
}
html.skin-theme-clientpref-day .home-card--green:hover {
background: #aceebb;
border-color: #2da44e;
}
html.skin-theme-clientpref-day .home-card--blue {
background: #ddf4ff;
border-color: #0969da;
}
html.skin-theme-clientpref-day .home-card--blue:hover {
background: #b6e3ff;
border-color: #0969da;
}
html.skin-theme-clientpref-day .home-card--purple {
background: #fbefff;
border-color: #8250df;
}
html.skin-theme-clientpref-day .home-card--purple:hover {
background: #ecd8ff;
border-color: #8250df;
}
}
@media screen and (prefers-color-scheme: light) {
html.skin-theme-clientpref-os .home-card {
background: #f6f8fa;
border-color: #d0d7de;
}
html.skin-theme-clientpref-os .home-card:not(.home-card--red):not(.home-card--orange):not(.home-card--yellow):not(.home-card--green):not(.home-card--blue):not(.home-card--purple):hover {
background: #eaeef2;
border-color: #8b949e;
}
html.skin-theme-clientpref-os .home-card__label a {
color: #24292f !important;
}
html.skin-theme-clientpref-os .home-card__icon img {
filter: invert(1);
}
html.skin-theme-clientpref-os .home-card--red .home-card__label a,
html.skin-theme-clientpref-os .home-card--orange .home-card__label a,
html.skin-theme-clientpref-os .home-card--yellow .home-card__label a,
html.skin-theme-clientpref-os .home-card--green .home-card__label a,
html.skin-theme-clientpref-os .home-card--blue .home-card__label a,
html.skin-theme-clientpref-os .home-card--purple .home-card__label a {
color: #24292f !important;
}
html.skin-theme-clientpref-os .home-card--red .home-card__icon img,
html.skin-theme-clientpref-os .home-card--orange .home-card__icon img,
html.skin-theme-clientpref-os .home-card--yellow .home-card__icon img,
html.skin-theme-clientpref-os .home-card--green .home-card__icon img,
html.skin-theme-clientpref-os .home-card--blue .home-card__icon img,
html.skin-theme-clientpref-os .home-card--purple .home-card__icon img {
filter: invert(1);
}
html.skin-theme-clientpref-os .home-card--red {
background: #ffebe9;
border-color: #cf222e;
}
html.skin-theme-clientpref-os .home-card--red:hover {
background: #ffcecb;
border-color: #cf222e;
}
html.skin-theme-clientpref-os .home-card--orange {
background: #fff8c5;
border-color: #9a6700;
}
html.skin-theme-clientpref-os .home-card--orange:hover {
background: #fae17d;
border-color: #9a6700;
}
html.skin-theme-clientpref-os .home-card--yellow {
background: #fff8c5;
border-color: #9a6700;
}
html.skin-theme-clientpref-os .home-card--yellow:hover {
background: #fae17d;
border-color: #9a6700;
}
html.skin-theme-clientpref-os .home-card--green {
background: #dafbe1;
border-color: #2da44e;
}
html.skin-theme-clientpref-os .home-card--green:hover {
background: #aceebb;
border-color: #2da44e;
}
html.skin-theme-clientpref-os .home-card--blue {
background: #ddf4ff;
border-color: #0969da;
}
html.skin-theme-clientpref-os .home-card--blue:hover {
background: #b6e3ff;
border-color: #0969da;
}
html.skin-theme-clientpref-os .home-card--purple {
background: #fbefff;
border-color: #8250df;
}
html.skin-theme-clientpref-os .home-card--purple:hover {
background: #ecd8ff;
border-color: #8250df;
}
}