pub enum CssPropertyType {
Show 66 variants
TextColor,
FontSize,
FontFamily,
TextAlign,
LetterSpacing,
LineHeight,
WordSpacing,
TabWidth,
Cursor,
Display,
Float,
BoxSizing,
Width,
Height,
MinWidth,
MinHeight,
MaxWidth,
MaxHeight,
Position,
Top,
Right,
Left,
Bottom,
FlexWrap,
FlexDirection,
FlexGrow,
FlexShrink,
JustifyContent,
AlignItems,
AlignContent,
OverflowX,
OverflowY,
PaddingTop,
PaddingLeft,
PaddingRight,
PaddingBottom,
MarginTop,
MarginLeft,
MarginRight,
MarginBottom,
Background,
BackgroundImage,
BackgroundColor,
BackgroundPosition,
BackgroundSize,
BackgroundRepeat,
BorderTopLeftRadius,
BorderTopRightRadius,
BorderBottomLeftRadius,
BorderBottomRightRadius,
BorderTopColor,
BorderRightColor,
BorderLeftColor,
BorderBottomColor,
BorderTopStyle,
BorderRightStyle,
BorderLeftStyle,
BorderBottomStyle,
BorderTopWidth,
BorderRightWidth,
BorderLeftWidth,
BorderBottomWidth,
BoxShadowLeft,
BoxShadowRight,
BoxShadowTop,
BoxShadowBottom,
}
Expand description
Represents a CSS key (for example "border-radius"
=> BorderRadius
).
You can also derive this key from a CssProperty
by calling CssProperty::get_type()
.
Variants§
TextColor
FontSize
FontFamily
TextAlign
LetterSpacing
LineHeight
WordSpacing
TabWidth
Cursor
Display
Float
BoxSizing
Width
Height
MinWidth
MinHeight
MaxWidth
MaxHeight
Position
Top
Right
Left
Bottom
FlexWrap
FlexDirection
FlexGrow
FlexShrink
JustifyContent
AlignItems
AlignContent
OverflowX
OverflowY
PaddingTop
PaddingLeft
PaddingRight
PaddingBottom
MarginTop
MarginLeft
MarginRight
MarginBottom
Background
BackgroundImage
BackgroundColor
BackgroundPosition
BackgroundSize
BackgroundRepeat
BorderTopLeftRadius
BorderTopRightRadius
BorderBottomLeftRadius
BorderBottomRightRadius
BorderTopColor
BorderRightColor
BorderLeftColor
BorderBottomColor
BorderTopStyle
BorderRightStyle
BorderLeftStyle
BorderBottomStyle
BorderTopWidth
BorderRightWidth
BorderLeftWidth
BorderBottomWidth
BoxShadowLeft
BoxShadowRight
BoxShadowTop
BoxShadowBottom
Implementations§
Source§impl CssPropertyType
impl CssPropertyType
Sourcepub fn from_str(input: &str, map: &CssKeyMap) -> Option<Self>
pub fn from_str(input: &str, map: &CssKeyMap) -> Option<Self>
Parses a CSS key, such as width
from a string:
§Example
let map = get_css_key_map();
assert_eq!(Some(CssPropertyType::Width), CssPropertyType::from_str("width", &map));
assert_eq!(Some(CssPropertyType::JustifyContent), CssPropertyType::from_str("justify-content", &map));
assert_eq!(None, CssPropertyType::from_str("asdfasdfasdf", &map));
Sourcepub fn to_str(&self, map: &CssKeyMap) -> &'static str
pub fn to_str(&self, map: &CssKeyMap) -> &'static str
Returns the original string that was used to construct this CssPropertyType
.
Sourcepub fn is_inheritable(&self) -> bool
pub fn is_inheritable(&self) -> bool
Returns whether this property will be inherited during cascading
Sourcepub fn can_trigger_relayout(&self) -> bool
pub fn can_trigger_relayout(&self) -> bool
Returns whether this property can trigger a re-layout (important for incremental layout and caching layouted DOMs).
Trait Implementations§
Source§impl Clone for CssPropertyType
impl Clone for CssPropertyType
Source§fn clone(&self) -> CssPropertyType
fn clone(&self) -> CssPropertyType
Returns a copy of the value. Read more
1.0.0 · 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 CssPropertyType
impl Debug for CssPropertyType
Source§impl Display for CssPropertyType
impl Display for CssPropertyType
Source§impl Hash for CssPropertyType
impl Hash for CssPropertyType
Source§impl Ord for CssPropertyType
impl Ord for CssPropertyType
Source§fn cmp(&self, other: &CssPropertyType) -> Ordering
fn cmp(&self, other: &CssPropertyType) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for CssPropertyType
impl PartialEq for CssPropertyType
Source§impl PartialOrd for CssPropertyType
impl PartialOrd for CssPropertyType
impl Copy for CssPropertyType
impl Eq for CssPropertyType
impl StructuralPartialEq for CssPropertyType
Auto Trait Implementations§
impl Freeze for CssPropertyType
impl RefUnwindSafe for CssPropertyType
impl Send for CssPropertyType
impl Sync for CssPropertyType
impl Unpin for CssPropertyType
impl UnwindSafe for CssPropertyType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)