1pub mod fragment;
2pub mod fragments;
3pub mod html;
4pub mod html_escaping;
5mod numbers;
6mod render;
7pub mod simple_element;
8pub mod state;
9mod text_element;
10mod dispatch;
11
12pub use dispatch::{dispatch, handle, Reducer};
13pub use self::render::Render;
14
15#[doc(hidden)]
17pub use serde_json;
18pub use fragment::Fragment;
19pub use fragments::diff_html;
20pub use simple_element::SimpleElement;
21pub use state::decode_state;
22pub use text_element::Raw;
23pub use text_element::RawOwned;
24pub use workers_rsx_impl::{component, css, html, page, rsx, view};
25pub use workers_rsx_impl::ActionJson;
26
27pub static PREFLIGHT_CSS: &str = include_str!("preflight.css");
30
31pub fn generate_tailwind_css(class_names: &[&str]) -> String {
34 let mut generator = tailwind_rs_core::CssGenerator::new();
35 for name in class_names {
36 let _ = generator.add_class(name);
37 }
38 let utility_css = generator.generate_css();
39 if utility_css.is_empty() {
40 return String::new();
41 }
42 format!("{}{}", PREFLIGHT_CSS, utility_css)
43}
44
45#[macro_export]
47macro_rules! raw {
48 ($s:expr) => {
49 ::workers_rsx::Raw::from($s)
50 };
51}