Skip to main content

azul_css/
defaults.rs

1//! Aggregated default values for typed CSS properties.
2//!
3//! Typed wrappers built on top of the raw scalar defaults (e.g.
4//! [`crate::props::basic::pixel::DEFAULT_FONT_SIZE`]). These exist so
5//! consumers that need a `StyleFontSize` / `StyleTextColor` value at
6//! const-time do not have to reconstruct them locally — and do not
7//! duplicate the underlying numbers.
8
9use crate::props::{
10    basic::{color::ColorU, font::StyleFontSize, pixel::PixelValue},
11    style::StyleTextColor,
12};
13
14/// Default font size (`16px`) used when no explicit size is specified.
15///
16/// The numeric value matches [`crate::props::basic::pixel::DEFAULT_FONT_SIZE`].
17pub const DEFAULT_FONT_SIZE: StyleFontSize = StyleFontSize {
18    inner: PixelValue::const_px(16),
19};
20
21/// Default font family identifier used as a fallback.
22pub const DEFAULT_FONT_ID: &str = "serif";
23
24/// Default text color (opaque black).
25pub const DEFAULT_TEXT_COLOR: StyleTextColor = StyleTextColor {
26    inner: ColorU {
27        r: 0,
28        g: 0,
29        b: 0,
30        a: 255,
31    },
32};