All skills
davila7 avatar

/avalonia-layout-zafiro

@1deb97c

Guidelines for modern Avalonia UI layout using Zafiro.Avalonia, emphasizing shared styles, generic components, and avoiding XAML redundancy.

Use this Skill: https://skilld.dev/gh/davila7/claude-code-templates/avalonia-layout-zafiro

This session only. Nothing lands on disk.

themes.md

≈466 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Theme Organization and Shared Styles

Efficient theme organization is key to avoiding redundant XAML and ensuring visual consistency.

🏗️ Structure

Follow the pattern from Angor:

  1. Colors & Brushes: Define in a dedicated Colors.axaml. Use DynamicResource to support theme switching.
  2. Styles: Group styles by category (e.g., Buttons.axaml, Containers.axaml, Typography.axaml).
  3. App-wide Theme: Aggregate all styles in a main Theme.axaml.

🎨 Avoiding Redundancy

Instead of setting properties directly on elements:

<!-- ❌ BAD: Redundant properties -->
<HeaderedContainer CornerRadius="10" BorderThickness="1" BorderBrush="Blue" Background="LightBlue" />
<HeaderedContainer CornerRadius="10" BorderThickness="1" BorderBrush="Blue" Background="LightBlue" />

<!-- ✅ GOOD: Use Classes and Styles -->
<HeaderedContainer Classes="BlueSection" />
<HeaderedContainer Classes="BlueSection" />

Define the style in a shared axaml file:

<Style Selector="HeaderedContainer.BlueSection">
    <Setter Property="CornerRadius" Value="10" />
    <Setter Property="BorderThickness" Value="1" />
    <Setter Property="BorderBrush" Value="{DynamicResource Accent}" />
    <Setter Property="Background" Value="{DynamicResource SurfaceSubtle}" />
</Style>

🧩 Shared Icons and Resources

Centralize icon definitions and other shared resources in Icons.axaml and include them in the MergedDictionaries of your theme or App.axaml.

<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <MergeResourceInclude Source="UI/Themes/Styles/Containers.axaml" />
            <MergeResourceInclude Source="UI/Shared/Resources/Icons.axaml" />
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Application.Resources>

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    Error: AI Analysis failed - API error after retries

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    1/6 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 1deb97c. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 17 hours ago.

Activeupdated 8 months ago
What it can do
Reads files Edits files
All 5 allowed tools
ReadWriteEditGlobGrep

README badge

README badge for davila7/claude-code-templates/avalonia-layout-zafiro