Use this file to discover all available pages before exploring further.
Kael’s styling system is modeled after Tailwind CSS but expressed as Rust method chains. Every element that implements the Styled trait gains a full set of utility methods for layout, spacing, color, typography, and more. Under the hood, Kael uses Taffy — a Rust implementation of the web layout standard — to compute positions and sizes, then submits draw calls directly to the GPU. The result is native-performance layout with a familiar, expressive API.
The Styled trait is the entry point for all styling in Kael. Any element that calls self.style() to expose a mutable StyleRefinement automatically inherits every method in the trait:
pub trait Styled: Sized { fn style(&mut self) -> &mut StyleRefinement; // All layout, color, and typography helpers are defined here.}
All built-in elements — div(), img(), svg(), canvas() — implement Styled. Your own components get the same methods automatically when they delegate to an inner Styled element.
Colors in Kael use the Hsla type (hue, saturation, lightness, alpha), which maps directly to GPU color values. The bg() method accepts anything that converts into a Fill:
use kael::Hsla;div().bg(Hsla { h: 0.6, // hue: 0.0–1.0 s: 0.8, l: 0.5, a: 1.0,})div().bg(gpui::blue()) // named color helpers from kael::colorsdiv().text_color(Hsla { h: 0.0, s: 0.0, l: 0.2, a: 1.0 })
Kael automatically animates certain style properties when they change between frames, without any additional code. The properties that transition implicitly are:
opacity
background (when colors are interpolatable)
border_color
rotate
scale
The default transition duration is 150ms. This means hover states, selection highlights, and loading indicators gain smooth visual feedback for free.
To animate other properties explicitly, use the animation module and the keyframe builder API. Implicit transitions are only applied to the properties listed above.