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

MonorailCssService Pennington.MonorailCss

Wraps the discovery-pipeline output with Pennington's stylesheet prefix (ContentVisibilityRules + ExtraStyles) and serves the result on every /styles.css hit.

Constructors

MonorailCssService

#
public MonorailCssService(MonorailCssOptions options, IClassRegistry classRegistry)

Wraps the discovery-pipeline output with Pennington's stylesheet prefix (ContentVisibilityRules + ExtraStyles) and serves the result on every /styles.css hit.

Parameters

options MonorailCssOptions
MonorailCSS configuration options.
classRegistry IClassRegistry
Live snapshot of classes + generated CSS from the runtime scanner.

Methods

CreateClassMerger

#
public static Func<string, string, string> CreateClassMerger(MonorailCssOptions options)

Builds a fully-configured CssFramework from Pennington's options. Used during DI registration to seed Framework; the discovery pipeline may then rebuild the framework when it processes source CSS.

Parameters

options MonorailCssOptions
MonorailCSS options whose framework defines the merge conflicts.

Returns

Func<string, string, string>

GetStyleSheet

#
public string GetStyleSheet()

Builds the stylesheet from scratch on every call: a fresh CssFramework processes the current class set from GetClasses. This deliberately skips Css (which caches against the framework that was baked into MonorailDiscoveryOptions.Framework at startup). Combined with transient lifetimes on MonorailCssOptions and this service (see MonorailServiceExtensions.AddMonorailCss), edits to ColorScheme, prose customizations, and CustomCssFrameworkSettings flow into the served stylesheet on the next request without a process restart. Pennington is a static content engine — the build is one-shot and the dev server is the only other consumer, so per-call rebuild is the right tradeoff.

Returns

string

Pennington.MonorailCss.MonorailCssService

namespace Pennington.MonorailCss;

/// Wraps the discovery-pipeline output with Pennington's stylesheet prefix (ContentVisibilityRules + ExtraStyles) and serves the result on every /styles.css hit.
public class MonorailCssService
{
    /// Builds a fully-configured CssFramework from Pennington's options. Used during DI registration to seed Framework; the discovery pipeline may then rebuild the framework when it processes source CSS.
    
public static Func<string, string, string> CreateClassMerger(MonorailCssOptions options)
; /// Builds the stylesheet from scratch on every call: a fresh CssFramework processes the current class set from GetClasses. This deliberately skips Css (which caches against the framework that was baked into MonorailDiscoveryOptions.Framework at startup). Combined with transient lifetimes on MonorailCssOptions and this service (see MonorailServiceExtensions.AddMonorailCss), edits to ColorScheme, prose customizations, and CustomCssFrameworkSettings flow into the served stylesheet on the next request without a process restart. Pennington is a static content engine — the build is one-shot and the dev server is the only other consumer, so per-call rebuild is the right tradeoff.
public string GetStyleSheet()
; /// Wraps the discovery-pipeline output with Pennington's stylesheet prefix (ContentVisibilityRules + ExtraStyles) and serves the result on every /styles.css hit.
public MonorailCssService(MonorailCssOptions options, IClassRegistry classRegistry)
; }