Skip to content

Commit 640523e

Browse files
committed
docs(skills): document Img cropped mode
1 parent 0c21898 commit 640523e

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

skills/maizzle/references/COMPONENTS.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,22 @@ Props: `src` (required; static fallback when `motionSrc` set), `alt`, `width` (r
188188
<Img src="/logo.png" dark-src="/logo-dark.png" motion-src="/logo.gif" alt="Logo" width="120" />
189189
```
190190

191+
### Cropped mode
192+
193+
`aspect` (or a Tailwind `aspect-*` class) switches to a cropped `background-image` wrapper + VML `<v:rect>` for Outlook. No `<img>` — wrapper is `role="img"` + `aria-label` from `alt`.
194+
195+
- `aspect``'16:9'`, `'16/9'`, `'4:3'`, `'1:1'`, etc. Prop wins over class.
196+
- Tailwind classes: `aspect-square` (1:1), `aspect-video` (16:9), `aspect-[n/m]`, `aspect-[n:m]`, `aspect-n/m`. Stripped from forwarded class.
197+
- `size` — default `'cover'`. Maps to VML aspect: `cover``atleast`, `contain``atmost`.
198+
- `position` — CSS `background-position`, default `'center'`.
199+
- `dark-src`/`motion-src` — emit `dark:bg-[url('…')]!` / `motion-safe:bg-[url('…')]!` classes instead of `<picture>`.
200+
- `outlookFallback` — default `true`; `false` skips the `<v:rect>`.
201+
202+
```vue
203+
<Img src="thumb.jpg" aspect="16:9" alt="Thumbnail" width="600" class="rounded-lg" />
204+
<Img src="thumb.jpg" width="600" class="aspect-video" />
205+
```
206+
191207
## Hr
192208

193209
`<div role="separator">` with defaults `h-px leading-px my-6 bg-slate-300`. Override via class: height (`h-*`/`leading-*`), margin (`m*-*`), color (`bg-*`).

0 commit comments

Comments
 (0)