background-color
Utilities for controlling the solid background fill color with full Tailwind palette, /alpha, arbitrary hex, and @theme support.
Interactive Iced
Rust · WASM
Examples
Section titled “Examples”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"));use iss::typed::*;
let style = IssStyle::new().p(5).bg(palette::WHITE).dark(|s| s.bg(palette::ZINC_900));Class Reference
Section titled “Class Reference”| 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") |