ArionStyle record Core

A set of style declarations - what a CSS rule block holds, typed. Every property is optional: a style sets only what it names, and the cascade (StyleSheet) lays the matching styles over each other, the more specific or later one winning per property.

Colours and lengths take theme tokens (Tokens) or fixed values. On a tile, box properties draw the tile's box and the font properties are inherited by the text inside it (a Label without its own style). On a control they draw the control's own face: each control documents which properties it takes.

Layout does not follow states. ArionStyle.Padding and the text metrics (ArionStyle.FontSize, ArionStyle.FontWeight, ArionStyle.FontFamily) are taken from the rules without a state, so hovering never moves or re-wraps a tile's content; colours, shadow, lift and opacity follow every state.

Shadows stay in their band. A top-level board draws in bands (rows no tile crosses); a glow is cut at the band's edge, which lies in the middle of the row gap. For a glow that must show whole, keep RowGap / 2 + padding around the tile >= 3 x ShadowBlur + Lift.

Focus ring. A focused control draws a ring around itself like CSS outline: ArionStyle.FocusRingColor, ArionStyle.FocusRingWidth, ArionStyle.FocusRingOffset and ArionStyle.FocusRingRadius, usually in a .FocusWithin rule or in the control's rule at rest. Unset, it is the theme's: a hairline in the accent (two units wide in high contrast), 1 unit away. The ring is cut at its band's edge like a glow.

public sealed record ArionStyle
Namespace
ArionUI.Presentation.Controls
Package
ArionUI.Presentation · dotnet add package ArionUI.Presentation --prerelease

Constructors

ArionStyle

public ArionStyle();

Properties

AccentColor

public StyleColor? AccentColor { get; init; }

The colour a control marks its value with - the filled part of a slider, a switch that is on (CSS accent-color).

Background

public StyleColor? Background { get; init; }

Fill of the box.

BorderColor

public StyleColor? BorderColor { get; init; }

Colour of the box's border.

BorderWidth

public StyleLength? BorderWidth { get; init; }

Strength of the border; 1 when only a colour is given.

CornerRadius

public StyleLength? CornerRadius { get; init; }

Rounding of the box corners.

Cursor

public GridCursor? Cursor { get; init; }

The pointer's shape over the tile, where the control under it does not ask for one itself.

FocusRingColor

public StyleColor? FocusRingColor { get; init; }

Colour of the ring a control draws around itself while it has the keyboard focus (CSS outline-color); the theme's accent when unset.

FocusRingOffset

public StyleLength? FocusRingOffset { get; init; }

Gap between the focused part and the inner edge of its ring (CSS outline-offset); 1 when unset.

FocusRingRadius

public StyleLength? FocusRingRadius { get; init; }

Corner radius of the focus ring's outer edge; when unset the ring follows the corners of the focused part, grown by its distance from them.

FocusRingWidth

public StyleLength? FocusRingWidth { get; init; }

Stroke of the focus ring (CSS outline-width); the theme's focus frame width when unset (1, or 2 in high contrast), 0 draws none.

FontFamily

public string? FontFamily { get; init; }

Family of the text inside the tile. Layout: state rules do not change it.

FontSize

public StyleLength? FontSize { get; init; }

Size of the text inside the tile. Layout: state rules do not change it.

FontWeight

public FontWeight? FontWeight { get; init; }

Weight of the text inside the tile. Layout: state rules do not change it.

Foreground

public StyleColor? Foreground { get; init; }

Colour of the text inside the tile.

Lift

public StyleLength? Lift { get; init; }

How far the tile rises above its place, in logical units - an elevation for hover. Drawing only: the tile keeps its place in the layout and for the pointer, and a raised tile is drawn over its neighbours.

Opacity

public double? Opacity { get; init; }

Opacity of the whole tile, box and content, 0..1.

Padding

public Insets? Padding { get; init; }

Space between the box and the control inside it. Layout: state rules do not change it.

Shadow

public StyleColor? Shadow { get; init; }

Colour of the soft shadow (or glow) around the box.

ShadowBlur

public StyleLength? ShadowBlur { get; init; }

How far the shadow blurs out (its sigma: the glow reaches about three times as far); 10 when only a colour is given.

Transition

public ArionTransition? Transition { get; init; }

How the tile blends into the look of a new state. The transition of the state being entered applies, as in CSS.

Methods

Declarations

public IEnumerable<KeyValuePair<string, object>> Declarations();

The declarations this style makes, by the names a text form would use (background, corner-radius), in a fixed order; unset properties are left out.