Commit 57d519b
feat(portfolio): add design.aspect_ratio knob for card images
Card image dimensions were hardcoded: a fixed-height box (h-48) plus a fixed
3:2 crop (Fill "600x400"). The box ratio therefore tracked card width / column
count and rarely matched the crop, so object-cover re-cropped the already
cropped image (a double-crop).
Add a `design.aspect_ratio` knob (square | landscape | portrait | wide | photo)
that mirrors the gallery block's vocabulary and drives BOTH the CSS aspect box
and the Fill dimensions from one map, so the box always matches the crop — a
single, predictable crop at any width / column count.
Defaults to `photo` (3:2, 600x400), preserving the previous appearance, so it's
non-breaking. All aspect class strings are literal in the template so Tailwind's
scanner emits them. Documents the option in the block README.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 68cbf33 commit 57d519b
2 files changed
Lines changed: 26 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| 99 | + | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
176 | 198 | | |
177 | 199 | | |
178 | 200 | | |
| |||
271 | 293 | | |
272 | 294 | | |
273 | 295 | | |
274 | | - | |
| 296 | + | |
275 | 297 | | |
276 | 298 | | |
277 | 299 | | |
| |||
281 | 303 | | |
282 | 304 | | |
283 | 305 | | |
284 | | - | |
| 306 | + | |
285 | 307 | | |
286 | 308 | | |
287 | 309 | | |
| |||
0 commit comments