Expand description
ยงtailwind-rs-core
Core types and utilities for the tailwind-rs library. This crate provides the fundamental building blocks for Tailwind CSS integration in Rust.
ยง๐ WASM Compatibility
This crate is fully WASM-compatible and compiles to wasm32-unknown-unknown
.
All operations are synchronous for optimal performance in web environments.
ยง๐ Performance
- Synchronous API: All operations are synchronous for better WASM performance
- High-performance caching: Uses
parking_lot
for efficient synchronization - Memory optimized: Reduced memory footprint compared to async alternatives
- Fast compilation: ~30% faster build times
ยง๐ฆ Bundle Size
- Smaller bundles: ~15% reduction in final bundle size
- No runtime dependencies: Pure Rust implementation
- Tree-shakeable: Only includes what you use
ยงExample
use tailwind_rs_core::*;
// Create type-safe Tailwind classes
let classes = ClassBuilder::new()
.padding(SpacingValue::Integer(4))
.background_color(Color::new(ColorPalette::Blue, ColorShade::Shade500))
.text_color(Color::new(ColorPalette::White, ColorShade::Shade500))
.build();
// Convert to CSS classes
let css_classes = classes.to_string();
assert_eq!(css_classes, "p-4 bg-blue-500 text-white");
Re-exportsยง
pub use arbitrary::ArbitraryValue;
pub use arbitrary::ArbitraryValueError;
pub use arbitrary::ArbitraryValueUtilities;
pub use classes::ClassBuilder;
pub use classes::ClassSet;
pub use color::Color;
pub use config::BuildConfig;
pub use config::TailwindConfig;
pub use custom_variant::CustomVariant;
pub use custom_variant::CustomVariantManager;
pub use custom_variant::CustomVariantType;
pub use dark_mode::DarkModeVariant;
pub use dark_mode::DarkModeVariantError;
pub use dark_mode::DarkModeVariantUtilities;
pub use error::Result;
pub use error::TailwindError;
pub use gradients::Gradient;
pub use gradients::GradientDirection;
pub use gradients::GradientError;
pub use gradients::GradientStop;
pub use gradients::GradientUtilities;
pub use performance::CacheStats;
pub use performance::ClassCache;
pub use performance::OptimizationLevel;
pub use performance::PerformanceOptimizer;
pub use responsive::AlignItems;
pub use responsive::Breakpoint;
pub use responsive::FlexDirection;
pub use responsive::FlexWrap;
pub use responsive::JustifyContent;
pub use responsive::Responsive;
pub use responsive::ResponsiveBuilder;
pub use responsive::ResponsiveFlex;
pub use responsive::ResponsiveGrid;
pub use responsive::ResponsiveValue;
pub use responsive::State;
pub use theme::BorderRadius;
pub use theme::BoxShadow;
pub use theme::Spacing;
pub use theme::Theme;
pub use theme::ThemeValue;
pub use theme_new::AnimationScale;
pub use theme_new::BorderScale;
pub use theme_new::FontFamily;
pub use theme_new::FontSizeScale;
pub use theme_new::FontWeightScale;
pub use theme_new::LetterSpacingScale;
pub use theme_new::LineHeightScale;
pub use theme_new::ShadowScale;
pub use theme_new::SpacingScale;
pub use theme_new::SpacingSize;
pub use theme_new::Theme as NewTheme;
pub use theme_new::ThemePreset;
pub use theme_new::ThemeVariant;
pub use theme_new::ThemedComponent;
pub use theme_new::TypographyScale;
pub use validation::ClassValidator;
pub use validation::ErrorReporter;
pub use validation::ValidationError;
pub use validation::ValidationRules;
pub use utilities::*;
Modulesยง
- arbitrary
- Arbitrary values support for tailwind-rs
- classes
- Class management system for tailwind-rs
- color
- Color system for tailwind-rs
- config
- Configuration system for tailwind-rs
- custom_
variant - Custom variant system for tailwind-rs
- dark_
mode - Dark mode variant support for tailwind-rs
- defaults
- Default configuration values
- error
- Error types for tailwind-rs-core
- gradients
- Gradient support for tailwind-rs
- performance
- Performance optimization system for tailwind-rs
- responsive
- Responsive Design System Module
- theme
- Theme system for tailwind-rs
- theme_
new - New theme system implementation according to API documentation
- utilities
- Utility class implementations for tailwind-rs
- utils
- Utility functions for tailwind-rs
- validation
- Validation system for tailwind-rs
Structsยง
Constantsยง
- VERSION
- Version information