Skip to content

background-size

Utilities for controlling the rendered dimensions of background images and gradient tiles.

BackgroundsTailwind v4 Spec
ISS preview
Iced + ISS preview demonstrating background-size
ISS preview for background-size
use iced::widget::container;
use iss::{tw, TwExt};
let grid_bg = container(body).tw(tw!("bg-repeat bg-[length:24px_24px]"));
Tailwind Class CSS Property / Effect iss::typed Builder
bg-auto background-size: auto; .bg_auto()
bg-cover background-size: cover; .bg_cover()
bg-contain background-size: contain; .bg_contain()
bg-[length:120px_80px] background-size: 120px 80px; .bg_size_px(120, 80)
  • Use bg-[length:...] for arbitrary dimensions so ISS disambiguates them from arbitrary colors.

background-repeat · background-position · object-fit