ArionStyleSelector class Core

What a rule styles - a CSS selector, typed. It picks elements of two kinds: the tiles of a board (the box a board draws around a control) and the controls themselves (a button's own face). A control type (Select.Type<Button>()) picks controls of that type, Select.Tile picks tiles, and a selector with neither (Select.Class("card"), Select.Any) picks both kinds. Classes are those of the element - a tile's from Board.Add, a control's from Control.Classes - and so are the states; all of them must hold (Button.primary:hover is Select.Type<Button>().Class("primary").Hover). Two selectors are equal when they pick the same elements.

public sealed class ArionStyleSelector : IEquatable<ArionStyleSelector>
Namespace
ArionUI.Presentation.Controls
Package
ArionUI.Presentation · dotnet add package ArionUI.Presentation --prerelease
Implements
IEquatable<ArionStyleSelector>

Properties

Classes

public IReadOnlyList<string> Classes { get; }

The classes the element must carry, all of them.

ControlType

public Type? ControlType { get; }

The control type the element must be (or derive from); null matches any. A selector with a type picks controls only.

Disabled

public ArionStyleSelector Disabled { get; }

Also requires the element to be disabled.

FocusWithin

public ArionStyleSelector FocusWithin { get; }

Also requires the focus on or inside the element.

Hover

public ArionStyleSelector Hover { get; }

Also requires the pointer over the element.

IsTileSelector

public bool IsTileSelector { get; }

True when the selector picks tiles only (Select.Tile).

Pressed

public ArionStyleSelector Pressed { get; }

Also requires a pointer button held on the element.

Specificity

public int Specificity { get; }

How specific the selector is - CSS specificity, simplified: every class and every state counts 10, a control type (or Select.Tile) counts 1. Within one layer of the cascade, of two rules setting the same property the more specific wins; between equals, the later one.

States

public TileStates States { get; }

The states the element must be in, all of them.

Methods

Class

public ArionStyleSelector Class(string names);

Also requires the class (or the space-separated classes) names.

Equals

public override bool Equals(object? obj);

Equals

public bool Equals(ArionStyleSelector? other);

GetHashCode

public override int GetHashCode();

ToString

public override string ToString();

The selector as CSS would spell it (Button.kpi:hover, tile.card).