css_minify/
lib.rs

1//! CSS minification library based on `nom`
2//! This library parses css input, minifies it and applies some level-dependent optimizations to it.
3//!
4//! ```rust
5//! use css_minify::optimizations::{Minifier, Level};
6//! assert_eq!(
7//!     Minifier::default().minify(
8//!         r#"
9//!              #some_id, input {
10//!                  padding: 5px 3px; /* Mega comment */
11//!                  color: white;
12//!              }
13//!              
14//!              
15//!              /* this is are test id */
16//!              #some_id_2, .class {
17//!                  padding: 5px 4px; /* Mega comment */
18//!                  Color: rgb(255, 255, 255);
19//!              }
20//!          "#,
21//!          Level::Three
22//!     ),
23//!     Ok("#some_id,input{padding:5px 3px;color:white}#some_id_2,.class{padding:5px 4px;color:#fff}".into())
24//! )
25//! ```
26
27pub mod optimizations;
28pub(crate) mod parsers;
29pub(crate) mod structure;