Skip to content

module

style

Tailwind CSS for rendered trees (server-side rendering / prerendering). In the browser, weft-web generates the same CSS just in time.

Functions

collect_classes

pub fn collect_classes(roots: &[VNode]) -> Vec<String>

Every distinct class attribute value in document order.

tailwind_css

pub fn tailwind_css(roots: &[VNode], theme: &Theme) -> String

The complete stylesheet (preflight + utilities) for a rendered tree.

tailwind_css_with

pub fn tailwind_css_with(roots: &[VNode], extra: &str, theme: &Theme) -> String

tailwind_css plus extra classes from outside the tree (the page's <body>).