Template:Hub card/styles.css: Difference between revisions
Speedybrain (talk | contribs) Styles for Template:Hub card and Template:Hub grid (TPT2 brand kit cards). Source: wiki repo onwiki/Template/Hub card/styles.css |
Speedybrain (talk | contribs) No edit summary |
||
| Line 77: | Line 77: | ||
width: auto; | width: auto; | ||
height: auto; | height: auto; | ||
} | |||
/* Optional picture (image=): 16:9 across the top of the card, edge to edge. */ | |||
.wiki-card .tpt-card__media { | |||
margin: -16px -18px 0; | |||
aspect-ratio: 16 / 9; | |||
overflow: hidden; | |||
background-color: var(--tpt-surface-alt); | |||
} | |||
.wiki-card .tpt-card__media img { | |||
display: block; | |||
width: 100%; | |||
height: 100%; | |||
object-fit: cover; | |||
} | } | ||
Latest revision as of 23:01, 6 October 2026
/* Template:Hub card/styles.css (TemplateStyles): a grid of the kit's .tpt-card links.
* Hub grid wraps the cards; the title link covers the whole card. */
.wiki-cards {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
gap: 12px;
margin: 16px 0 28px;
clear: both;
}
.wiki-cards--wide {
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.wiki-card {
position: relative;
padding: 16px 18px;
gap: 8px;
}
.wiki-card:hover {
border-right-color: var(--tpt-line-strong);
border-bottom-color: var(--tpt-line-strong);
border-left-color: var(--tpt-line-strong);
}
.wiki-card .tpt-card__title {
font-size: 19px;
line-height: 24px;
}
.wiki-card .tpt-card__title a {
color: var(--tpt-ink);
text-decoration: none;
}
.wiki-card .tpt-card__title a::before {
content: "";
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.wiki-card .tpt-card__text {
font-size: 14px;
line-height: 21px;
}
.wiki-card .tpt-card__text p {
margin: 0;
}
.wiki-card .tpt-card__meta {
font-size: 12px;
}
/* Facility cards: a 3px top edge in the building's color. */
.wiki-card[class*="tpt-fac-"] {
border-top: 3px solid var(--tpt-fac);
}
.wiki-card .wiki-card__icon {
flex: none;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
}
.wiki-card .wiki-card__icon img {
max-width: 32px;
max-height: 32px;
width: auto;
height: auto;
}
/* Optional picture (image=): 16:9 across the top of the card, edge to edge. */
.wiki-card .tpt-card__media {
margin: -16px -18px 0;
aspect-ratio: 16 / 9;
overflow: hidden;
background-color: var(--tpt-surface-alt);
}
.wiki-card .tpt-card__media img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}