pub struct DesignTokens {
pub spacing: [f32; 7],
pub radius: [f32; 6],
pub elevation: [f32; 6],
pub opacity: [f32; 5],
}Expand description
The full set of design tokens for a theme.
Arrays are indexed by their corresponding step enum’s discriminant order.
Fields§
§spacing: [f32; 7]Spacing scale in logical pixels (7 steps, Xs..Xxxl).
radius: [f32; 6]Border-radius scale in logical pixels (6 steps, None..Full).
elevation: [f32; 6]Elevation blur radii in logical pixels (6 levels, 0..=5).
opacity: [f32; 5]Opacity levels in [0, 1] (5 steps: disabled..opaque).
Implementations§
Source§impl DesignTokens
impl DesignTokens
Sourcepub fn spacing(&self, step: SpacingStep) -> f32
pub fn spacing(&self, step: SpacingStep) -> f32
Spacing value (logical px) for a named step.
Sourcepub fn radius(&self, step: RadiusStep) -> f32
pub fn radius(&self, step: RadiusStep) -> f32
Border-radius value (logical px) for a named step.
Trait Implementations§
Source§impl Clone for DesignTokens
impl Clone for DesignTokens
Source§fn clone(&self) -> DesignTokens
fn clone(&self) -> DesignTokens
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DesignTokens
impl Debug for DesignTokens
Source§impl Decode for DesignTokens
impl Decode for DesignTokens
Source§impl Default for DesignTokens
impl Default for DesignTokens
Source§impl Encode for DesignTokens
impl Encode for DesignTokens
Source§impl PartialEq for DesignTokens
impl PartialEq for DesignTokens
impl StructuralPartialEq for DesignTokens
Auto Trait Implementations§
impl Freeze for DesignTokens
impl RefUnwindSafe for DesignTokens
impl Send for DesignTokens
impl Sync for DesignTokens
impl Unpin for DesignTokens
impl UnsafeUnpin for DesignTokens
impl UnwindSafe for DesignTokens
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more