Skip to content

background-color

Utilities for controlling the solid background fill color with full Tailwind palette, /alpha, arbitrary hex, and @theme support.

BackgroundsTailwind v4 Spec
Interactive Iced
Rust · WASM
Iced + ISS preview demonstrating background-color
Click swatch pills to switch live ISS background colors in Iced
use iced::widget::container;
use iss::{tw, TwExt};
let card = container(body).tw(tw!("p-5 bg-white dark:bg-zinc-900 hover:bg-zinc-50 dark:hover:bg-zinc-800 rounded-xl"));
Tailwind Class CSS Property / Effect iss::typed Builder
bg-<color>-<shade> background-color: <palette>; .bg(palette::ZINC_900)
bg-blue-600/20 Alpha-modified background color; .bg(palette::BLUE_600.alpha(0.2))
bg-transparent / inherit / current Keyword background colors; .bg_transparent() / .bg_current()
bg-[#0d0f14] Arbitrary hex/rgb/hsl/oklch color; .bg(IssColor::hex(0x0D0F14))
bg-(--color-surface) background-color: var(--color-surface); .bg_var("--color-surface")

background-image · color · opacity