formaui-net.Framework.Themes 1.0.0-preview.27

Prefix Reserved
This is a prerelease version of formaui-net.Framework.Themes.
dotnet add package formaui-net.Framework.Themes --version 1.0.0-preview.27
                    
NuGet\Install-Package formaui-net.Framework.Themes -Version 1.0.0-preview.27
                    
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="formaui-net.Framework.Themes" Version="1.0.0-preview.27" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="formaui-net.Framework.Themes" Version="1.0.0-preview.27" />
                    
Directory.Packages.props
<PackageReference Include="formaui-net.Framework.Themes" />
                    
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 formaui-net.Framework.Themes --version 1.0.0-preview.27
                    
#r "nuget: formaui-net.Framework.Themes, 1.0.0-preview.27"
                    
#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 formaui-net.Framework.Themes@1.0.0-preview.27
                    
#: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=formaui-net.Framework.Themes&version=1.0.0-preview.27&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=formaui-net.Framework.Themes&version=1.0.0-preview.27&prerelease
                    
Install as a Cake Tool

Forma.Framework.Themes

The contracts of Forma's theme system. A theme is a named palette, the rule [data-forma-theme="its-name"], drawn in a light and a dark color scheme, as the theme design sets out.

Install

dotnet add package formaui-net.Framework.Themes --prerelease

Registering themes

Forma's component library registers its own two themes, Forma and Forma High Contrast, and a reader starts in Forma's theme in the System preference. A host adds its themes, removes or replaces Forma's, or sets another starting choice, in any order beside AddFormaServerIntegration(), AddFormaWebAssemblyIntegration(), AddFormaWebViewIntegration() or the component library's own registration:

builder.Services.AddFormaThemes(themes =>
{
    themes.Add(new ThemeDefinition("harbor", LocalizableText.For<Program>("Harbor"), ColorSchemes.Light | ColorSchemes.Dark, "css/harbor-theme.css"));
    themes.Default = new ThemeChoice("harbor", ColorSchemePreference.System);
});

A default naming a theme that isn't registered throws InvalidOperationException as the registry is made, and a second theme of a registered name as it's added.

The types

Type What it is
ThemeDefinition A theme a host offers: its name, the name a reader sees, the schemes it draws, its light one among them, and its stylesheet.
ThemeOptions What AddFormaThemes configures: the themes registered, in the order a reader is offered them, and the Default choice.
ThemeRegistry The themes registered and the default, resolving a choice naming a theme that isn't registered to the default theme in the choice's scheme preference, and a theme with a light scheme alone to its light scheme.
ThemeChoice What a reader chose: a theme's name and a ColorSchemePreference.
ThemeAttributes The two attributes an element names its theme and its scheme in, data-forma-theme and data-forma-scheme, each scheme preference's value, and the attributes an element carries to draw a choice.
ThemePreference A choice as a host's store keeps it, with the revision Forma numbered it by.
IThemeState The choice a user scope draws, announced to its subscribers as it changes.
IThemeSwitch Requests a choice for every runtime on the page.
IThemePreferenceStore The store a host implements to keep a signed-in reader's preference on every device.
ColorSchemes The color schemes a theme is drawn in, Light and Dark, combined as flags.
ColorSchemePreference The color scheme a reader prefers a theme drawn in: System, the device's, Light or Dark.
using Forma.Framework.Themes;

var schemes = ColorSchemes.Light | ColorSchemes.Dark;
var preference = ColorSchemePreference.System;

License

Apache License 2.0, under the repository's LICENSE.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (7)

Showing the top 5 NuGet packages that depend on formaui-net.Framework.Themes:

Package Downloads
formaui-net.Blazor

A Blazor component library for .NET 11: form inputs and pickers, dialogs, popovers and toasts, toolbars and menus, tabs and layout, file pickers, uploaders and viewers, icons, emoji and windows.

formaui-net.Blazor.Server

The server half of Forma's component library: what a host that renders on the server needs beside the components, the document head FormaPageHead and the registration that adds the interactive server circuit's integrations.

formaui-net.Framework.Themes.WebView

One theme choice for a whole application, across every web view in every native window: read from the application's store as it starts, kept there as it changes, and drawn from its first paint in every document a web view that implements IWebViewDocuments creates.

formaui-net.Framework.Themes.Browser.Interop

The page's theme coordinator: one per document, it orders every theme switch on the page, keeps the accepted choice in the browser's record and the host's store in order, and delivers it to the theme state of every runtime registered with it, each Interactive Server circuit and WebAssembly runtime on the page, so they converge on one choice.

formaui-net.Framework.Themes.Blazor.Server

The theme system's server half: each request's theme choice, resolved from a host's store, the browser's record and the default, the record kept beside the store, a choice a host gives a request, the theme marker a page publishes, the endpoint a statically rendered picker posts to, and the variation a host's output cache adds.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0-preview.27 72 12/3/2026
1.0.0-preview.26 87 12/3/2026
1.0.0-preview.25 92 12/2/2026
1.0.0-preview.24 116 12/1/2026
1.0.0-preview.23 158 11/30/2026
1.0.0-preview.22 163 11/30/2026
1.0.0-preview.21 165 11/29/2026

What this release changed is in Forma's changelog: https://github.com/FormaUI/Forma/blob/v1.0.0-preview.27/CHANGELOG.md