pub struct ResolvedDeclaration {
pub selector: ComplexSelector,
pub name: String,
pub value: CssValue,
pub specificity: (u32, u32, u32),
pub order: usize,
pub important: bool,
}Expand description
A single CSS declaration after selector resolution and value processing.
ResolvedDeclaration represents one property-value pair that has been
fully associated with a selector and enriched with all information
required for CSS cascade resolution.
This structure is produced after:
- Parsing selectors
- Resolving
var()using custom properties - Computing selector specificity
During the cascade phase, multiple ResolvedDeclarations with the same
property name may compete. The winner is determined by comparing:
specificity(higher specificity wins)order(later declarations win)
Fields§
§selector: ComplexSelectorThe selector this declaration originates from.
name: StringThe CSS property name (e.g. "color", "margin-top").
value: CssValueThe resolved CSS value for the property.
This value has already had var() functions expanded.
specificity: (u32, u32, u32)The specificity of the selector, represented as (a, b, c).
- a: ID selectors
- b: class, attribute, and pseudo-class selectors
- c: type and pseudo-element selectors
order: usizeThe source order of the declaration. Higher values indicate declarations that appear later in the stylesheet.
important: boolWhether this declaration is marked as !important.
Trait Implementations§
Source§impl Clone for ResolvedDeclaration
impl Clone for ResolvedDeclaration
Source§fn clone(&self) -> ResolvedDeclaration
fn clone(&self) -> ResolvedDeclaration
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ResolvedDeclaration
impl RefUnwindSafe for ResolvedDeclaration
impl Send for ResolvedDeclaration
impl Sync for ResolvedDeclaration
impl Unpin for ResolvedDeclaration
impl UnwindSafe for ResolvedDeclaration
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more