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 Default for DesignTokens
impl Default for DesignTokens
Source§impl PartialEq for DesignTokens
impl PartialEq for DesignTokens
Source§fn eq(&self, other: &DesignTokens) -> bool
fn eq(&self, other: &DesignTokens) -> bool
Tests for
self and other values to be equal, and is used by ==.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