aspect-ratio
Utilities for controlling the aspect ratio of a widget box during Iced layout.
ISS preview

Examples
Section titled “Examples”use iced::widget::container;use iss::{tw, TwExt};
let preview = container(content) .tw(tw!("w-full aspect-video rounded-xl overflow-hidden bg-zinc-900"));use iss::typed::*;
let style = IssStyle::new() .w_full() .aspect_video() .rounded_xl() .bg(palette::ZINC_900);Class Reference
Section titled “Class Reference”| Tailwind Class | CSS Property / Effect | iss::typed Builder |
|---|---|---|
aspect-square |
aspect-ratio: 1 / 1; |
.aspect_square() |
aspect-video |
aspect-ratio: 16 / 9; |
.aspect_video() |
aspect-auto |
aspect-ratio: auto; |
.aspect_auto() |
aspect-<w>/<h> |
aspect-ratio: <w> / <h>; |
.aspect_ratio(4, 3) |
aspect-[3/2] |
aspect-ratio: 3 / 2; |
.aspect_ratio(3, 2) |
Related Utilities
Section titled “Related Utilities”width · height · object-fit