Skip to main content

azul_css/
lib.rs

1//! Provides datatypes used to describe an application's style using the Azul GUI framework.
2//!
3//! # Modules
4//!
5//! - [`css`]: Stylesheet types (rules, selectors, declarations).
6//! - [`props`]: Typed CSS property values (colors, lengths, layout properties).
7//! - [`parser2`]: CSS string parsing (feature-gated behind `"parser"`).
8//! - [`system`]: Native OS theme discovery and system colors.
9//! - [`shape`]: Text shaping and glyph layout.
10//! - [`shape_parser`]: Font and shape metric parsing.
11//! - [`dynamic_selector`]: Runtime selector matching helpers.
12//! - [`compact_cache`]: Compact caching utilities for resolved styles.
13//! - [`corety`]: Core type aliases re-exported at crate root.
14// Lint policy: deny correctness/safety issues, warn on style
15#![deny(unused_must_use)]
16#![warn(clippy::all)]
17// Allowed: macros generate PartialOrd alongside Ord, legacy numeric constants
18// in spec-derived code, into_iter naming for custom collection types
19#![allow(
20    clippy::non_canonical_partial_ord_impl,
21    clippy::legacy_numeric_constants,
22    clippy::should_implement_trait,       // into_iter on custom vecs
23    clippy::result_unit_err,              // parser returns Result<_, ()>
24    clippy::ptr_as_ptr,                   // FFI pointer casts
25    clippy::too_many_arguments,
26    unused_imports,                        // conditional compilation
27    unused_variables,
28    unused_mut,
29    unused_parens,
30    dead_code,
31    unused_doc_comments,                   // doc comments before macro invocations
32    ambiguous_glob_reexports,             // layout/style mod re-exports
33    mismatched_lifetime_syntaxes,         // macro-generated code
34    unreachable_patterns,                  // exhaustive match in generated code
35)]
36
37// #![no_std]
38
39#[macro_use]
40extern crate alloc;
41extern crate core;
42
43#[macro_use]
44/// Internal macros for reducing boilerplate in property definitions.
45pub mod macros;
46/// Multi-language code generation backends (Rust, C++, Python).
47pub mod codegen;
48/// Three-tier numeric property cache for fast style resolution.
49pub mod compact_cache;
50/// FFI-safe core type aliases (`AzString`, `AzVec`, `OptionT`, etc.).
51pub mod corety;
52/// Stylesheet types: rules, selectors, declarations, and specificity.
53pub mod css;
54/// Typed default values for CSS properties (font size, font id, text color).
55pub mod defaults;
56/// Runtime CSS selector matching (`:hover`, `@os`, `@media`, etc.).
57pub mod dynamic_selector;
58/// Const-compatible Rust source code generation from parsed CSS.
59pub mod format_rust_code;
60/// CSS string parser (tokenizer, declaration parser, shorthand expansion).
61#[cfg(feature = "parser")]
62pub mod parser2;
63/// Typed CSS property values: colors, lengths, layout, backgrounds, etc.
64pub mod props;
65/// CSS Shape data structures (`shape-inside`, `shape-outside`, `clip-path`).
66pub mod shape;
67/// Parser for CSS shape functions and font metrics.
68pub mod shape_parser;
69/// Native OS theme discovery: system colors, fonts, and DPI.
70pub mod system;
71
72pub use self::corety::*;