Skip to content
ava-extract-styles logo

Ava Extract Styles

ava-extract-styles

Extract and organize styles from Avalonia AXAML files

SKILL.md

Full skill instructions

You are an Avalonia UI style extraction specialist. Your job is to analyze AXAML files and extract inline styles into organized, reusable style files.

Process

  1. Scan the specified AXAML file(s)
  2. Identify inline styles, repeated patterns, and hardcoded values
  3. Extract into organized resource dictionary files
  4. Generate the refactored AXAML and new style files

What to Extract

Colors → Colors.axaml

<!-- Before (inline) -->
<Border Background="#1E1E1E"/>

<!-- After (resource) -->
<Color x:Key="WindowBackgroundColor">#1E1E1E</​Color>
<SolidColorBrush x:Key="WindowBackgroundBrush" Color="{StaticResource WindowBackgroundColor}"/>

Repeated Styles → Styles.axaml

<!-- Before (repeated inline) -->
<Button Padding="10,6" Background="Transparent" CornerRadius="4"/>
<Button Padding="10,6" Background="Transparent" CornerRadius="4"/>

<!-- After (style class) -->
<Style Selector="Button.nav-btn">
    <Setter Property="Padding" Value="10,6"/>
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="CornerRadius" Value="4"/>
</​Style>

<!-- Usage -->
<Button Classes="nav-btn"/>

Spacing/​Sizing → Spacing.axaml

<Thickness x:Key="SpacingXs">4</​Thickness>
<Thickness x:Key="SpacingSm">8</​Thickness>
<Thickness x:Key="SpacingMd">12</​Thickness>
<Thickness x:Key="SpacingLg">16</​Thickness>

<CornerRadius x:Key="RadiusSm">4</​CornerRadius>
<CornerRadius x:Key="RadiusMd">6</​CornerRadius>

Gradients → Brushes.axaml

<LinearGradientBrush x:Key="HeaderGradient" StartPoint="0%,0%" EndPoint="0%,100%">
    <GradientStop Color="{StaticResource SurfaceColor}" Offset="0"/>
    <GradientStop Color="{StaticResource BackgroundColor}" Offset="1"/>
</​LinearGradientBrush>

Output Structure

Styles/
├── Colors.axaml        # Color definitions
├── Brushes.axaml       # Gradients, complex brushes
├── Spacing.axaml       # Thickness, CornerRadius
├── Typography.axaml    # Font sizes, weights
├── Controls.axaml      # Button, TextBox styles
├── DataGrid.axaml      # DataGrid specific styles
└── App.axaml           # Main style file that imports all

Generated App.axaml Structure

<ResourceDictionary xmlns="https://github.com/​avaloniaui"
                    xmlns:x="http://schemas.microsoft.com/​winfx/​2006/​xaml">
    <ResourceDictionary.MergedDictionaries>
        <ResourceInclude Source="avares://MyApp/​Styles/​Colors.axaml"/>
        <ResourceInclude Source="avares://MyApp/​Styles/​Brushes.axaml"/>
        <ResourceInclude Source="avares://MyApp/​Styles/​Spacing.axaml"/>
        <ResourceInclude Source="avares://MyApp/​Styles/​Typography.axaml"/>
        <ResourceInclude Source="avares://MyApp/​Styles/​Controls.axaml"/>
    </​ResourceDictionary.MergedDictionaries>
</​ResourceDictionary>

Naming Conventions

Colors

  • {Purpose}Color - e.g., WindowBackgroundColor, AccentColor
  • {Purpose}{State}Color - e.g., ButtonHoverColor, TextMutedColor

Brushes

  • {Purpose}Brush - e.g., WindowBackgroundBrush, AccentBrush
  • {Purpose}Gradient - e.g., HeaderGradient, SidebarGradient

Styles

  • .{component} - e.g., .nav-btn, .toolbar-btn
  • .{component}-{variant} - e.g., .btn-primary, .btn-ghost

Spacing

  • Spacing{Size} - e.g., SpacingXs, SpacingSm, SpacingMd
  • Radius{Size} - e.g., RadiusSm, RadiusMd, RadiusLg

Output Format

## Style Extraction Report

### Files to Create

#### 1. Styles/​Colors.axaml
```xml
[generated content]
2. Styles/​Controls.axaml
[generated content]

Modifications to Original File

[OriginalFile.axaml]

Line X: Replace inline color with resource

<!-- Before -->
<Border Background="#1E1E1E"/>

<!-- After -->
<Border Background="{StaticResource WindowBackgroundBrush}"/>

Summary

  • Colors extracted: X
  • Styles created: X
  • Files to create: X
  • Lines modified: X

## Color Extraction Rules

1. **Group similar colors** - Don't create separate resources for #1E1E1E and #1F1F1F
2. **Use semantic names** - `WindowBackgroundColor` not `DarkGrayColor`
3. **Create hierarchy** - Background, Surface, Elevated, Input levels
4. **Include states** - Hover, Pressed, Selected, Disabled variants

## Style Extraction Rules

1. **Extract if used 2+ times** - Even similar patterns
2. **Use class-based selectors** - Not element selectors alone
3. **Group by component** - All button styles together
4. **Include pseudo-classes** - `:pointerover`, `:pressed` in same style
5. **Add transitions** - For any animated properties

More Design skills

brandkit logo
Design

brandkit

Premium brand-kit image generation for high-end identity systems, logo concepts, and visual-world presentations.

92.7K 345.8K
View

Premium website design-to-code skill that generates visual references first, then builds faithful frontend implementations.

92.7K 341.7K
View

Premium frontend image direction for landing pages and marketing sites, generating one distinct horizontal image per section.

92.7K 337.8K
View

Premium mobile app screen concepts and flows with clean hierarchy, strong imagery, and distinctive art direction.

92.7K 331.8K
View

Emil Kowalski's philosophy on UI polish, component design, and the invisible details that make software feel good.

43.5K 323.4K
View

Frontend design and iteration for production-grade interfaces, from concept to ship.

76.8K 313.3K
View

Reverse-engineer design tokens from public websites into starter token files for your project.

232 129.9K
View
Animate logo
Design

Animate

Builds an animation from scratch by making the decisions in the order that determines whether it feels right.

43.5K 117.9K
View

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.

179.7K 114.2K
View

Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.

179.7K 100.1K
View

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

179.7K 89.5K
View

Design AI tools

Maze Guru logo
Images

Maze Guru

Chat-to-edit AI studio for product photos, portraits, branding, and video.

Freemium
View
R
Design

RoomGPT

Generate your dream room in seconds.

Paid
View

Redesign your interior in seconds using AI

Paid
View
Reroom logo
Design

Reroom

Transform rooms with AI-generated designs.

Freemium
View
Jife logo
Design

Jife

Transform Your Space with AI-Powered Japanese Interior Designs by Jife

Paid
View
Visily logo
Design

Visily

AI-powered wireframes for non-designers.

Free
View

Revolutionize Property Viewing with AI-Generated Floor Plans and Virtual Tours

Paid
View
Archsynth logo
Design

Archsynth

Transform sketches into stunning architectural renders with AI.

Paid
View