pub enum TextVariant {
Show 15 variants
H1,
H2,
H3,
H4,
H5,
H6,
BodyLarge,
Body,
BodySmall,
Caption,
Label,
LabelSmall,
Code,
CodeSmall,
Custom,
}Expand description
Text variants for semantic typography
Variants§
H1
Extra large heading (32px, bold)
H2
Large heading (28px, semibold)
H3
Medium heading (24px, semibold)
H4
Small heading (20px, semibold)
H5
Extra small heading (18px, medium)
H6
Tiny heading (16px, medium)
BodyLarge
Body text - large (16px, regular)
Body
Body text - default (14px, regular)
BodySmall
Body text - small (13px, regular)
Caption
Caption text (12px, regular)
Label
Label text (14px, medium)
LabelSmall
Label text - small (12px, medium)
Code
Code/monospace text (14px, mono font)
CodeSmall
Code/monospace - small (12px, mono font)
Custom
Custom - use size(), weight(), etc. for full control
Implementations§
Source§impl TextVariant
impl TextVariant
Sourcepub fn weight(&self) -> FontWeight
pub fn weight(&self) -> FontWeight
Get the font weight for this variant
Sourcepub fn line_height(&self) -> f32
pub fn line_height(&self) -> f32
Get line height multiplier for this variant
Trait Implementations§
Source§impl Clone for TextVariant
impl Clone for TextVariant
impl Copy for TextVariant
Source§impl Debug for TextVariant
impl Debug for TextVariant
impl Eq for TextVariant
Source§impl PartialEq for TextVariant
impl PartialEq for TextVariant
impl StructuralPartialEq for TextVariant
Auto Trait Implementations§
impl Freeze for TextVariant
impl RefUnwindSafe for TextVariant
impl Send for TextVariant
impl Sync for TextVariant
impl Unpin for TextVariant
impl UnsafeUnpin for TextVariant
impl UnwindSafe for TextVariant
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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