pub enum Emphasis {
Full,
Secondary,
Muted,
}Expand description
How far a tonal step sits from the token it is a step of.
The named ratios. tonal is the same operation with the number written
out, and this is the small set of steps the vocabulary has agreed on, so a
consumer asking for “the muted form of this” names it rather than picking a
number and disagreeing with the next consumer to pick one.
The rule these encode, stated as the three-tone convention:
Variants§
Full
The token unchanged.
Secondary
One step back. Still legible as content, not competing with Full.
Muted
Two steps back. Present, and saying it is not the point.
Implementations§
Source§impl Emphasis
impl Emphasis
Sourcepub const fn ratio(self) -> f32
pub const fn ratio(self) -> f32
The fraction of the way to the ground this step travels.
Both numbers are the shipped corpus’ own, not invented: across the 31
bundled themes, hand-authored content.secondary sat at a median 0.115
of the way from content.primary to surface.page, and content.muted
at 0.424. So the derivation reproduces what theme authors converged on
by eye, and the themes that move are the ones that were off the cluster.
Sourcepub const fn suffix(self) -> Option<&'static str>
pub const fn suffix(self) -> Option<&'static str>
The suffix a derived token takes, or None for the token itself.
content + Muted is content-muted, which is the
naming every consumer already spells by hand. Grouping a family this way
is what makes danger-muted or action-secondary nameable without a
second table saying what they mean.