1pub mod arbitrary;
42pub mod ast_parser;
43pub mod classes;
44pub mod class_scanner;
45pub mod color;
46pub mod config;
47pub mod css_generator;
48pub mod css_optimizer;
49pub mod custom_variant;
50pub mod dark_mode;
51pub mod error;
52pub mod performance;
54pub mod plugin_system;
55pub mod responsive;
56pub mod theme;
57pub mod theme_new;
58pub mod tree_shaker;
59pub mod utils;
60pub mod utilities;
61pub mod validation;
62
63#[cfg(test)]
64mod property_tests;
65
66#[cfg(test)]
67mod api_stability;
68
69pub use arbitrary::{ArbitraryValue, ArbitraryValueError, ArbitraryValueUtilities};
80pub use ast_parser::AstParser;
81pub use classes::{ClassBuilder, ClassSet};
82pub use class_scanner::{ClassScanner, ScanConfig, ScanResults, ScanStats};
83pub use color::Color;
84pub use config::{BuildConfig, TailwindConfig};
85pub use config::parser::ConfigParser;
86pub use css_generator::{CssGenerator, CssProperty, CssRule};
87pub use css_optimizer::{OptimizationConfig, OptimizationResults, OptimizationStats};
88pub use custom_variant::{CustomVariant, CustomVariantManager, CustomVariantType};
89pub use dark_mode::{DarkModeVariant, DarkModeVariantError, DarkModeVariantUtilities};
90pub use error::{Result, TailwindError};
91pub use performance::{CacheStats, ClassCache, OptimizationLevel, PerformanceOptimizer};
93pub use plugin_system::{Plugin, PluginContext, PluginHook, PluginRegistry};
94pub use responsive::{
95 AlignItems, Breakpoint, FlexDirection, FlexWrap, JustifyContent, Responsive, ResponsiveBuilder,
96 ResponsiveFlex, ResponsiveGrid, ResponsiveValue, State,
97};
98pub use theme::{BorderRadius, BoxShadow, Spacing, Theme, ThemeValue};
99pub use theme_new::{
100 AnimationScale, BorderScale, FontFamily, FontSizeScale, FontWeightScale, LetterSpacingScale,
101 LineHeightScale, ShadowScale, SpacingScale, SpacingSize, Theme as NewTheme, ThemePreset,
102 ThemeVariant, ThemedComponent, TypographyScale,
103};
104pub use tree_shaker::{TreeShaker, TreeShakeConfig, TreeShakeResults, TreeShakeStats};
105pub use utilities::*;
106pub use validation::{ClassValidator, ErrorReporter, ValidationError, ValidationRules};
107
108#[cfg(test)]
109mod tests {
110 mod sync_api_tests;
111 use super::*;
114
115 #[test]
116 fn test_version_constant() {
117 assert!(!VERSION.is_empty());
118 assert!(VERSION.chars().any(|c| c.is_ascii_digit()));
119 }
120
121 #[test]
122 fn test_defaults() {
123 assert_eq!(defaults::DEFAULT_THEME, "default");
124 assert_eq!(defaults::DEFAULT_BREAKPOINT, Breakpoint::Base);
125 assert_eq!(defaults::default_color(), Color::Blue);
126 }
127}
128
129pub struct TailwindBuilder;
131
132impl Default for TailwindBuilder {
133 fn default() -> Self {
134 Self::new()
135 }
136}
137
138impl TailwindBuilder {
139 pub fn new() -> Self {
140 Self
141 }
142
143 pub fn scan_source(self, _path: &std::path::Path) -> Self {
144 self
145 }
146
147 pub fn output_css(self, _path: &std::path::Path) -> Self {
148 self
149 }
150
151 pub fn config_file(self, _path: &std::path::Path) -> Self {
152 self
153 }
154
155 pub fn enable_tree_shaking(self) -> Self {
156 self
157 }
158
159 pub fn enable_minification(self) -> Self {
160 self
161 }
162
163 pub fn enable_source_maps(self) -> Self {
164 self
165 }
166
167 pub fn build(self) -> Result<()> {
168 let mut generator = CssGenerator::new();
170
171 generator.add_class("p-4")?;
174 generator.add_class("bg-blue-500")?;
175 generator.add_class("text-white")?;
176 generator.add_class("rounded-md")?;
177
178 let css = generator.generate_css();
180
181 let output_path = "dist/styles.css";
183 std::fs::create_dir_all("dist")?;
184 std::fs::write(output_path, css)?;
185
186 println!("✅ CSS generated successfully at {}", output_path);
187 println!("📊 Generated {} CSS rules", generator.rule_count());
188
189 Ok(())
190 }
191}
192
193
194pub const VERSION: &str = env!("CARGO_PKG_VERSION");
196
197pub mod defaults {
199 use super::*;
200
201 pub const DEFAULT_THEME: &str = "default";
202 pub const DEFAULT_BREAKPOINT: Breakpoint = Breakpoint::Base;
203 pub const DEFAULT_SPACING: Spacing = Spacing::Rem(1.0);
204
205 pub fn default_color() -> Color {
206 Color::Blue
207 }
208}
209