Function dp
pub fn dp(base: f32, role: TargetRole, tokens: &InputTokens) -> f32Expand description
Raise one dimension to the floor its [TargetRole] demands.
- [
TargetRole::Target] — at leasttokens.target_size, which is itself never belowtokens.min_target_conformance(24 dp, WCAG 2.2 SC 2.5.8 AA). - [
TargetRole::Grab] — at leasttokens.grab_size. - [
TargetRole::Decoration] — returned unchanged; a rule or an icon is not a target and must not grow.
The function only ever raises: a control that is already generous keeps its
own size. A negative or non-finite base is returned as-is for a
Decoration, and clamped up to the floor for the two interactive roles.