use-spacing 0.1.0

Spacing scale and box-edge primitives for RustUse UI
Documentation
  • Coverage
  • 21.95%
    9 out of 41 items documented1 out of 25 items with examples
  • Size
  • Source code size: 7.5 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 797.26 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-ui
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

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

  • SpacingScale
  • SpacingStep
  • SpacingValue
  • Inset
  • Outset
  • Gap
  • Padding
  • Margin

Facade relationship

The use-ui facade exposes this crate as use_ui::spacing when the spacing or full feature is enabled.