pub struct TypeScale {Show 30 fields
pub display_large: TextStyle,
pub display_medium: TextStyle,
pub display_small: TextStyle,
pub headline_large: TextStyle,
pub headline_medium: TextStyle,
pub headline_small: TextStyle,
pub title_large: TextStyle,
pub title_medium: TextStyle,
pub title_small: TextStyle,
pub body_large: TextStyle,
pub body_medium: TextStyle,
pub body_small: TextStyle,
pub label_large: TextStyle,
pub label_medium: TextStyle,
pub label_small: TextStyle,
pub display_large_emphasized: TextStyle,
pub display_medium_emphasized: TextStyle,
pub display_small_emphasized: TextStyle,
pub headline_large_emphasized: TextStyle,
pub headline_medium_emphasized: TextStyle,
pub headline_small_emphasized: TextStyle,
pub title_large_emphasized: TextStyle,
pub title_medium_emphasized: TextStyle,
pub title_small_emphasized: TextStyle,
pub body_large_emphasized: TextStyle,
pub body_medium_emphasized: TextStyle,
pub body_small_emphasized: TextStyle,
pub label_large_emphasized: TextStyle,
pub label_medium_emphasized: TextStyle,
pub label_small_emphasized: TextStyle,
}Expand description
The design-token vocabulary: the Theme bundle plus its
component token tables, flat-re-exported from frust-theme so app code
never names that crate directly. A root component reads the active theme via
use_context::<Theme>(); a widget reads it during paint/layout via
PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
Includes the glass material tokens — this crate ships the opaque recipe, and a design system authors its own translucent one over the same types:
use frust::GlassScale;
let glass = GlassScale::opaque_material();
assert_eq!(glass.chrome.blur_radius_intent, 0.0);
assert!(glass.control.is_opaque());Also the composable-theming surface:
ThemeBuilder (defineTheme/copyWith analog), the no-lock-in typed
extension slot (ThemeExtensions) plus its first consumer
StatusPalette/StatusColors (success/warning/info), and the motion
vocabulary (MotionDurations/EasingSet) — all flat-re-exported so an
app (or a design-system plugin) authors a theme against frust::* alone.
The 15 named type-scale presets, each a full TextStyle, plus 15
_emphasized siblings (see the module docs’ “Emphasized type scale”
section).
Build one from a base style (its family/style/color are kept;
size/weight/letter_spacing/line_height are overridden per token)
via TypeScale::neutral — the only constructor this crate carries; a
design system builds its own from its own plugin crate (see the module
docs).
Fields§
§display_large: TextStyle§display_medium: TextStyle§display_small: TextStyle§headline_large: TextStyle§headline_medium: TextStyle§headline_small: TextStyle§title_large: TextStyle§title_medium: TextStyle§title_small: TextStyle§body_large: TextStyle§body_medium: TextStyle§body_small: TextStyle§label_large: TextStyle§label_medium: TextStyle§label_small: TextStyle§display_large_emphasized: TextStyle§display_medium_emphasized: TextStyle§display_small_emphasized: TextStyle§headline_large_emphasized: TextStyle§headline_medium_emphasized: TextStyle§headline_small_emphasized: TextStyle§title_large_emphasized: TextStyle§title_medium_emphasized: TextStyle§title_small_emphasized: TextStyle§body_large_emphasized: TextStyle§body_medium_emphasized: TextStyle§body_small_emphasized: TextStyle§label_large_emphasized: TextStyle§label_medium_emphasized: TextStyle§label_small_emphasized: TextStyleImplementations§
Source§impl TypeScale
impl TypeScale
Sourcepub fn neutral(base: &TextStyle) -> TypeScale
pub fn neutral(base: &TextStyle) -> TypeScale
Builds the neutral, design-language-free type scale from base (its
style/color are preserved).
Reuses the same numeric size/weight/tracking/line-height progression
frust-material’s M3-sourced type scale carries (see the module
docs) — a type scale isn’t a branded artifact the way a named font
face is, so there’s no design-language-specific value here to
invent (see crate::theme::Theme::neutral’s module docs). The one
thing this constructor overrides is family: every slot forces a
generic sans-serif stack via FontFamily::stack_with_generic (no
named font at all, ending in GenericSlot::SansSerif) rather than
inheriting whatever base supplies — no bundled font bytes are
referenced, so this compiles and behaves identically whether or not
the glyph-fonts feature is enabled.
Trait Implementations§
impl StructuralPartialEq for TypeScale
Auto Trait Implementations§
impl Freeze for TypeScale
impl RefUnwindSafe for TypeScale
impl Send for TypeScale
impl Sync for TypeScale
impl Unpin for TypeScale
impl UnsafeUnpin for TypeScale
impl UnwindSafe for TypeScale
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.