pub trait DeclarationMetadata: Sized {
Show 16 methods
// Required method
fn initial() -> &'static str;
// Provided methods
fn inherits() -> Inherits { ... }
fn applies_to() -> AppliesTo { ... }
fn percentages() -> Percentages { ... }
fn animation_type() -> AnimationType { ... }
fn is_shorthand() -> bool { ... }
fn is_longhand() -> bool { ... }
fn longhands() -> Option<&'static [CssAtomSet]> { ... }
fn shorthand_group() -> CssAtomSet { ... }
fn property_group() -> PropertyGroup { ... }
fn computed_value_type() -> ComputedValueType { ... }
fn canonical_order() -> Option<&'static str> { ... }
fn logical_property_group() -> Option<CssAtomSet> { ... }
fn box_side() -> BoxSide { ... }
fn box_portion() -> BoxPortion { ... }
fn unitless_zero_resolves() -> UnitlessZeroResolves { ... }
}Required Methods§
Provided Methods§
Sourcefn applies_to() -> AppliesTo
fn applies_to() -> AppliesTo
Determines what types of frames this rule applies to
Sourcefn percentages() -> Percentages
fn percentages() -> Percentages
Determines how this style value resolves percentages, if they are allowed as values
Sourcefn animation_type() -> AnimationType
fn animation_type() -> AnimationType
Returns how this style value animates
Sourcefn is_shorthand() -> bool
fn is_shorthand() -> bool
Determines if this style value is a “shorthand” value, meaning it is comprised of other “longhand” style values.
Sourcefn is_longhand() -> bool
fn is_longhand() -> bool
Determines if this style value is a “longhand” value, meaning a “shorthand” style value exists that could also express this.
Sourcefn longhands() -> Option<&'static [CssAtomSet]>
fn longhands() -> Option<&'static [CssAtomSet]>
Returns all transitive longhands for a shorthand property.
For nested shorthands (e.g., border-width), this recursively expands to include
all nested longhands (e.g., border-top-width, border-left-width, etc.).
Sourcefn shorthand_group() -> CssAtomSet
fn shorthand_group() -> CssAtomSet
Returns the declaration ID of the shorthand that this property is part of.
If this is not a longhand then it will be CssAtomSet::_None.
Sourcefn property_group() -> PropertyGroup
fn property_group() -> PropertyGroup
Returns which CSS specification(s) this property belongs to. This allows tracking which CSS modules are used in a stylesheet.
Sourcefn computed_value_type() -> ComputedValueType
fn computed_value_type() -> ComputedValueType
Returns how the computed value is calculated from the specified value.
Sourcefn canonical_order() -> Option<&'static str>
fn canonical_order() -> Option<&'static str>
Returns the canonical order for serialization (e.g., “per grammar”, “unique”). Returns None if not specified or not applicable.
Sourcefn logical_property_group() -> Option<CssAtomSet>
fn logical_property_group() -> Option<CssAtomSet>
Returns the logical property group this property belongs to (e.g., “Margin”, “Border”). This groups related logical/physical properties together. Returns None if this is not part of a logical property group.
Sourcefn box_side() -> BoxSide
fn box_side() -> BoxSide
Returns which side(s) of the box this property applies to.
For example, margin-top returns BoxSide::Top, while margin returns all sides.
Returns BoxSide::none() if the property doesn’t apply to a specific side.
Sourcefn box_portion() -> BoxPortion
fn box_portion() -> BoxPortion
Returns which portion(s) of the box model this property affects.
For example, margin-top returns BoxPortion::Margin, border-width returns BoxPortion::Border.
Returns BoxPortion::none() if the property doesn’t affect the box model.
Sourcefn unitless_zero_resolves() -> UnitlessZeroResolves
fn unitless_zero_resolves() -> UnitlessZeroResolves
Returns how unitless zero resolves for this property.
For properties that accept both <number> and <length>, unitless zero
may resolve to a number rather than a length. This affects whether the
minifier can safely reduce 0px to 0.
Examples where unitless zero resolves to Number (NOT safe to reduce):
line-height: 0means 0x font-size multipliertab-size: 0means 0 tab charactersborder-image-outset: 0means 0x border-width
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.