string Value { get; }
Source
Gets the canonical identifier value.
Registers immutable AppSurface theme-pair services for a host.
IServiceCollection AddAppSurfaceTheming(this IServiceCollection services, Action<AppSurfaceThemeRegistryOptions> configure)
Validates and registers configured semantic pairs and their default resolver.
services
configure
The original services
instance.
ArgumentNullException
null
.AppSurfaceThemeValidationException
IServiceCollection AddAppSurfaceTheming(this IServiceCollection services, AppSurfaceThemeRegistryOptions options)
Validates and registers an explicit semantic pair configuration snapshot.
services
options
The original services
instance.
ArgumentNullException
null
.AppSurfaceThemeValidationException
IServiceCollection AddRequiredThemeExtension<TSettings>(this IServiceCollection services)
Requires an application-owned extension provider to cover every configured semantic pair.
TSettings
services
The original services
instance.
ArgumentNullException
services
is null
.AppSurfaceThemeValidationException
IAppSurfaceThemeRegistry
is first resolved and the provider is missing (ASTHEME201) or supplies no non-null setting for a registered pair (ASTHEME202). This method itself does not throw it.
Register IAppSurfaceThemeExtensionProvider{TSettings}
before the neutral registry is first resolved. The provider remains application-owned: this method verifies only provider presence and one non-null setting for each registered pair. It neither validates, serializes, nor logs TSettings
.
Identifies a registered semantic theme pair.
string Value { get; }
Source
Gets the canonical identifier value.
Defines the minimum semantic color roles consumed by AppSurface-owned UI.
string Canvas { get; }
Source
Gets the primary page canvas color.
string Surface { get; }
Source
Gets the default content-surface color.
string RaisedSurface { get; }
Source
Gets the raised content-surface color.
string Text { get; }
Source
Gets the primary readable text color.
string MutedText { get; }
Source
Gets the secondary readable text color.
string Border { get; }
Source
Gets the visible border and divider color.
string Accent { get; }
Source
Gets the default accent color.
string AccentStrong { get; }
Source
Gets the high-emphasis accent color.
string Link { get; }
Source
Gets the unvisited link color.
string VisitedLink { get; }
Source
Gets the visited link color.
string Danger { get; }
Source
Gets the error and destructive-action color.
string Focus { get; }
Source
Gets the keyboard-visible focus color.
Pairs complete light and dark semantic role sets under one identifier.
AppSurfaceThemePair AppSurface()
Creates AppSurface's built-in accessible semantic pair.
A new immutable pair instance named appsurface
.
AppSurfaceThemePair Graphite()
Creates the built-in Graphite semantic light/dark pair.
A new immutable pair instance named graphite
.
Graphite is a shared semantic pair for hosts that register AppSurface theming. It is distinct from the Docs-local fixed-dark GraphiteDark
compatibility preset, which does not register a shared pair.
AppSurfaceThemeId Id { get; }
Source
Gets the canonical pair identifier.
AppSurfaceThemeRoles Light { get; }
Source
Gets the complete light role set.
AppSurfaceThemeRoles Dark { get; }
Source
Gets the complete dark role set.
Represents the sealed default pair together with its host-selected mode.
AppSurfaceThemeId Id { get; }
Source
Gets the resolved pair identifier.
AppSurfaceThemeMode Mode { get; }
Source
Gets the host-selected rendering mode.
AppSurfaceThemeRoles Light { get; }
Source
Gets the sealed light role set.
AppSurfaceThemeRoles Dark { get; }
Source
Gets the sealed dark role set.
Allows an adapter to obtain application-owned settings for a registered pair.
TSettings
bool TryGet(AppSurfaceThemeId themeId, out TSettings settings)
Attempts to get settings for the supplied sealed pair.
themeId
settings
true
when settings exist for themeId
; otherwise false
.
Configures registered theme pairs and the host's default rendering mode.
AppSurfaceThemeId DefaultTheme { get; set; }
Source
Gets or sets the pair used by IAppSurfaceThemeResolver.ResolveDefault
.
AppSurfaceThemeMode DefaultMode { get; set; }
Source
Gets or sets the host's default browser rendering mode.
IList<AppSurfaceThemePair> Pairs { get; }
Source
Gets the registered semantic light/dark pairs.
Looks up validated registered pairs by identifier.
AppSurfaceThemePair GetRequired(AppSurfaceThemeId id)
Gets a sealed pair by its canonical identifier.
id
The sealed semantic pair whose AppSurfaceThemePair.Id
equals id
.
KeyNotFoundException
id
is not registered.IReadOnlyCollection<AppSurfaceThemeId> ThemeIds { get; }
Source
Gets the non-empty, ordinally unique canonical ids of every sealed registered pair in registration order.
Each id returned by this collection must resolve through GetRequired
to a pair whose AppSurfaceThemePair.Id
equals that id. Consumers may reject implementations that do not maintain this sealed-snapshot contract.
Resolves the host-selected default theme pair.
AppSurfaceThemeResolution ResolveDefault()
Resolves the sealed pair and rendering mode configured by the host.
The host's default semantic theme resolution.
Provides a stable, safe theme configuration diagnostic.
Code
ASTHEME
diagnostic code.Severity
Problem
Cause
Fix
Documentation
AppSurfaceThemeDiagnostic Create(string code, string problem, string cause, string fix, AppSurfaceThemeDiagnosticSeverity severity = AppSurfaceThemeDiagnosticSeverity.Error)
Creates a diagnostic linked to the canonical theme troubleshooting reference.
code
problem
cause
fix
severity
A stable diagnostic with its canonical documentation link.
Thrown when a theme registry cannot produce a safe sealed snapshot.
IReadOnlyList<AppSurfaceThemeDiagnostic> Diagnostics { get; }
Source
Gets all safe diagnostics that prevented registry creation.
Validates and resolves immutable semantic theme pairs.
AppSurfaceThemePair GetRequired(AppSurfaceThemeId id)
Gets a sealed pair by its canonical identifier.
id
A defensive snapshot of the registered pair.
KeyNotFoundException
id
is not registered.AppSurfaceThemeResolution ResolveDefault()
Resolves the host-selected default pair and mode.
A defensive snapshot of the default resolution.
IReadOnlyList<AppSurfaceThemeDiagnostic> Validate(AppSurfaceThemeRegistryOptions options)
Validates a candidate registry configuration without creating a registry.
options
All stable diagnostics that prevent safe registry creation.
bool IsSafeResolution(AppSurfaceThemeResolution? resolution)
Determines whether a sealed resolution can be safely consumed by a package-owned adapter.
resolution
true
when the resolution satisfies the neutral pair contract; otherwise false
.
This predicate is intended for adapters that need a fail-closed boundary without serializing a Web document. It applies the same identifier, mode, role, and contrast checks used for registry registration.
Identifies the host-selected rendering behavior for a semantic theme pair.
Classifies the safety impact of a theme diagnostic.