#[repr(C)]pub struct CssRuleBlock {
pub path: CssPath,
pub declarations: CssDeclarationVec,
pub conditions: DynamicSelectorVec,
pub priority: u8,
}Expand description
One block of rules that applies a bunch of rules to a “path” in the style, i.e.
div#myid.myclass -> { ("justify-content", "center") }
The conditions field contains @media/@lang/etc. conditions that must ALL be
satisfied for this rule block to apply (from enclosing @-rule blocks).
Fields§
§path: CssPathThe css path (full selector) of the style ruleset
declarations: CssDeclarationVec"justify-content: center" =>
CssDeclaration::Static(CssProperty::JustifyContent(LayoutJustifyContent::Center))
conditions: DynamicSelectorVecConditions from enclosing @-rules (@media, @lang, etc.) that must ALL be satisfied for this rule block to apply. Empty = unconditional.
priority: u8Layer priority. See rule_priority for slot allocation.
0 = UA / framework, 20 = author CSS (default), higher = wins.
Sort key combined with selector specificity in sort_by_specificity.
Implementations§
Source§impl CssRuleBlock
impl CssRuleBlock
pub fn new(path: CssPath, declarations: Vec<CssDeclaration>) -> Self
pub fn with_conditions( path: CssPath, declarations: Vec<CssDeclaration>, conditions: Vec<DynamicSelector>, ) -> Self
Trait Implementations§
Source§impl Clone for CssRuleBlock
impl Clone for CssRuleBlock
Source§fn clone(&self) -> CssRuleBlock
fn clone(&self) -> CssRuleBlock
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CssRuleBlock
impl Debug for CssRuleBlock
Source§impl Default for CssRuleBlock
impl Default for CssRuleBlock
Source§fn default() -> CssRuleBlock
fn default() -> CssRuleBlock
Source§impl Extend<CssRuleBlock> for CssRuleBlockVec
impl Extend<CssRuleBlock> for CssRuleBlockVec
Source§fn extend<T: IntoIterator<Item = CssRuleBlock>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = CssRuleBlock>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl FromIterator<CssRuleBlock> for CssRuleBlockVec
impl FromIterator<CssRuleBlock> for CssRuleBlockVec
Source§fn from_iter<T>(iter: T) -> Selfwhere
T: IntoIterator<Item = CssRuleBlock>,
fn from_iter<T>(iter: T) -> Selfwhere
T: IntoIterator<Item = CssRuleBlock>,
Source§impl Ord for CssRuleBlock
impl Ord for CssRuleBlock
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for CssRuleBlock
impl PartialEq for CssRuleBlock
Source§fn eq(&self, other: &CssRuleBlock) -> bool
fn eq(&self, other: &CssRuleBlock) -> bool
self and other values to be equal, and is used by ==.