StyleDeclaration record Core
One declaration the cascade weighed for an element - what the Styles pane of a browser's developer tools lists: the property, its value, where it comes from and whether it won.
public sealed record StyleDeclaration
- Namespace
- ArionUI.Presentation.Controls
- Package
- ArionUI.Presentation ·
dotnet add package ArionUI.Presentation --prerelease
Constructors
StyleDeclaration
public StyleDeclaration(string Property, object Value, StyleOrigin Origin, ArionStyleSelector? Selector, int Specificity, bool Applies);One declaration the cascade weighed for an element - what the Styles pane of a browser's developer tools lists: the property, its value, where it comes from and whether it won.
Parameters
PropertyThe property's name (
background,corner-radius).ValueThe value as declared: a
StyleColor, aStyleLength, anInsets, a number.OriginThe layer it comes from.
SelectorThe rule's selector; null for an inline style.
SpecificityThe selector's specificity (0 for an inline style).
AppliesTrue for the one declaration of the property that wins; false for those it overrides.
Properties
Applies
public bool Applies { get; init; }True for the one declaration of the property that wins; false for those it overrides.
Origin
public StyleOrigin Origin { get; init; }The layer it comes from.
Property
public string Property { get; init; }The property's name (background, corner-radius).
Selector
public ArionStyleSelector? Selector { get; init; }The rule's selector; null for an inline style.
Specificity
public int Specificity { get; init; }The selector's specificity (0 for an inline style).
Value
public object Value { get; init; }The value as declared: a StyleColor, a StyleLength, an Insets, a number.
