#css #style #web

dwind

Style your DOMINATOR applications using a tailwind-like syntax and utility class collection!

2 unstable releases

0.2.0 Dec 19, 2024
0.1.0 Dec 2, 2024

#509 in WebAssembly

Download history 151/week @ 2024-12-01 26/week @ 2024-12-08 153/week @ 2024-12-15 5/week @ 2024-12-22 20/week @ 2025-01-05

179 downloads per month
Used in dwui

MIT license

190KB
2.5K SLoC

Rust 1.5K SLoC // 0.0% comments TypeScript 787 SLoC // 0.1% comments

DWIND

This crate provides tailwind-like syntax and utility classes to be used from your DOMINATOR web applications!

It allows you to apply classes using pseudo selectors and signals, removing the indirection of CSS files for understanding how compoents look. Component libraries do not need to bundle some out-of-band CSS definitions, as everything is compiled into your rust binary.

As an added benefit, tree shaking is done by the normal rust dead code elimination, removing the need for extra tooling.

For online examples, check out the example app here: https://jedimemo.github.io/dwind/examples/

Usage

fn hello() {
    html!("div", {
        .dwclass!("hover:font-extrabold")
        .dwclass_signal!("text-l", always(true))
        .text("Hello, world!")
        
        // Make the children stylish!
        .dwclas!("[& > *]:text-picton-blue-500")
        .children([
            text("Bob"),
            text("Alice"),
        ])
    })
}

Dependencies

~14MB
~258K SLoC