API Reference
The customer-facing surface of MonorailCss.
Public types you'll touch when configuring or extending the engine.
Main entry point for the MonorailCss framework. Processes Tailwind CSS utility classes and generates optimized CSS output.
Constructors
2
|
Initializes a new instance of the CssFramework class. Initializes a new instance of the CssFramework with default configuration. |
|
Initializes a new instance of the CssFramework class. Initializes a new instance of the CssFramework with custom settings. |
Properties
1
|
Gets the settings this framework was constructed from, after any constructor-time adjustments (e.g. ProseCustomization applied to the theme). Use this when you need to layer additional configuration on top — for example, the discovery library merges CSS-derived theme tokens, custom utilities, and custom variants into a fresh framework built from these settings. |
Methods
10
|
Adds a custom utility to the framework at runtime. The utility will be registered with proper priority ordering. |
|
Adds multiple custom utilities to the framework at runtime. The utilities will be registered with proper priority ordering. |
|
Adds a custom variant to the framework at runtime. |
|
Processes a string of CSS classes and returns the generated CSS. |
|
Processes a collection of CSS class names and returns the generated CSS. |
|
Tests whether a single token would parse as a valid utility candidate. Use as a fast validator when filtering arbitrary strings (e.g. extracted from IL user-string heaps) before feeding them to Process. Never throws — returns false for null, empty, or unparseable input. |
|
Gets the names of all registered static utilities (e.g. "flex", "block", "hidden"). Used by the discovery library to build a fast pre-filter that distinguishes candidate strings from natural-language strings before invoking the full parser. |
|
Gets the roots of all registered functional utilities (e.g. "bg", "text", "p", "m"). Used by the discovery library to build a fast pre-filter that distinguishes candidate strings from natural-language strings before invoking the full parser. |
|
Processes multiple CSS class strings and returns the combined generated CSS. |
|
Compiles a single utility class and returns its CSS declarations. This applies modifier processing (opacity, negative values, !important, variable fallbacks). Useful for documentation and debugging purposes. |
Represents configuration settings for the CSS framework, including theme customization, variant handling, and other framework-level options.
Constructors
1
|
Initializes a new instance of the CssFrameworkSettings class. |
Properties
10
|
Gets the theme configuration used by the framework, including design tokens and scales. |
|
Gets the set of enabled variant identifiers (e.g., responsive breakpoints, state variants). |
|
Gets a value indicating whether generated utilities should be emitted with the !important flag. |
|
Gets a value indicating whether the framework's base (preflight) styles should be included. |
|
Gets a map of custom apply rules where the key is a CSS selector (or alias) and the value is a space-separated list of utility class names to apply. Each utility may carry variants such as hover: or md:. Raw CSS declarations are supported (mirroring Tailwind's @apply, which accepts utilities only); use arbitrary-value utilities like bg-[color-mix(in_oklab,red,blue)] to emit literal values. |
|
Gets the optional customization for prose/typographic styles. |
|
Gets a list of custom utility definitions to be registered with the framework. These are typically parsed from @utility blocks in CSS source files. |
|
Gets a list of custom variant definitions to be registered with the framework. These are typically parsed from @custom-variant directives in CSS source files. Each variant definition includes a name and selector pattern (e.g., "scrollbar" with "&::-webkit-scrollbar"). |
|
Gets the mode that controls which --color-* CSS variables are emitted in the generated output. Defaults to UsedPalettes so that dynamic class names (e.g. bg-sky-700 rendered after build) resolve correctly. |
|
Gets a map of animation name → keyframes body, populated from @keyframes blocks declared inside any @theme flavor (regular, inline, static, static inline). Used by the CSS generator to emit a top-level @keyframes rule whenever the matching --animate-{name} theme variable ends up in the output; user entries override the built-in defaults (spin, ping, pulse, bounce) on name collision. |
Controls which --color-* theme variables are emitted in the generated CSS.
Values
3
|
Only emit color variables actually referenced by generated CSS. |
|
For every used --color-{palette}-{shade}, also emit every other shade in that palette. Singletons such as --color-black are unaffected. |
|
Emit every --color-* variable defined in the theme. |
Represents a custom variant definition for extending the framework's built-in variants.
Properties
3
|
Gets the variant name (e.g., "scrollbar", "scrollbar-track"). |
|
Gets the selector pattern, typically using & for parent reference. Example: "&::-webkit-scrollbar" or "&::-webkit-scrollbar-track". |
|
Gets the weight for ordering. Lower values appear earlier in the output. Defaults to 490 (just before built-in pseudo-elements at 500+). |