- The mobile menu centers when it fits and starts at the top when it's taller than the screen (safe center), so its top is reachable; its close button is a 44px target. - Page titles and the hero headline start a size smaller on phones and break long words instead of being cut off. - Hero: the split buttons stack on a phone (the slash from sm); the slide dots and pause button are 40px targets and wrap; photo heroes leave room for the caption above the buttons. - Retreat carousel: phone-sized padding and type; on a phone the arrows sit beside the dots instead of over the text, dots are 40px targets, and a swipe turns it. The narrow event card layout gives the logo its own row (it had made a stray column). - People tiles: the details panel slides to stay on screen with its notch under the tile; a third column only when tiles keep 60% of their width; a 40px close button. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
471 lines
9.9 KiB
CSS
471 lines
9.9 KiB
CSS
/* PeopleTiles, polaroid-style people list.
|
|
Everything is scoped under .pl and driven by custom properties, so a section
|
|
can retune it inline: <PeopleTiles style={{ "--pl-base-w": "150px" }} /> */
|
|
|
|
.pl {
|
|
/* geometry */
|
|
--pl-scale: 1;
|
|
--pl-base-w: 132px;
|
|
--pl-w: calc(var(--pl-base-w) * var(--pl-scale));
|
|
--pl-gap: calc(0.875rem * var(--pl-scale));
|
|
--pl-pad: calc(0.5rem * var(--pl-scale));
|
|
--pl-photo-ratio: 1;
|
|
|
|
/* color */
|
|
--pl-accent: var(--color-link);
|
|
--pl-frame-bg: var(--color-raised);
|
|
--pl-frame-edge: color-mix(in srgb, var(--color-brand) 45%, transparent);
|
|
--pl-photo-bg: color-mix(in srgb, var(--color-muted) 15%, var(--color-surface));
|
|
--pl-ink: var(--color-ink);
|
|
--pl-muted: var(--color-muted);
|
|
--pl-rule: color-mix(in srgb, var(--color-brand) 35%, transparent);
|
|
|
|
position: relative;
|
|
container-type: inline-size;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: calc(var(--pl-gap) * 1.25);
|
|
color: var(--pl-ink);
|
|
|
|
/* The frame is the whole list's, not each tile's. */
|
|
padding: calc(var(--pl-gap) * 1.5);
|
|
border: 2px solid var(--pl-frame-edge);
|
|
}
|
|
|
|
.pl[data-size="sm"] {
|
|
--pl-base-w: 104px;
|
|
}
|
|
|
|
.pl[data-size="lg"] {
|
|
--pl-base-w: 164px;
|
|
}
|
|
|
|
/* groups --------------------------------------------------------------- */
|
|
|
|
.pl__groups {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: flex-start;
|
|
gap: calc(var(--pl-gap) * 1.5);
|
|
}
|
|
|
|
.pl[data-align="center"] .pl__groups,
|
|
.pl[data-align="center"] .pl__row {
|
|
justify-content: center;
|
|
}
|
|
|
|
.pl__group {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: calc(var(--pl-gap) * 0.75);
|
|
min-width: 0;
|
|
}
|
|
|
|
.pl__group + .pl__group {
|
|
padding-left: calc(var(--pl-gap) * 1.5);
|
|
border-left: 1px solid var(--pl-rule);
|
|
}
|
|
|
|
/* Everyone on one line (fitsOneRow in PeopleTiles.tsx): the groups
|
|
share it by head count, and the tiles narrow to fit. */
|
|
.pl__groups[data-row="one"] {
|
|
flex-wrap: nowrap;
|
|
}
|
|
|
|
.pl__groups[data-row="one"] .pl__group {
|
|
flex: var(--pl-share) 1 0;
|
|
}
|
|
|
|
.pl__group-head {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.15rem;
|
|
}
|
|
|
|
.pl__group-label {
|
|
margin: 0;
|
|
font-size: calc(0.9375rem * var(--pl-scale));
|
|
font-weight: 600;
|
|
letter-spacing: 0.01em;
|
|
}
|
|
|
|
.pl__group-note {
|
|
margin: 0;
|
|
font-size: calc(0.8125rem * var(--pl-scale));
|
|
color: var(--pl-muted);
|
|
}
|
|
|
|
.pl__row {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: var(--pl-gap);
|
|
margin: 0;
|
|
padding: 0;
|
|
list-style: none;
|
|
}
|
|
|
|
/* Balanced rows (PeopleTiles.tsx sets --pl-cols once it has measured):
|
|
a grid of equal columns, each at most a tile wide, shrinking only
|
|
when two won't fit. */
|
|
.pl__row[style*="--pl-cols"] {
|
|
display: grid;
|
|
grid-template-columns: repeat(var(--pl-cols), minmax(0, var(--pl-w)));
|
|
}
|
|
|
|
.pl[data-align="center"] .pl__row[style*="--pl-cols"] {
|
|
justify-content: center;
|
|
}
|
|
|
|
.pl__row[style*="--pl-cols"] .pl__tile {
|
|
width: 100%;
|
|
max-width: var(--pl-w);
|
|
}
|
|
|
|
/* Measures one tile's width and the gap for the balancing. */
|
|
.pl__probe {
|
|
position: absolute;
|
|
visibility: hidden;
|
|
width: var(--pl-w);
|
|
height: var(--pl-gap);
|
|
pointer-events: none;
|
|
}
|
|
|
|
.pl[data-overflow="scroll"] .pl__row {
|
|
flex-wrap: nowrap;
|
|
overflow-x: auto;
|
|
scroll-snap-type: x proximity;
|
|
padding-bottom: 0.35rem;
|
|
scrollbar-width: thin;
|
|
}
|
|
|
|
.pl[data-overflow="scroll"] .pl__item {
|
|
scroll-snap-align: start;
|
|
}
|
|
|
|
.pl__item {
|
|
position: relative;
|
|
flex: 0 0 auto;
|
|
}
|
|
|
|
/* tile ----------------------------------------------------------------- */
|
|
|
|
.pl__tile {
|
|
display: block;
|
|
width: var(--pl-w);
|
|
margin: 0;
|
|
padding: 0;
|
|
border: 0;
|
|
background: none;
|
|
font: inherit;
|
|
color: inherit;
|
|
text-align: inherit;
|
|
}
|
|
|
|
.pl__tile--button,
|
|
.pl__tile--link {
|
|
cursor: pointer;
|
|
}
|
|
|
|
.pl__tile--link {
|
|
color: inherit;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.pl__frame {
|
|
position: relative;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: calc(var(--pl-pad) * 0.9);
|
|
padding: var(--pl-pad);
|
|
padding-bottom: calc(var(--pl-pad) * 1.6);
|
|
background: var(--pl-frame-bg);
|
|
box-shadow: var(--shadow-sm);
|
|
transition: transform 160ms ease, background-color 160ms ease;
|
|
}
|
|
|
|
.pl[data-tilt="on"] .pl__item:nth-child(odd) .pl__frame {
|
|
transform: rotate(-1.1deg);
|
|
}
|
|
|
|
.pl[data-tilt="on"] .pl__item:nth-child(even) .pl__frame {
|
|
transform: rotate(0.9deg);
|
|
}
|
|
|
|
.pl__tile--button:hover .pl__frame,
|
|
.pl__tile--button:focus-visible .pl__frame,
|
|
.pl__tile--link:hover .pl__frame,
|
|
.pl__tile--link:focus-visible .pl__frame {
|
|
transform: translateY(-2px);
|
|
background: var(--color-tint-soft);
|
|
}
|
|
|
|
.pl__tile--button:focus-visible,
|
|
.pl__tile--link:focus-visible {
|
|
outline: none;
|
|
}
|
|
|
|
.pl__tile--button:focus-visible .pl__frame,
|
|
.pl__tile--link:focus-visible .pl__frame {
|
|
outline: 2px solid var(--pl-accent);
|
|
outline-offset: 3px;
|
|
}
|
|
|
|
.pl__tile[aria-expanded="true"] .pl__frame {
|
|
background: color-mix(in srgb, var(--pl-accent) 14%, var(--color-surface));
|
|
}
|
|
|
|
.pl__photo {
|
|
display: grid;
|
|
place-items: center;
|
|
aspect-ratio: var(--pl-photo-ratio);
|
|
overflow: hidden;
|
|
background: var(--pl-photo-bg);
|
|
}
|
|
|
|
.pl__img {
|
|
width: 100%;
|
|
height: 100%;
|
|
object-fit: cover;
|
|
display: block;
|
|
}
|
|
|
|
.pl__initials {
|
|
display: grid;
|
|
place-items: center;
|
|
width: 100%;
|
|
height: 100%;
|
|
font-family: var(--font-display);
|
|
font-size: calc(1.5rem * var(--pl-scale));
|
|
font-weight: 700;
|
|
letter-spacing: 0.03em;
|
|
}
|
|
|
|
/* A fixed height, two lines of name and two of title, so every card
|
|
in a row is the same height; longer text is cut with an ellipsis
|
|
(and the tile gets the chevron, PeopleTiles.tsx). The right padding
|
|
keeps the text clear of the chevron. */
|
|
.pl__caption {
|
|
--pl-name-lh: calc(0.875rem * var(--pl-scale) * 1.25);
|
|
--pl-title-lh: calc(0.75rem * var(--pl-scale) * 1.3);
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.15rem;
|
|
padding: 0 calc(1.25rem * var(--pl-scale)) 0 calc(var(--pl-pad) * 0.25);
|
|
height: calc(var(--pl-name-lh) * 2);
|
|
}
|
|
|
|
.pl__caption[data-title="on"] {
|
|
height: calc(var(--pl-name-lh) * 2 + 0.15rem + var(--pl-title-lh) * 2);
|
|
}
|
|
|
|
.pl__name,
|
|
.pl__title {
|
|
display: -webkit-box;
|
|
-webkit-box-orient: vertical;
|
|
-webkit-line-clamp: 2;
|
|
line-clamp: 2;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.pl__name {
|
|
font-size: calc(0.875rem * var(--pl-scale));
|
|
font-weight: 600;
|
|
line-height: 1.25;
|
|
max-height: calc(var(--pl-name-lh) * 2);
|
|
}
|
|
|
|
.pl__title {
|
|
font-size: calc(0.75rem * var(--pl-scale));
|
|
line-height: 1.3;
|
|
color: var(--pl-muted);
|
|
max-height: calc(var(--pl-title-lh) * 2);
|
|
}
|
|
|
|
.pl__badge {
|
|
position: absolute;
|
|
right: calc(var(--pl-pad) * 0.6);
|
|
bottom: calc(var(--pl-pad) * 0.6);
|
|
display: grid;
|
|
place-items: center;
|
|
width: calc(1.25rem * var(--pl-scale));
|
|
height: calc(1.25rem * var(--pl-scale));
|
|
background: var(--pl-accent);
|
|
color: #fff;
|
|
transition: transform 160ms ease;
|
|
}
|
|
|
|
.pl__tile[aria-expanded="true"] .pl__badge {
|
|
transform: rotate(180deg);
|
|
}
|
|
|
|
/* bio panel ------------------------------------------------------------ */
|
|
|
|
/* Under its tile, over what follows, with a notch pointing up at
|
|
the tile (PeopleTiles.tsx picks the side). */
|
|
.pl__bio--anchored {
|
|
position: absolute;
|
|
top: calc(100% + 0.75rem);
|
|
left: 0;
|
|
z-index: 30;
|
|
width: min(24rem, calc(100vw - 2rem));
|
|
border-left: 0;
|
|
border-top: 3px solid var(--pl-accent);
|
|
background: var(--color-surface);
|
|
box-shadow: var(--shadow-lg);
|
|
}
|
|
|
|
.pl__bio--anchored::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: -11px;
|
|
left: var(--pl-notch, calc(var(--pl-w) / 2 - 8px));
|
|
width: 16px;
|
|
height: 8px;
|
|
background: var(--pl-accent);
|
|
clip-path: polygon(50% 0, 100% 100%, 0 100%);
|
|
}
|
|
|
|
.pl__bio {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.65rem;
|
|
padding: 1rem 1.1rem;
|
|
border-left: 3px solid var(--pl-accent);
|
|
background: color-mix(in srgb, var(--pl-accent) 7%, var(--color-surface));
|
|
max-width: 68ch;
|
|
}
|
|
|
|
.pl__bio-head {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
justify-content: space-between;
|
|
gap: 1rem;
|
|
}
|
|
|
|
.pl__bio-name {
|
|
margin: 0;
|
|
font-size: 1.05rem;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.pl__bio-title {
|
|
margin: 0.1rem 0 0;
|
|
font-size: 0.875rem;
|
|
color: var(--pl-muted);
|
|
}
|
|
|
|
.pl__close {
|
|
flex: 0 0 auto;
|
|
width: 2.5rem;
|
|
height: 2.5rem;
|
|
border: 1px solid var(--pl-frame-edge);
|
|
border-radius: var(--btn-radius);
|
|
background: var(--color-surface);
|
|
color: var(--pl-muted);
|
|
font-size: 1.1rem;
|
|
line-height: 1;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.pl__close:hover {
|
|
color: var(--pl-ink);
|
|
border-color: var(--pl-accent);
|
|
}
|
|
|
|
.pl__facts {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 0.35rem 1.5rem;
|
|
margin: 0;
|
|
}
|
|
|
|
.pl__fact dt {
|
|
font-size: 0.6875rem;
|
|
font-weight: 600;
|
|
color: var(--pl-muted);
|
|
}
|
|
|
|
.pl__fact dd {
|
|
margin: 0;
|
|
font-size: 0.875rem;
|
|
}
|
|
|
|
.pl__fact a {
|
|
color: color-mix(in srgb, var(--pl-accent) var(--accent-text-mix), #fff);
|
|
text-decoration: underline;
|
|
text-underline-offset: 2px;
|
|
}
|
|
|
|
.pl__bio-text {
|
|
margin: 0;
|
|
font-size: 0.9375rem;
|
|
line-height: 1.6;
|
|
max-width: 62ch;
|
|
}
|
|
|
|
.pl__profile {
|
|
display: inline-block;
|
|
margin-top: 0.75rem;
|
|
font-size: 0.9375rem;
|
|
font-weight: 600;
|
|
color: color-mix(in srgb, var(--pl-accent) var(--accent-text-mix), #fff);
|
|
text-decoration: none;
|
|
}
|
|
|
|
.pl__profile:hover,
|
|
.pl__profile:focus-visible {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.pl__empty {
|
|
margin: 0;
|
|
font-size: 0.9375rem;
|
|
color: var(--pl-muted);
|
|
}
|
|
|
|
.pl__sr {
|
|
position: absolute;
|
|
width: 1px;
|
|
height: 1px;
|
|
margin: -1px;
|
|
padding: 0;
|
|
overflow: hidden;
|
|
clip-path: inset(50%);
|
|
white-space: nowrap;
|
|
}
|
|
|
|
/* narrow layouts ------------------------------------------------------- */
|
|
|
|
@container (max-width: 640px) {
|
|
.pl__group + .pl__group {
|
|
padding-left: 0;
|
|
padding-top: calc(var(--pl-gap) * 1.1);
|
|
border-left: 0;
|
|
border-top: 1px solid var(--pl-rule);
|
|
width: 100%;
|
|
}
|
|
}
|
|
|
|
@supports not (container-type: inline-size) {
|
|
@media (max-width: 640px) {
|
|
.pl__group + .pl__group {
|
|
padding-left: 0;
|
|
padding-top: calc(var(--pl-gap) * 1.1);
|
|
border-left: 0;
|
|
border-top: 1px solid var(--pl-rule);
|
|
width: 100%;
|
|
}
|
|
}
|
|
}
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.pl__frame,
|
|
.pl__badge {
|
|
transition: none;
|
|
}
|
|
|
|
.pl__tile--button:hover .pl__frame,
|
|
.pl__tile--button:focus-visible .pl__frame {
|
|
transform: none;
|
|
}
|
|
}
|