Expand description
§use-spacing
Spacing scale and box-edge primitives for RustUse UI.
§Purpose
use-spacing models named spacing steps, numeric scale values, insets, outsets, gaps, padding, and margin metadata. It does not generate CSS or perform renderer-specific layout.
§Example
use use_spacing::{Gap, SpacingScale, SpacingStep, SpacingValue};
let scale = SpacingScale::new(4);
let medium = SpacingValue::from_step(SpacingStep::Md);
let gap = Gap::new(medium);
assert_eq!(medium.units(), 3);
assert_eq!(scale.resolve(gap.value()), 12);§Main types
SpacingScaleSpacingStepSpacingValueInsetOutsetGapPaddingMargin
§Facade relationship
The use-ui facade exposes this crate as use_ui::spacing when the spacing or full feature is enabled.
Structs§
- Gap
- Gap between repeated items.
- Inset
- Inner edge spacing.
- Margin
- Margin metadata.
- Outset
- Outer edge spacing.
- Padding
- Padding metadata.
- Spacing
Scale - A numeric spacing scale.
- Spacing
Value - A spacing value stored as scale units.
Enums§
- Spacing
Step - A named or numeric spacing step.