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
impl Clone for PropertyValue
Source§impl Debug for PropertyValue
impl Debug for PropertyValue
impl Eq for PropertyValue
Source§impl Hash for PropertyValue
impl Hash for PropertyValue
Source§fn hash<H: Hasher>(&self, state: &mut H)
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.