This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy under /_llms/. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

Skip to main content Skip to navigation

StyleServiceExtensions Pennington.UI.Styling

DI registration for the StyleRegistry and its diag styles command.

Methods

AddPenningtonStyles

#
public static IServiceCollection AddPenningtonStyles(IServiceCollection services, IReadOnlyDictionary<string, string> templateSkin = null, Func<IReadOnlyDictionary<string, string>> styleOverrides = null, Func<string, string, string> classMerger = null)

Registers the StyleRegistry. Site templates call this internally with their skin; bare hosts composing Pennington.UI components directly can call it themselves (the components fall back to the built-in defaults when nothing is registered). When called more than once the last registration wins; the diag command is registered once.

Parameters

services IServiceCollection
The service collection.
templateSkin IReadOnlyDictionary<string, string>
Per-slot replacements a site template applies over the component defaults.
styleOverrides Func<IReadOnlyDictionary<string, string>>
Factory returning the consumer's per-slot overrides, re-invoked per resolve.
classMerger Func<string, string, string>
Tailwind-aware class merge for the override layer — typically MonorailCssService.CreateClassMerger(...). When null an override is appended without conflict resolution; site templates always supply one so overrides knock out conflicting skin/default utilities.

Returns

IServiceCollection

Pennington.UI.Styling.StyleServiceExtensions

namespace Pennington.UI.Styling;

/// DI registration for the StyleRegistry and its diag styles command.
public class StyleServiceExtensions
{
    /// Registers the StyleRegistry. Site templates call this internally with their skin; bare hosts composing Pennington.UI components directly can call it themselves (the components fall back to the built-in defaults when nothing is registered). When called more than once the last registration wins; the diag command is registered once.
    
public static IServiceCollection AddPenningtonStyles(IServiceCollection services, IReadOnlyDictionary<string, string> templateSkin = null, Func<IReadOnlyDictionary<string, string>> styleOverrides = null, Func<string, string, string> classMerger = null)
; }