pub enum LineSpacing {
OneFifteen,
OneHalf,
Double,
}Expand description
How far apart a block’s lines are set, as a multiple of the theme’s own line height — the spacing menu every word processor has, less the single spacing that is absence.
The tokens are the numbers rather than names (loose, double) so that a
stylesheet’s line is line-height: 1.5 and a reader of the source sees the
ratio. 1 is not a token, because 1 is absence and a document should not
carry a key that says nothing.
Variants§
OneFifteen
1.15 — the word processor’s default “a little more air”.
OneHalf
1.5.
Double
2 — double spacing.
Implementations§
Source§impl LineSpacing
impl LineSpacing
Sourcepub const ALL: [Self; 3]
pub const ALL: [Self; 3]
Every spacing, in the order a menu offers them. Single is absent for the
reason left is absent from Align::ALL.
Sourcepub fn from_attrs(attrs: &[(String, Option<String>)]) -> Option<Self>
pub fn from_attrs(attrs: &[(String, Option<String>)]) -> Option<Self>
The spacing a block’s attributes name, if any — twig records it under
data-line-height.
Sourcepub fn from_attr(value: &str) -> Option<Self>
pub fn from_attr(value: &str) -> Option<Self>
Read a data-line-height value. None for a ratio outside the
vocabulary — a document carrying data-line-height="1.3" keeps the key
and draws at the theme’s spacing, rather than having leaf guess a step.
Sourcepub const fn name(self) -> &'static str
pub const fn name(self) -> &'static str
The token twig spells it with, and what from_attr
reads back.
Trait Implementations§
Source§impl Clone for LineSpacing
impl Clone for LineSpacing
Source§fn clone(&self) -> LineSpacing
fn clone(&self) -> LineSpacing
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more