mew_css/lib.rs
1//! # Mew CSS Style Builder
2//!
3//! A fluent, chainable API for building CSS styles with strong typing in Rust.
4//!
5//! This library provides a type-safe way to generate CSS with comprehensive validation,
6//! no external dependencies, and an extensible design following SOLID principles.
7//!
8//! ## Core Features
9//!
10//! - **Type Safety**: All CSS properties and values are strongly typed, preventing invalid CSS
11//! - **Fluent API**: Chain method calls for a clean, declarative style
12//! - **No Dependencies**: Zero external dependencies for a lightweight footprint
13//! - **Comprehensive**: Supports a wide range of CSS properties and values
14//! - **CSS Variables**: First-class support for CSS custom properties
15//!
16//! ## Basic Usage
17//!
18//! ```rust
19//! use mew_css::style;
20//! use mew_css::values::{Color, Size, Display};
21//!
22//! let css = style()
23//!     .color(Color::White)
24//!     .background_color(Color::Rgba(255, 0, 0, 0.5))
25//!     .font_size(Size::Px(16))
26//!     .display(Display::Flex)
27//!     .apply();
28//!
29//! // Produces: "color: white; background-color: rgba(255, 0, 0, 0.5); font-size: 16px; display: flex;"
30//! ```
31//!
32//! ## CSS Variables
33//!
34//! ```rust
35//! use mew_css::{style, var};
36//! use mew_css::values::Color;
37//!
38//! // Define a CSS variable
39//! let primary_color = var("primary-color");
40//!
41//! // Use the variable in a style
42//! let css = style()
43//!     .color(primary_color.into())
44//!     .apply();
45//!
46//! // Produces: "color: var(--primary-color);"
47//! ```
48//!
49//! ## Module Organization
50//!
51//! - `style`: Core style builder implementation with fluent API
52//! - `values`: CSS value types (Color, Size, Display, etc.)
53//! - `properties`: CSS property definitions
54//! - `variable`: CSS variables support
55
56// Make modules public
57pub mod style;
58pub mod values;
59pub mod properties;
60pub mod variable;
61
62// Include integration tests
63#[cfg(test)]
64mod tests;
65
66// Re-export the main API entry point
67pub use style::style;
68pub use variable::{CssVar, var};