Skip to main content

PropertyValue

Enum PropertyValue 

Source
pub enum PropertyValue {
Show 66 variants Default, Display(Display), BoxSizing(BoxSizing), Position(Position, bool, bool), FlexDirection(FlexDirection), FlexWrap(FlexWrap), Flex(OrderedFloat<f32>, OrderedFloat<f32>, Dimension), Number(OrderedFloat<f32>), OptNumber(Option<OrderedFloat<f32>>), Dimension(Dimension), Lpa(LengthPercentageAuto), Lp(LengthPercentage), OptLpa(Option<LengthPercentageAuto>), OptLp(Option<LengthPercentage>), Points(Points), OptPoints(Option<Points>), AlignContent(AlignContent), AlignItems(Option<AlignItems>), VerticalAlign(VerticalAlign), OptBool(Option<bool>), Bool(bool), Color(Option<Color>), CurrentColor, Deferred(Box<str>, Box<PropertyValue>), BorderStyle(BorderStyle, bool), ObjectFit(Option<ResizeMode>), ObjectPosition(ObjectPosition), Transform(Box<[(TransformKind, f32, Option<NodeId>)]>), TransformOrigin(TransformOrigin), FontWeight(Option<u16>), LineHeight(LineHeight), FontFamily(Option<FontFamily>), LetterSpacing(Option<Points>, Option<OrderedFloat<f32>>), TextIndent(Option<Points>, Option<OrderedFloat<f32>>), FontSize(Option<Points>, Option<OrderedFloat<f32>>), TextDecoration(Option<TextDecoration>), FontVariant(Option<FontVariant>), TextShadow(Option<(TextShadow, bool)>), TextTransform(Option<TextTransform>), TextAlign(Option<TextAlign>, bool), Shadows(Rc<[(BoxShadow, bool)]>), Gradients(Rc<[Gradient]>), ClipPath(Option<ClipInset>), Filters(Rc<[(Filter, bool)]>), GlassEffect(GlassEffect), BlendMode(BlendMode), Cursor(Cursor), TransitionProps(TransitionProps), Ms(OrderedFloat<f32>), Easing([OrderedFloat<f32>; 4]), Spring(Spring), Keyframes(Option<Keyframes>), Iterations(Option<u32>), Paint(Option<SvgPaint>), Dashes(Option<Arc<[Points]>>), EnvLength(Points, EnvVar), AlignVertical(Option<Percentage>), NumberOfLines(Option<u32>), TextOverflow(Option<EllipsizeMode>), PointerEvents(Option<PointerEvents>), DecorationStyle(Option<DecorationStyle>), GridTemplate(GridTemplateValue), GridTracks(Rc<[TrackSizingFunction]>), GridAutoFlow(GridAutoFlow), GridLine(Line<GridPlacement<String>>), GridPlacement(GridPlacement<String>),
}
Expand description

A style property’s value, parsed (StyleKey::parse_value): what Style::apply_value sets without parsing. TSX styles are parsed into it once; classes and Rust’s typed styles make it directly.

Variants§

§

Default

The property’s default (null).

§

Display(Display)

display.

§

BoxSizing(BoxSizing)

boxSizing.

§

Position(Position, bool, bool)

position: Taffy’s, then whether it is fixed and sticky.

§

FlexDirection(FlexDirection)

flexDirection.

§

FlexWrap(FlexWrap)

flexWrap.

§

Flex(OrderedFloat<f32>, OrderedFloat<f32>, Dimension)

flex: grow, shrink and basis.

§

Number(OrderedFloat<f32>)

A number (flexGrow, zIndex, opacity).

§

OptNumber(Option<OrderedFloat<f32>>)

A number or none (aspectRatio).

§

Dimension(Dimension)

A size (width, flexBasis).

§

Lpa(LengthPercentageAuto)

A length, a percentage or auto (margin, top, minWidth).

§

Lp(LengthPercentage)

A length or a percentage (padding, gap).

§

OptLpa(Option<LengthPercentageAuto>)

PropertyValue::Lpa or unset (marginStart).

§

OptLp(Option<LengthPercentage>)

PropertyValue::Lp or unset (paddingStart).

§

Points(Points)

Points (borderWidth, borderRadius, outlineWidth).

§

OptPoints(Option<Points>)

Points or unset (fontSize, a corner’s radius).

§

AlignContent(AlignContent)

alignContent, justifyContent.

§

AlignItems(Option<AlignItems>)

alignItems, alignSelf (None: auto), justifyItems.

§

VerticalAlign(VerticalAlign)

verticalAlign.

§

OptBool(Option<bool>)

Right to left (Some(true)), left to right, or unset (direction, writingDirection, fontStyle’s italic).

§

Bool(bool)

A flag (overflow: hidden, visibility: hidden, borderCurve: continuous, backfaceVisibility: hidden).

§

Color(Option<Color>)

A color or unset.

§

CurrentColor

CSS’s currentColor, written out: the node’s text color.

§

Deferred(Box<str>, Box<PropertyValue>)

A value that writes currentColor inside it, parsed with a stand-in color, and its text, parsed again with the node’s color.

§

BorderStyle(BorderStyle, bool)

borderStyle, outlineStyle: the style and whether it hides the line (none).

§

ObjectFit(Option<ResizeMode>)

objectFit (None: the element’s default).

§

ObjectPosition(ObjectPosition)

objectPosition.

§

Transform(Box<[(TransformKind, f32, Option<NodeId>)]>)

A transform property’s steps, each with its animated value if any.

§

TransformOrigin(TransformOrigin)

transformOrigin.

§

FontWeight(Option<u16>)

fontWeight.

§

LineHeight(LineHeight)

lineHeight.

§

FontFamily(Option<FontFamily>)

fontFamily.

§

LetterSpacing(Option<Points>, Option<OrderedFloat<f32>>)

letterSpacing: points, or ems of the font size.

§

TextIndent(Option<Points>, Option<OrderedFloat<f32>>)

textIndent: points, or ems of the font size.

§

FontSize(Option<Points>, Option<OrderedFloat<f32>>)

fontSize: points, or a multiple of the inherited font size.

§

TextDecoration(Option<TextDecoration>)

textDecorationLine.

§

FontVariant(Option<FontVariant>)

fontVariant.

§

TextShadow(Option<(TextShadow, bool)>)

textShadow: the widest layer and whether it names its color.

§

TextTransform(Option<TextTransform>)

textTransform.

§

TextAlign(Option<TextAlign>, bool)

textAlign, and whether it is physical (left / right).

§

Shadows(Rc<[(BoxShadow, bool)]>)

boxShadow’s layers, each with whether it names its color.

§

Gradients(Rc<[Gradient]>)

backgroundImage, maskImage.

§

ClipPath(Option<ClipInset>)

clipPath (None: none).

§

Filters(Rc<[(Filter, bool)]>)

filter, backdropFilter, each with whether a drop-shadow() names its color.

§

GlassEffect(GlassEffect)

glassEffect.

§

BlendMode(BlendMode)

mixBlendMode.

§

Cursor(Cursor)

cursor.

§

TransitionProps(TransitionProps)

transitionProperty.

§

Ms(OrderedFloat<f32>)

Milliseconds (durations, delays).

§

Easing([OrderedFloat<f32>; 4])

A timing function’s cubic Bézier control points.

§

Spring(Spring)

transitionTimingFunction’s spring(stiffness, damping, mass).

§

Keyframes(Option<Keyframes>)

animationName.

§

Iterations(Option<u32>)

animationIterationCount (None: forever).

§

Paint(Option<SvgPaint>)

fill, stroke (None: unset, inherited).

§

Dashes(Option<Arc<[Points]>>)

strokeDasharray (empty: none).

§

EnvLength(Points, EnvVar)

A margin or padding of a length (points) plus an environment variable (calc(env(safe-area-inset-top) + 8px)).

§

AlignVertical(Option<Percentage>)

textAlignVertical: 0% the top, 50% the middle, 100% the bottom.

§

NumberOfLines(Option<u32>)

numberOfLines (Some(0): no clamp).

§

TextOverflow(Option<EllipsizeMode>)

textOverflow.

§

PointerEvents(Option<PointerEvents>)

pointerEvents.

§

DecorationStyle(Option<DecorationStyle>)

textDecorationStyle.

§

GridTemplate(GridTemplateValue)

gridTemplateColumns, gridTemplateRows.

§

GridTracks(Rc<[TrackSizingFunction]>)

gridAutoColumns, gridAutoRows.

§

GridAutoFlow(GridAutoFlow)

gridAutoFlow.

§

GridLine(Line<GridPlacement<String>>)

gridColumn, gridRow.

§

GridPlacement(GridPlacement<String>)

gridColumnStart and the other lines.

Trait Implementations§

Source§

impl Clone for PropertyValue

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PropertyValue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for PropertyValue

Source§

impl Hash for PropertyValue

Source§

fn hash<H: Hasher>(&self, state: &mut H)

The variant and its payload: values that compare equal hash alike, and values that differ (a width’s points, a padding’s) hash apart, as the styles of Rust elements key their lowered rules by their declarations, which differ in little else. Floats hash as OrderedFloats (f32’s == has 0.0 == -0.0), taffy’s lengths by the bits they compare by, lists by their length (their items are only compared). Every variant is matched, so a new one says how it hashes.

1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for PropertyValue

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PropertyValue

Auto Trait Implementations§

§

impl !Send for PropertyValue

§

impl !Sync for PropertyValue

§

impl Forget for PropertyValue

§

impl Freeze for PropertyValue

§

impl Move for PropertyValue

§

impl RefUnwindSafe for PropertyValue

§

impl Unpin for PropertyValue

§

impl UnsafeUnpin for PropertyValue

§

impl UnwindSafe for PropertyValue

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.