Skip to content

Troubleshooting & Compiler Errors

Because tw!() validates every utility class during compilation, most styling bugs show up immediately in cargo check instead of at runtime.

1. Mistyped Classes & did you mean Suggestions

Section titled “1. Mistyped Classes & did you mean Suggestions”

When you mistype a utility name, color family, shade, or variant prefix inside tw!("..."), the compiler stops on that exact token and prints the closest valid match:

let bad = tw!("p-4 bg-blu-500"); // compile_fail: typo in color family
error: tw! error: unknown Tailwind class 'bg-blu-500' (did you mean 'bg-blue-500'?)

Variant prefix typos and invalid shades produce targeted hints as well:

error: tw! error: unknown Tailwind class 'hovr:bg-zinc-800' (did you mean 'hover:bg-zinc-800'?)
error: tw! error: unknown Tailwind class 'bg-violet-550' (hint: valid Tailwind color shades are 50, 100..900, 950)

Note that tw!() expects a single string literal (tw!("p-4 bg-zinc-900")). If you want to split a long style across variables or compose conditional classes, use .mix().

ISS targets Tailwind CSS v4. Several v3 utility names were renamed or replaced in v4:

Tailwind v3 Tailwind v4 (Use in ISS) What ISS Does
bg-opacity-50 / text-opacity-75 bg-violet-500/50 / text-white/75 Compile error with /alpha migration hint
flex-shrink-0 / flex-shrink shrink-0 / shrink Compile error suggesting shrink-0 / shrink
flex-grow-0 / flex-grow grow-0 / grow Compile error suggesting grow-0 / grow
overflow-ellipsis text-ellipsis Compile error suggesting text-ellipsis
bg-gradient-to-r bg-linear-to-r Prefer bg-linear-to-* in v4 (v3 alias also parses)
shadow / rounded shadow-sm / rounded-sm Prefer explicit v4 size suffixes (shadow-sm, rounded-sm)

Child headers or buttons poke past rounded-* corners

Section titled “Child headers or buttons poke past rounded-* corners”

If a card has rounded-2xl and its first child is a flush top bar or full-bleed image, add overflow-hidden to the rounded parent container so ISS clips child corners strictly to the parent’s rounded arc:

use iced::widget::{button, container, text};
use iss::{col_tw, tw, TwExt};
let card = container(col_tw(
[
button(text("Header").tw(tw!("text-sm text-white")))
.on_press(Message::HeaderClick)
.tw(tw!("w-full px-4 py-3 bg-zinc-800 hover:bg-zinc-700")),
container(text("Body").tw(tw!("text-sm text-zinc-300"))).tw(tw!("p-4")),
],
tw!("w-full"),
))
.tw(tw!("w-[340px] rounded-2xl overflow-hidden bg-zinc-900 border border-zinc-800"));

backdrop-blur-*, blur-*, or mask-* has no visible effect

Section titled “backdrop-blur-*, blur-*, or mask-* has no visible effect”

Check two things:

  1. Cargo features: Keep the default tiny-skia feature enabled in Cargo.toml (iss = "0.2"). If you set default-features = false, features = ["wgpu"], software blur/mask effects fall back gracefully to solid fills.
  2. Translucent background + isolate: backdrop-blur-xl blurs content behind the card. Make sure the parent stage has isolate (e.g. stack_tw(..., tw!("isolate ..."))) and the glass card uses a translucent background like bg-[#120f1d]/65 instead of an opaque bg-zinc-900.

dark:* or (--token) classes do not update at runtime

Section titled “dark:* or (--token) classes do not update at runtime”
  • For dark mode, either resolve styles with vp.tw(...) where let vp = IssViewport::with_theme(width, is_dark); or wrap your root tree in theme_scope(is_dark, content) / dark_scope(content) / light_scope(content).
  • For theme variables (bg-(--color-brand)), wrap your view in theme_provider(Arc::clone(&self.theme), content) so descendants read the active IssTheme live on every render.