avalonia-styling

Define Avalonia styles, control themes, and theme variants with selectors and resources.

27|2|Updated Apr 23, 2026
One-click install
npx skills add https://github.com/linuxdevel/Avalonia-skills --skill avalonia-styling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: avalonia-styling
Source: https://github.com/linuxdevel/Avalonia-skills/tree/main/skills/avalonia/avalonia-styling
Command: npx skills add https://github.com/linuxdevel/Avalonia-skills --skill avalonia-styling

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Styling Avalonia apps can be verbose and inconsistently themed across components; this guide consolidates approaches for reliable, scalable visuals.

Core Features & Use Cases

  • Style: define per-control appearance with selectors, pseudo-classes, nesting, and resource references
  • ControlTheme: replace entire control visuals for complete restyling
  • Theme Variants: switch between Light/Dark and other themes at runtime
  • Sharing & Reuse: compose styles across the app with shared resource dictionaries

Quick Start

Create a Window.Styles with a Style targeting TextBlock and include a :pointerover state to observe the styling changes.

Frequently Asked Questions about avalonia-styling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I apply consistent visual styling across an Avalonia application?

Avalonia styling is defined using Style selectors for per-control appearance and ControlTheme definitions to replace entire control visuals. This mechanism supports pseudoclasses, nesting, and resource references to create consistent, scalable UI themes.

How do I create a style with a pointerover pseudoclass in Avalonia?

To create an Avalonia style, define a Window.Styles block with a Style targeting a control like TextBlock. Include a :pointerover pseudoclass selector within this block to observe interactive styling changes when the user hovers over the control.

What is the best way to switch between Light and Dark theme variants in Avalonia?

The best way to switch between Light and Dark theme variants in Avalonia is by using dynamic theme variants. This feature allows your application to switch between Light, Dark, and other custom themes at runtime dynamically.

When should I use a ControlTheme instead of a standard Style in Avalonia?

Use an Avalonia ControlTheme when you need to replace the entire visual appearance of a control for complete restyling. Use a standard Style when you only need to define per-control appearance using selectors, pseudoclasses, and resource references.

Can I share resource dictionaries to compose styles across an Avalonia app?

Yes, you can compose styles across an Avalonia app by using shared resource dictionaries. This allows you to define and reuse styles, control themes, and theme variants consistently across different windows and controls.