#[non_exhaustive]pub enum LineHeight {
Normal,
Unitless(f32),
Length(Length),
}Expand description
Represents a line height value.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Normal
Normal line height.
Unitless(f32)
A unitless line height which is relative to the font size.
Length(Length)
A specific line height.
Implementations§
Source§impl LineHeight
impl LineHeight
pub const fn scales_with_text_fit(self) -> bool
pub fn into_parley(self, sizing: &SizingContext) -> LineHeight
pub fn to_px(self, sizing: &SizingContext, normal_basis: f32) -> f32
Trait Implementations§
Source§impl Clone for LineHeight
impl Clone for LineHeight
Source§fn clone(&self) -> LineHeight
fn clone(&self) -> LineHeight
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LineHeight
Source§impl Debug for LineHeight
impl Debug for LineHeight
Source§impl Default for LineHeight
impl Default for LineHeight
Source§fn default() -> LineHeight
fn default() -> LineHeight
Returns the “default value” for a type. Read more
Source§impl From<Length> for LineHeight
impl From<Length> for LineHeight
Source§impl<'i> FromCss<'i> for LineHeight
impl<'i> FromCss<'i> for LineHeight
Source§const VALID_TOKENS: &'static [CssToken]
const VALID_TOKENS: &'static [CssToken]
Returns the list of valid CSS tokens for this type.
Source§fn from_css(input: &mut Parser<'i, '_>) -> ParseResult<'i, Self>
fn from_css(input: &mut Parser<'i, '_>) -> ParseResult<'i, Self>
Parses the type from a
Parser instance.Source§fn from_str(source: &'i str) -> ParseResult<'i, Self>where
Self: Sized,
fn from_str(source: &'i str) -> ParseResult<'i, Self>where
Self: Sized,
Helper function to parse the type from a string.
Source§const EXPECT_MESSAGE: CssExpectedMessage = CssExpectedMessage::OneValue
const EXPECT_MESSAGE: CssExpectedMessage = CssExpectedMessage::OneValue
Message template used when building parse errors for this type.
Source§impl PartialEq for LineHeight
impl PartialEq for LineHeight
Source§fn eq(&self, other: &LineHeight) -> bool
fn eq(&self, other: &LineHeight) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for LineHeight
Source§impl TailwindPropertyParser for LineHeight
impl TailwindPropertyParser for LineHeight
Auto Trait Implementations§
impl Freeze for LineHeight
impl RefUnwindSafe for LineHeight
impl Send for LineHeight
impl Sync for LineHeight
impl Unpin for LineHeight
impl UnsafeUnpin for LineHeight
impl UnwindSafe for LineHeight
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