MonorailServiceExtensions
Pennington.MonorailCss
Extension methods for registering and configuring MonorailCSS services.
Methods
AddMonorailCss
#public static IServiceCollection AddMonorailCss(IServiceCollection services, Func<IServiceProvider, MonorailCssOptions> optionFactory = null)
Registers MonorailCSS services and the runtime class-discovery pipeline. With no configuration, the discovery pipeline force-loads every non-BCL assembly the app references, scans each one's IL, watches the project's source files in development, and loads wwwroot/app.css as the source CSS prefix when present. The CSS endpoint served by UseMonorailCss regenerates whenever the class set changes.
Parameters
servicesIServiceCollection- The service collection.
optionFactoryFunc<IServiceProvider, MonorailCssOptions>- Optional factory for configuring MonorailCSS options.
Returns
IServiceCollectionUseMonorailCss
#public static WebApplication UseMonorailCss(WebApplication app, string path = "/styles.css")
Maps the MonorailCSS stylesheet endpoint. The endpoint pulls the current class set from the discovery pipeline registered in AddMonorailCss, generates CSS, and serves it.
Parameters
appWebApplication- The web application.
pathstring- The URL path for the stylesheet endpoint. Defaults to "/styles.
css".
Returns
WebApplicationPennington.MonorailCss.MonorailServiceExtensions
namespace Pennington.MonorailCss;
/// Extension methods for registering and configuring MonorailCSS services.
public class MonorailServiceExtensions
{
/// Registers MonorailCSS services and the runtime class-discovery pipeline. With no configuration, the discovery pipeline force-loads every non-BCL assembly the app references, scans each one's IL, watches the project's source files in development, and loads wwwroot/app.css as the source CSS prefix when present. The CSS endpoint served by UseMonorailCss regenerates whenever the class set changes.
public static IServiceCollection AddMonorailCss(IServiceCollection services, Func<IServiceProvider, MonorailCssOptions> optionFactory = null)
;
/// Maps the MonorailCSS stylesheet endpoint. The endpoint pulls the current class set from the discovery pipeline registered in AddMonorailCss, generates CSS, and serves it.
public static WebApplication UseMonorailCss(WebApplication app, string path = "/styles.css")
;
}