Skip to main content

cssbox_dom/
lib.rs

1//! `cssbox-dom` — HTML/CSS parsing and style resolution for cssbox.
2//!
3//! This crate provides the bridge between HTML/CSS input and the `cssbox-core`
4//! layout engine. It parses HTML documents, resolves CSS styles through the
5//! cascade, and builds the box tree that the layout engine requires.
6//!
7//! # Usage
8//!
9//! ```rust
10//! use cssbox_dom::computed::html_to_box_tree;
11//! use cssbox_core::geometry::Size;
12//! use cssbox_core::layout::{compute_layout, FixedWidthTextMeasure};
13//!
14//! let html = r#"<div style="width: 200px; height: 100px"></div>"#;
15//! let tree = html_to_box_tree(html);
16//! let result = compute_layout(&tree, &FixedWidthTextMeasure, Size::new(800.0, 600.0));
17//! ```
18
19pub mod cascade;
20pub mod computed;
21pub mod css;
22pub mod dom;
23pub mod html;