Skip to main content

StyleKey

Enum StyleKey 

Source
pub enum StyleKey {
Show 156 variants Display, BoxSizing, Position, FlexDirection, FlexWrap, Flex, FlexGrow, FlexShrink, FlexBasis, JustifyContent, AlignItems, AlignSelf, AlignContent, Width, Height, MinWidth, MinHeight, MaxWidth, MaxHeight, AspectRatio, Top, Right, Bottom, Left, Margin, MarginHorizontal, MarginVertical, MarginTop, MarginRight, MarginBottom, MarginLeft, Padding, PaddingHorizontal, PaddingVertical, PaddingTop, PaddingRight, PaddingBottom, PaddingLeft, Gap, RowGap, ColumnGap, BorderWidth, BorderTopWidth, BorderRightWidth, BorderBottomWidth, BorderLeftWidth, ZIndex, BoxShadow, BackgroundImage, Filter, BackdropFilter, MaskImage, ClipPath, GlassEffect, GlassTintColor, MixBlendMode, OutlineWidth, OutlineColor, OutlineStyle, OutlineOffset, Visibility, Cursor, TransitionProperty, TransitionDuration, TransitionDelay, TransitionTimingFunction, AnimationName, AnimationDuration, AnimationDelay, AnimationTimingFunction, AnimationIterationCount, AnimationFrameRate, TextDecorationStyle, TextDecorationThickness, TextUnderlineOffset, GridTemplateColumns, GridTemplateRows, GridAutoColumns, GridAutoRows, GridAutoFlow, GridColumn, GridColumnStart, GridColumnEnd, GridRow, GridRowStart, GridRowEnd, JustifyItems, JustifySelf, Direction, MarginStart, MarginEnd, PaddingStart, PaddingEnd, Start, End, BorderStartWidth, BorderEndWidth, BorderStartColor, BorderEndColor, BorderTopStartRadius, BorderTopEndRadius, BorderBottomEndRadius, BorderBottomStartRadius, BackgroundColor, BorderRadius, BorderTopLeftRadius, BorderTopRightRadius, BorderBottomRightRadius, BorderBottomLeftRadius, BorderColor, BorderTopColor, BorderRightColor, BorderBottomColor, BorderLeftColor, BorderStyle, BorderCurve, TintColor, AccentColor, ObjectFit, ObjectPosition, BackfaceVisibility, Translate, Rotate, Scale, Transform, TransformOrigin, Opacity, Overflow, Color, FontSize, FontWeight, LineHeight, FontFamily, FontStyle, LetterSpacing, TextDecorationLine, TextDecorationColor, WritingDirection, TextAlignVertical, FontVariant, TextShadow, TextTransform, TextAlign, TextIndent, PlaceholderColor, SelectionColor, CaretColor, Fill, Stroke, StrokeWidth, StrokeDasharray, NumberOfLines, TextOverflow, UserSelect, PointerEvents, VerticalAlign,
}
Expand description

A style property, by its React Native name.

Variants§

§

Display

display

§

BoxSizing

boxSizing

§

Position

position

§

FlexDirection

flexDirection

§

FlexWrap

flexWrap

§

Flex

flex

§

FlexGrow

flexGrow

§

FlexShrink

flexShrink

§

FlexBasis

flexBasis

§

JustifyContent

justifyContent

§

AlignItems

alignItems

§

AlignSelf

alignSelf

§

AlignContent

alignContent

§

Width

width

§

Height

height

§

MinWidth

minWidth

§

MinHeight

minHeight

§

MaxWidth

maxWidth

§

MaxHeight

maxHeight

§

AspectRatio

aspectRatio

§

Top

top

§

Right

right

§

Bottom

bottom

§

Left

left

§

Margin

margin

§

MarginHorizontal

marginHorizontal

§

MarginVertical

marginVertical

§

MarginTop

marginTop

§

MarginRight

marginRight

§

MarginBottom

marginBottom

§

MarginLeft

marginLeft

§

Padding

padding

§

PaddingHorizontal

paddingHorizontal

§

PaddingVertical

paddingVertical

§

PaddingTop

paddingTop

§

PaddingRight

paddingRight

§

PaddingBottom

paddingBottom

§

PaddingLeft

paddingLeft

§

Gap

gap

§

RowGap

rowGap

§

ColumnGap

columnGap

§

BorderWidth

borderWidth

§

BorderTopWidth

borderTopWidth

§

BorderRightWidth

borderRightWidth

§

BorderBottomWidth

borderBottomWidth

§

BorderLeftWidth

borderLeftWidth

§

ZIndex

zIndex

§

BoxShadow

boxShadow

§

BackgroundImage

backgroundImage

§

Filter

filter

§

BackdropFilter

backdropFilter

§

MaskImage

maskImage

§

ClipPath

clipPath

§

GlassEffect

glassEffect

§

GlassTintColor

glassTintColor

§

MixBlendMode

mixBlendMode

§

OutlineWidth

outlineWidth

§

OutlineColor

outlineColor

§

OutlineStyle

outlineStyle

§

OutlineOffset

outlineOffset

§

Visibility

visibility

§

Cursor

cursor

§

TransitionProperty

transitionProperty

§

TransitionDuration

transitionDuration

§

TransitionDelay

transitionDelay

§

TransitionTimingFunction

transitionTimingFunction

§

AnimationName

animationName

§

AnimationDuration

animationDuration

§

AnimationDelay

animationDelay

§

AnimationTimingFunction

animationTimingFunction

§

AnimationIterationCount

animationIterationCount

§

AnimationFrameRate

animationFrameRate

§

TextDecorationStyle

textDecorationStyle

§

TextDecorationThickness

textDecorationThickness

§

TextUnderlineOffset

textUnderlineOffset

§

GridTemplateColumns

gridTemplateColumns

§

GridTemplateRows

gridTemplateRows

§

GridAutoColumns

gridAutoColumns

§

GridAutoRows

gridAutoRows

§

GridAutoFlow

gridAutoFlow

§

GridColumn

gridColumn

§

GridColumnStart

gridColumnStart

§

GridColumnEnd

gridColumnEnd

§

GridRow

gridRow

§

GridRowStart

gridRowStart

§

GridRowEnd

gridRowEnd

§

JustifyItems

justifyItems

§

JustifySelf

justifySelf

§

Direction

direction

§

MarginStart

marginStart

§

MarginEnd

marginEnd

§

PaddingStart

paddingStart

§

PaddingEnd

paddingEnd

§

Start

start

§

End

end

§

BorderStartWidth

borderStartWidth

§

BorderEndWidth

borderEndWidth

§

BorderStartColor

borderStartColor

§

BorderEndColor

borderEndColor

§

BorderTopStartRadius

borderTopStartRadius

§

BorderTopEndRadius

borderTopEndRadius

§

BorderBottomEndRadius

borderBottomEndRadius

§

BorderBottomStartRadius

borderBottomStartRadius

§

BackgroundColor

backgroundColor

§

BorderRadius

borderRadius

§

BorderTopLeftRadius

borderTopLeftRadius

§

BorderTopRightRadius

borderTopRightRadius

§

BorderBottomRightRadius

borderBottomRightRadius

§

BorderBottomLeftRadius

borderBottomLeftRadius

§

BorderColor

borderColor

§

BorderTopColor

borderTopColor

§

BorderRightColor

borderRightColor

§

BorderBottomColor

borderBottomColor

§

BorderLeftColor

borderLeftColor

§

BorderStyle

borderStyle

§

BorderCurve

borderCurve

§

TintColor

tintColor

§

AccentColor

accentColor

§

ObjectFit

objectFit

§

ObjectPosition

objectPosition

§

BackfaceVisibility

backfaceVisibility

§

Translate

translate

§

Rotate

rotate

§

Scale

scale

§

Transform

transform

§

TransformOrigin

transformOrigin

§

Opacity

opacity

§

Overflow

overflow

§

Color

color

§

FontSize

fontSize

§

FontWeight

fontWeight

§

LineHeight

lineHeight

§

FontFamily

fontFamily

§

FontStyle

fontStyle

§

LetterSpacing

letterSpacing

§

TextDecorationLine

textDecorationLine

§

TextDecorationColor

textDecorationColor

§

WritingDirection

writingDirection

§

TextAlignVertical

textAlignVertical

§

FontVariant

fontVariant

§

TextShadow

textShadow

§

TextTransform

textTransform

§

TextAlign

textAlign

§

TextIndent

textIndent

§

PlaceholderColor

placeholderColor

§

SelectionColor

selectionColor

§

CaretColor

caretColor

§

Fill

fill

§

Stroke

stroke

§

StrokeWidth

strokeWidth

§

StrokeDasharray

strokeDasharray

§

NumberOfLines

numberOfLines

§

TextOverflow

textOverflow

§

UserSelect

userSelect

§

PointerEvents

pointerEvents

§

VerticalAlign

verticalAlign

Implementations§

Source§

impl StyleKey

Source

pub fn parse(name: &str) -> Option<StyleKey>

The key named name (React Native’s camel case).

Source

pub fn name(self) -> &'static str

The React Native name.

Source§

impl StyleKey

Source

pub fn parse_value( self, value: StyleValue<'_>, ) -> Result<PropertyValue, StyleError>

Parses value for this property: what Style::apply_value sets. Only a TSX style’s values (and class strings, once) come here.

Source

pub fn number_value(self, n: f32) -> Result<PropertyValue, StyleError>

n as this property’s value, as a number in a TSX style is (points for lengths, a multiple for lineHeight).

Source

pub fn length_value(self, length: Length) -> Result<PropertyValue, StyleError>

length as this property’s value: points, a fraction of the containing block or auto, where the property takes them.

Trait Implementations§

Source§

impl Clone for StyleKey

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 Copy for StyleKey

Source§

impl Debug for StyleKey

Source§

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

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

impl Eq for StyleKey

Source§

impl Hash for StyleKey

Source§

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

Feeds this value into the given Hasher. Read more
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 StyleKey

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 StyleKey

Auto Trait Implementations§

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.