pub struct ComputedStyle {Show 24 fields
pub width: LengthPercentageOrAuto,
pub height: LengthPercentageOrAuto,
pub min_width: LengthPercentageOrAuto,
pub min_height: LengthPercentageOrAuto,
pub max_width: LengthPercentageOrNone,
pub max_height: LengthPercentageOrNone,
pub margin: Sides<LengthPercentageOrAuto>,
pub padding: Sides<LengthPercentage>,
pub row_gap: LengthPercentage,
pub column_gap: LengthPercentage,
pub color: Color,
pub background_color: Color,
pub opacity: f32,
pub border_width: Sides<f32>,
pub border_style: Sides<BorderStyle>,
pub border_color: Sides<Color>,
pub border_radius: Corners<LengthPercentage>,
pub font_family: FontFamily,
pub font_size: f32,
pub font_weight: FontWeight,
pub font_style: FontStyle,
pub line_height: LineHeight,
pub letter_spacing: f32,
pub text_align: TextAlign,
}Expand description
Every property’s value for one element, after the cascade, inheritance and unit resolution.
Lengths are in pixels. em and rem are gone; percentages remain, since
only layout knows what they are a percentage of. currentcolor has been
replaced by the element’s colour.
Default gives the initial value of every property, which is what a
root element with no matching rules gets.
Fields§
§width: LengthPercentageOrAuto§height: LengthPercentageOrAuto§min_width: LengthPercentageOrAuto§min_height: LengthPercentageOrAuto§max_width: LengthPercentageOrNone§max_height: LengthPercentageOrNone§margin: Sides<LengthPercentageOrAuto>§padding: Sides<LengthPercentage>§row_gap: LengthPercentage§column_gap: LengthPercentage§color: Color§background_color: Color§opacity: f320.0..=1.0
border_width: Sides<f32>In pixels. Zero wherever the side’s style is None or Hidden,
whatever width was declared.
border_style: Sides<BorderStyle>§border_color: Sides<Color>§border_radius: Corners<LengthPercentage>§font_family: FontFamily§font_size: f32In pixels.
font_weight: FontWeight§font_style: FontStyle§line_height: LineHeight§letter_spacing: f32In pixels. normal is zero.
text_align: TextAlignImplementations§
Source§impl ComputedStyle
impl ComputedStyle
Trait Implementations§
Source§impl Clone for ComputedStyle
impl Clone for ComputedStyle
Source§fn clone(&self) -> ComputedStyle
fn clone(&self) -> ComputedStyle
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 moreSource§impl Debug for ComputedStyle
impl Debug for ComputedStyle
Source§impl Default for ComputedStyle
impl Default for ComputedStyle
Source§impl PartialEq for ComputedStyle
impl PartialEq for ComputedStyle
Source§fn eq(&self, other: &ComputedStyle) -> bool
fn eq(&self, other: &ComputedStyle) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ComputedStyle
Auto Trait Implementations§
impl Freeze for ComputedStyle
impl RefUnwindSafe for ComputedStyle
impl Send for ComputedStyle
impl Sync for ComputedStyle
impl Unpin for ComputedStyle
impl UnsafeUnpin for ComputedStyle
impl UnwindSafe for ComputedStyle
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