pub struct TextTheme {Show 15 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,
}Expand description
The named typographic scale (Material 3’s 15 steps). Widgets pick a step
(theme.text.title_medium), never a hardcoded size — changing the scale
retypesets the whole app. The colors stay inherited (None → resolved against
the theme at paint time).
Fields§
§display_large: TextStyleThe largest step of the display group: short, prominent text such as a hero figure.
display_medium: TextStyleThe middle step of the display group: short, prominent text such as a hero figure.
display_small: TextStyleThe smallest step of the display group: short, prominent text such as a hero figure.
headline_large: TextStyleThe largest step of the headline group: the heading of a screen or of a large section.
headline_medium: TextStyleThe middle step of the headline group: the heading of a screen or of a large section.
headline_small: TextStyleThe smallest step of the headline group: the heading of a screen or of a large section.
title_large: TextStyleThe largest step of the title group: the title of a smaller piece of content: a card, a dialog, a row.
title_medium: TextStyleThe middle step of the title group: the title of a smaller piece of content: a card, a dialog, a row.
title_small: TextStyleThe smallest step of the title group: the title of a smaller piece of content: a card, a dialog, a row.
body_large: TextStyleThe largest step of the body group: running text meant to be read.
body_medium: TextStyleThe middle step of the body group: running text meant to be read.
body_small: TextStyleThe smallest step of the body group: running text meant to be read.
label_large: TextStyleThe largest step of the label group: the text on a control: a button, a tab, a caption.
label_medium: TextStyleThe middle step of the label group: the text on a control: a button, a tab, a caption.
label_small: TextStyleThe smallest step of the label group: the text on a control: a button, a tab, a caption.
Implementations§
Source§impl TextTheme
impl TextTheme
Sourcepub const M3: Self
pub const M3: Self
The reference Material 3 scale (sizes in logical pixels; the title and label steps carry a medium weight, as the spec has it).
A const, and that matters: a widget measured with no theme in hand — the
un-themed Widget::style path the transparent wrappers
take — reads its step from this rather than from a private constant of its own.
Twelve widgets used to carry their own number, and one of them had drifted two
pixels from the reference without anybody being able to see it.