procss/transformers/mod.rs
1// ┌───────────────────────────────────────────────────────────────────────────┐
2// │ │
3// │ ██████╗ ██████╗ ██████╗ Copyright (C) 2022, The Prospective Company │
4// │ ██╔══██╗██╔══██╗██╔═══██╗ │
5// │ ██████╔╝██████╔╝██║ ██║ This file is part of the Procss library, │
6// │ ██╔═══╝ ██╔══██╗██║ ██║ distributed under the terms of the │
7// │ ██║ ██║ ██║╚██████╔╝ Apache License 2.0. The full license can │
8// │ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ be found in the LICENSE file. │
9// │ │
10// └───────────────────────────────────────────────────────────────────────────┘
11
12//! A collection of transformer functions, utilizing the
13//! [`crate::ast::Css::transform`] and [`crate::ast::Tree::transform`] methods
14//! to apply various useful transformations on their respective structs. The
15//! exports from [`crate::transformers`] are functions which take a `&mut` to
16//! either [`crate::ast::Css`] or [`crate::ast::Tree`].
17//!
18//! # Example
19//!
20//! ```rust
21//! use procss::transformers::apply_mixin;
22//! use procss::{parse, RenderCss};
23//!
24//! let mut tree = parse("div{color:red}").unwrap();
25//! apply_mixin(&mut tree);
26//! let css = tree.flatten_tree().as_css_string();
27//! ```
28
29mod apply_import;
30mod apply_mixin;
31mod apply_var;
32mod deduplicate;
33mod filter_refs;
34mod flat_self;
35mod inline_url;
36mod merge_siblings;
37mod remove_mixin;
38mod remove_var;
39
40pub use self::apply_import::apply_import;
41pub use self::apply_mixin::apply_mixin;
42pub use self::apply_var::apply_var;
43pub use self::deduplicate::deduplicate;
44pub use self::filter_refs::filter_refs;
45pub(crate) use self::flat_self::flat_self;
46pub use self::inline_url::inline_url;
47pub use self::merge_siblings::merge_siblings;
48pub use self::remove_mixin::remove_mixin;
49pub use self::remove_var::remove_var;