People tiles: square photos, a frame, even heights, palette initials
Captions are a fixed two lines of name and two of title; what doesn't fit ends in an ellipsis and gives the tile the down arrow, whose details show it in full. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5dbb203519
commit
592e07f614
3 changed files with 103 additions and 26 deletions
|
|
@ -10,17 +10,15 @@
|
|||
--pl-gap: calc(0.875rem * var(--pl-scale));
|
||||
--pl-pad: calc(0.5rem * var(--pl-scale));
|
||||
--pl-photo-ratio: 1;
|
||||
--pl-radius: 3px;
|
||||
|
||||
/* color */
|
||||
--pl-accent: var(--color-link);
|
||||
--pl-frame-bg: var(--color-surface);
|
||||
--pl-frame-edge: color-mix(in srgb, var(--color-muted) 20%, transparent);
|
||||
--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: rgba(45, 200, 224, 0.3);
|
||||
--pl-shadow: 0 1px 1px rgba(15, 23, 42, 0.06), 0 10px 18px -14px rgba(15, 23, 42, 0.5);
|
||||
--pl-rule: color-mix(in srgb, var(--color-brand) 35%, transparent);
|
||||
|
||||
container-type: inline-size;
|
||||
display: flex;
|
||||
|
|
@ -31,12 +29,10 @@
|
|||
|
||||
.pl[data-size="sm"] {
|
||||
--pl-base-w: 104px;
|
||||
--pl-radius: 2px;
|
||||
}
|
||||
|
||||
.pl[data-size="lg"] {
|
||||
--pl-base-w: 164px;
|
||||
--pl-photo-ratio: 4 / 5;
|
||||
}
|
||||
|
||||
/* groups --------------------------------------------------------------- */
|
||||
|
|
@ -141,10 +137,8 @@
|
|||
padding: var(--pl-pad);
|
||||
padding-bottom: calc(var(--pl-pad) * 1.6);
|
||||
background: var(--pl-frame-bg);
|
||||
border: 1px solid var(--pl-frame-edge);
|
||||
border-radius: var(--pl-radius);
|
||||
box-shadow: var(--pl-shadow);
|
||||
transition: transform 160ms ease, box-shadow 160ms ease;
|
||||
border: 2px solid var(--pl-frame-edge);
|
||||
transition: transform 160ms ease, border-color 160ms ease;
|
||||
}
|
||||
|
||||
.pl[data-tilt="on"] .pl__item:nth-child(odd) .pl__frame {
|
||||
|
|
@ -160,7 +154,7 @@
|
|||
.pl__tile--link:hover .pl__frame,
|
||||
.pl__tile--link:focus-visible .pl__frame {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 1px 1px rgba(15, 23, 42, 0.06), 0 16px 24px -16px rgba(15, 23, 42, 0.6);
|
||||
border-color: var(--pl-accent);
|
||||
}
|
||||
|
||||
.pl__tile--button:focus-visible,
|
||||
|
|
@ -176,7 +170,6 @@
|
|||
|
||||
.pl__tile[aria-expanded="true"] .pl__frame {
|
||||
border-color: var(--pl-accent);
|
||||
box-shadow: 0 0 0 1px var(--pl-accent), 0 14px 22px -16px rgba(15, 23, 42, 0.6);
|
||||
}
|
||||
|
||||
.pl__photo {
|
||||
|
|
@ -185,7 +178,6 @@
|
|||
aspect-ratio: var(--pl-photo-ratio);
|
||||
overflow: hidden;
|
||||
background: var(--pl-photo-bg);
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
.pl__img {
|
||||
|
|
@ -196,30 +188,55 @@
|
|||
}
|
||||
|
||||
.pl__initials {
|
||||
font-size: calc(1.25rem * var(--pl-scale));
|
||||
font-weight: 600;
|
||||
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;
|
||||
color: var(--pl-muted);
|
||||
}
|
||||
|
||||
/* 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.1rem;
|
||||
padding: 0 calc(var(--pl-pad) * 0.25);
|
||||
min-height: calc(1.1rem * var(--pl-scale));
|
||||
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 {
|
||||
|
|
@ -230,7 +247,6 @@
|
|||
place-items: center;
|
||||
width: calc(1.25rem * var(--pl-scale));
|
||||
height: calc(1.25rem * var(--pl-scale));
|
||||
border-radius: 999px;
|
||||
background: var(--pl-accent);
|
||||
color: #fff;
|
||||
transition: transform 160ms ease;
|
||||
|
|
@ -248,7 +264,6 @@
|
|||
gap: 0.65rem;
|
||||
padding: 1rem 1.1rem;
|
||||
border-left: 3px solid var(--pl-accent);
|
||||
border-radius: 6px;
|
||||
background: color-mix(in srgb, var(--pl-accent) 7%, var(--color-surface));
|
||||
max-width: 68ch;
|
||||
}
|
||||
|
|
@ -277,7 +292,8 @@
|
|||
width: 1.75rem;
|
||||
height: 1.75rem;
|
||||
border: 1px solid var(--pl-frame-edge);
|
||||
border-radius: 999px;
|
||||
border-radius: var(--btn-radius);
|
||||
corner-shape: squircle;
|
||||
background: var(--color-surface);
|
||||
color: var(--pl-muted);
|
||||
font-size: 1.1rem;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue