Enx.Atomic.Avalonia.CodeGen 0.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package Enx.Atomic.Avalonia.CodeGen --version 0.0.1
                    
NuGet\Install-Package Enx.Atomic.Avalonia.CodeGen -Version 0.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Enx.Atomic.Avalonia.CodeGen" Version="0.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Enx.Atomic.Avalonia.CodeGen" Version="0.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Enx.Atomic.Avalonia.CodeGen" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Enx.Atomic.Avalonia.CodeGen --version 0.0.1
                    
#r "nuget: Enx.Atomic.Avalonia.CodeGen, 0.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Enx.Atomic.Avalonia.CodeGen@0.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Enx.Atomic.Avalonia.CodeGen&version=0.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Enx.Atomic.Avalonia.CodeGen&version=0.0.1
                    
Install as a Cake Tool

Enx.Atomic.Avalonia

CI codecov License: MIT

An atomic utility-class engine for Avalonia, inspired by UnoCSS: resolve Tailwind/UnoCSS-style tokens (hover:bg-red-500, sm:flex-row, ml-4, ...) into real Avalonia styles instead of hand-written XAML Styles.

<Button Classes="flex-row p-4 rounded-md bg-blue-500 hover:bg-blue-600" Content="Click me" />

See ARCHITECTURE.md for how the engine actually works — rules, variants, source transformers, the Mini preset, and build-time code generation.

Projects

Project Role
Sources/Enx.Atomic.Avalonia The generic engine: resolves tokens into styles, independent of any preset.
Sources/Enx.Atomic.Avalonia.Preset.Mini A concrete rule/variant set, inspired by @unocss/preset-mini.
Sources/Enx.Atomic.Avalonia.CodeGen Build-time C# code generation: emitter, CLI, and MSBuild wiring.
Sandbox An Avalonia console app used as a manual test bed for the engine and the presets.
Examples/ A minimal end-to-end example of the build-time code generation pipeline.
Tests/Enx.Atomic.Avalonia.Tests The automated test suite (xUnit v3).

Getting started

Requires a .NET SDK compatible with net10.0 (a net10.0-targeting preview SDK works too).

dotnet build Enx.Atomic.Avalonia.slnx

There are two ways to resolve utility tokens into styles:

  • At runtime — call AtomicGenerator<TTheme>.Generate(...) yourself and add the resulting styles to your Application.Styles. See Sandbox/Program.cs.
  • At build time — set up a small configuration project and wire it into your app's build via Enx.Atomic.Avalonia.CodeGen, so tokens are resolved once at compile time instead of on every startup. See Examples/ and ARCHITECTURE.md for the full setup.

Testing

dotnet test Tests/Enx.Atomic.Avalonia.Tests/Enx.Atomic.Avalonia.Tests.csproj

With code coverage (Cobertura report under coverage/):

dotnet test Tests/Enx.Atomic.Avalonia.Tests/Enx.Atomic.Avalonia.Tests.csproj \
  /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=../../coverage/

Releasing

Enx.Atomic.Avalonia, Enx.Atomic.Avalonia.Preset.Mini, and Enx.Atomic.Avalonia.CodeGen are published to nuget.org whenever a vX.Y.Z tag is pushed — see ARCHITECTURE.md for how versioning and publishing work.

License

MIT

Contributing

This repository follows the org-wide contributing guidelines.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.4 96 8/24/2026
0.0.3 99 8/23/2026
0.0.2 95 8/23/2026
0.0.1 95 8/23/2026