hackertours/assets/css/_events.css
Vincent Mahnke 213e58256f
All checks were successful
/ build (pull_request) Successful in 1m16s
/ accessibility (pull_request) Successful in 2m1s
/ cleanup-staging (pull_request) Successful in 27s
feat: Shows events as cards on the home page
Replaces the line of links to previous events with cards after the 40C3
start page: each card has the event's logo (designs.events.ccc.de) in its
heading bar, the motto, full name, dates and venue. 40C3 is greyed out as
in progress; the other cards link to their tours.

The cards reuse the theme's own colours -- the link colour for the motto
and the heading and text colours for the rest -- on the hairline border
and 0.25rem corners of the start page's cards. The logo credits that a
licence asks for are shown in the page footer.

The events shortcode reads data/events.yaml; the README documents it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-09 04:06:47 +01:00

139 lines
3.8 KiB
CSS

/*
* Event cards on the home page (events shortcode), after the cards on the 40C3 start page
* (events.ccc.de/congress/2026/infos/startpage.html): a heading bar that holds the event's logo,
* drawn in the heading colour like the start page's icons, above the event's details. Cards of
* past events link to their tours; an event in progress is greyed out.
*/
/* The hairline, corners and inactive grey of the start page's Bootstrap cards (as archived in
October 2026); the text reuses the theme's own colours, the link colour for the motto and the
heading and text colours for the rest. */
.event-cards {
--event-card-line: 1px;
--event-card-radius: 0.25rem;
--event-card-bg: light-dark(#fff, #242424);
--event-card-border: light-dark(rgb(0 0 0 / 12.5%), rgb(255 255 255 / 15%));
--event-card-inactive-bg: light-dark(lightgrey, #363636);
--event-card-inactive-text: light-dark(#5a5a5a, #a6a6a6);
display: grid;
grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr));
gap: 2rem;
margin-block: 0 var(--spacing-m);
padding: 0;
list-style: none;
}
.event-cards__item {
max-width: none;
}
/* The card keeps its own colours in every link state: the theme's link colours are in a cascade
layer, this file isn't. */
.event-card {
display: flex;
flex-direction: column;
block-size: 100%;
border: var(--event-card-line) solid var(--event-card-border);
border-radius: var(--event-card-radius);
background: var(--event-card-bg);
color: var(--color-text);
text-decoration: none;
}
.event-card__heading {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
padding: 0.5rem 1rem;
border-block-end: var(--event-card-line) solid var(--event-card-border);
color: var(--color-headings);
}
.event-card__title {
max-width: none;
margin: 0;
color: inherit;
font-family: var(--ff-headings);
font-size: var(--fs-l);
font-weight: var(--fw-headings);
line-height: 1;
text-decoration: none;
}
/* The logo as a mask in the text colour, 2rem high (the start page's size-8 icons); wide
wordmarks shrink to leave room for the title. */
.event-card__logo {
flex: none;
max-inline-size: 60%;
block-size: 2rem;
background-color: currentcolor;
mask: var(--event-logo) right center / contain no-repeat;
}
.event-card__body {
display: flex;
flex-direction: column;
flex-grow: 1;
gap: 0.25rem;
padding: 0.5rem 1rem 0.75rem;
p {
margin: 0;
}
}
/* The motto stands out in the theme's link colour, like the one link on the card. */
.event-card__motto {
color: var(--color-link);
font-weight: bold;
}
.event-card__meta {
font-size: var(--fs-s);
}
.event-card__status {
align-self: flex-start;
margin-block-start: 0.25rem;
padding: 0.1rem 0.5rem;
border: var(--event-card-line) solid currentcolor;
border-radius: var(--event-card-radius);
font-size: var(--fs-xs);
font-weight: bold;
letter-spacing: 0.03em;
text-transform: uppercase;
width: 100%;
text-align: center;
margin-top: 0.5em !important;
}
/* An inactive card isn't a link, so it greys its motto and text to read as non-interactive. */
.event-card--inactive {
background: var(--event-card-inactive-bg);
color: var(--event-card-inactive-text);
.event-card__motto {
color: inherit;
}
}
/* Hover and focus underline the motto and shift it to the theme's link-hover colour, like a link. */
a.event-card:hover .event-card__motto,
a.event-card:focus-visible .event-card__motto {
color: var(--color-link-hover);
text-decoration: underline;
}
/* Forced colours drop background colours, and with them the masked logos. */
@media (forced-colors: active) {
.event-card__logo {
background-color: CanvasText;
forced-color-adjust: none;
}
a.event-card .event-card__logo {
background-color: LinkText;
}
}