Skip to main content

Module ext

Module ext 

Source
Expand description

Numeric-literal extension traits and free constructors.

These keep call sites concise:

use whisker_css::ext::*;

let _ = px(12);
let _ = 12.px();
let _ = 0.5.rem();
let _ = 100.percent();

Constants§

ZERO
The unit-less zero — the only length CSS allows without a unit.

Traits§

AngleExt
Method-style angle constructors.
IntoF32
Internal: anything that can be widened to f32 for value construction.
LengthExt
Method-style length constructors for primitive numbers.
PercentExt
Method-style percentage constructor.
TimeExt
Method-style time constructors.

Functions§

deg
Construct an Angle::Deg.
em
Construct a Length::Em.
ms
Construct a Time::Ms (milliseconds).
percent
Construct a Percentage from n (so percent(50) == 50%).
ppx
Construct a Length::Ppx (physical pixel).
px
Construct a Length::Px (logical pixels).
rad
Construct an Angle::Rad.
rem
Construct a Length::Rem.
rpx
Construct a Length::Rpx (Lynx responsive pixel; 750rpx = device width).
s
Construct a Time::S (seconds).
turn
Construct an Angle::Turn.
vh
Construct a Length::Vh.
vw
Construct a Length::Vw.