Hover, Focus & States
ISS implements Tailwind CSS v4’s full selector engine in Iced: interactive states, named group and peer combinators, structural child selectors, rendered pseudo-elements, ARIA/data attributes, RTL flipping, and media preferences.
Interactive & Form States
Section titled “Interactive & Form States”Stack variants in any order (for example dark:hover:bg-zinc-800 or disabled:opacity-50). Supported states include hover:, focus:, focus-visible:, focus-within:, active:, disabled:, enabled:, checked:, indeterminate:, required:, valid:, invalid:, in-range:, out-of-range:, placeholder-shown:, autofill:, read-only:, open:, inert:, visited:, and target:.
group, peer, and Relational Selectors
Section titled “group, peer, and Relational Selectors”Mark an ancestor with group (or isolated group/card) and style descendants with group-hover:* or group-hover/card:*. Mark a preceding sibling with peer to drive peer-checked:* or peer-invalid:* styles. ISS also supports has-*, not-*, and in-*.
use iced::widget::text;use iss::{col_tw, tw, TwExt};
let card = col_tw( [ text("Project Alpha").tw(tw!( "text-sm font-semibold text-zinc-100 group-hover/card:text-violet-300" )), text("Hover the card to highlight this label").tw(tw!( "text-xs text-zinc-400 group-hover/card:text-zinc-200" )), ], tw!("group/card p-4 bg-zinc-900 hover:bg-zinc-800/80 border border-zinc-800 rounded-xl gap-1"),);use iced::widget::text;use iss::typed::*;
let title_style = IssStyle::new() .text_sm() .font_semibold() .text_color(palette::ZINC_100) .group_hover_named("card", |s| s.text_color(palette::VIOLET_300));
let card_style = IssStyle::new() .group_named("card") .p(4) .bg(palette::ZINC_900) .hover(|s| s.bg(palette::ZINC_800.alpha(0.8))) .border() .border_color(palette::ZINC_800) .rounded_xl() .gap(1);
let card = col_tw([text("Project Alpha").tw(title_style)], card_style);Structural Selectors & Rendered Pseudo-Elements
Section titled “Structural Selectors & Rendered Pseudo-Elements”Inside row_tw, col_tw, flex_tw, grid_tw, and list_tw, ISS evaluates first:, last:, only:, odd:, even:, nth-*, empty:, direct-child *:*, and descendant **:*. Pseudo-element prefixes (before:, after:, placeholder:, marker:, first-line:, and first-letter:) render directly alongside your widget.
use iced::widget::{container, text};use iss::{tw, TwExt};
let callout = container(text("Verified build").tw(tw!("text-sm text-zinc-100"))) .tw(tw!( "relative pl-4 py-2 pr-3 bg-zinc-900 rounded-lg overflow-hidden before:absolute before:inset-y-0 before:left-0 before:w-1 before:bg-violet-500" ));ARIA, Data Attributes, RTL & Media Preferences
Section titled “ARIA, Data Attributes, RTL & Media Preferences”| Category | Supported Prefixes | Runtime Source |
|---|---|---|
| ARIA attributes | aria-expanded:, aria-selected:, aria-checked:, aria-[sort=ascending]: |
IssNodeState::with_aria / SelectorEvalContext |
| Data attributes | data-active:, data-[state=open]:, group-data-[...]:, peer-data-[...]: |
IssNodeState::with_data |
| Directionality | rtl:, ltr: + automatic W3C logical flipping (ps/pe, ms/me, rounded-s/e, border-s/e) |
dir_rtl(...), dir_ltr(...), or IssViewport::rtl() |
| Media preferences | motion-safe:, motion-reduce:, contrast-more:, contrast-less:, forced-colors:, portrait:, landscape: |
IssViewport::with_reduced_motion / with_contrast |