Files
leptos-shadcn-ui/packages/tailwind-rs-core/src/lib.rs
Peter Hanssens 7a36292cf9 🚀 Release v0.1.0: WASM-compatible components with tailwind-rs-core v0.4.0
- Fixed compilation errors in menubar, combobox, and drawer packages
- Updated to tailwind-rs-core v0.4.0 and tailwind-rs-wasm v0.4.0 for WASM compatibility
- Cleaned up unused variable warnings across packages
- Updated release documentation with WASM integration details
- Demo working with dynamic color API and Tailwind CSS generation
- All 25+ core components ready for crates.io publication

Key features:
 WASM compatibility (no more tokio/mio dependencies)
 Dynamic Tailwind CSS class generation
 Type-safe color utilities
 Production-ready component library
2025-09-16 08:36:13 +10:00

84 lines
2.4 KiB
Rust

//! # tailwind-rs-core
//!
//! Type-safe Tailwind CSS class generation for Rust web frameworks.
//!
//! This crate provides compile-time validation and type-safe generation of Tailwind CSS classes,
//! with support for dynamic styling, responsive design, and theme systems.
//!
//! ## Features
//!
//! - 🛡️ **Type Safety**: Compile-time validation of Tailwind classes
//! - ⚡ **Performance**: Optimized class generation and merging
//! - 🎨 **Dynamic Styling**: Runtime class generation with type safety
//! - 📱 **Responsive**: Type-safe responsive design utilities
//! - 🎭 **Theming**: Built-in theme and variant system
//! - 🔧 **Framework Agnostic**: Works with any Rust web framework
//!
//! ## Quick Start
//!
//! ```rust
//! use tailwind_rs_core::*;
//!
//! // Type-safe class generation
//! let classes = classes! {
//! base: "px-4 py-2 rounded-md font-medium",
//! variant: "bg-blue-600 text-white hover:bg-blue-700",
//! responsive: "sm:text-sm md:text-base lg:text-lg",
//! };
//!
//! // Dynamic styling with type safety
//! let color = Color::Blue;
//! let dynamic_classes = classes! {
//! background: color.background(600),
//! text: color.text(),
//! hover: color.hover(700),
//! };
//! ```
//!
//! ## Integration with Leptos
//!
//! ```rust
//! use leptos::*;
//! use tailwind_rs_core::*;
//!
//! #[component]
//! pub fn Button(variant: ButtonVariant) -> impl IntoView {
//! let classes = classes! {
//! base: "px-4 py-2 rounded-md font-medium transition-colors",
//! variant: match variant {
//! ButtonVariant::Primary => "bg-blue-600 text-white hover:bg-blue-700",
//! ButtonVariant::Secondary => "bg-gray-200 text-gray-900 hover:bg-gray-300",
//! },
//! };
//!
//! view! { <button class=classes>"Click me"</button> }
//! }
//! ```
pub mod classes;
pub mod colors;
pub mod responsive;
pub mod themes;
pub mod validation;
// Re-export main types and macros
pub use classes::*;
pub use colors::*;
pub use responsive::*;
pub use themes::*;
pub use validation::*;
// Re-export specific items to avoid conflicts
pub use colors::utils as color_utils;
pub use responsive::utils as responsive_utils;
// Re-export macros (when available)
// #[cfg(feature = "macros")]
// pub use tailwind_rs_core_macros::*;
#[cfg(feature = "leptos")]
pub mod leptos_integration;
#[cfg(feature = "leptos")]
pub use leptos_integration::*;