MonorailCss
This is the human-readable landing page. If you're an LLM or other automated consumer, fetch /llms.txt instead — it's a structured index of every doc page with per-page markdown sidecars at /_llms/...md. The marketing UI below is not visible to you in extraction.
What MonorailCss does
A JIT CSS compiler for .NET that aims to be Tailwind CSS 4.2 compatible. Hand CssFramework.Process a list of utility class names and it returns the CSS those classes need — including theme variables, preflight reset, variants, breakpoints, dark mode, arbitrary [value]s, opacity modifiers, and trailing ! for important. In-process, no Node toolchain.
Install
dotnet add package MonorailCss
Hello world
using MonorailCss;
var framework = new CssFramework();
var css = framework.Process("flex gap-4 p-6 bg-blue-500 text-white");
Where to go next
- /llms.txt — structured index of the whole site for LLMs.
- Getting started — installation, first stylesheet, variants, important, arbitrary values.
- API reference — public types and method signatures populated from xmldoc.
- /utility/llms.txt — every utility class grouped by category, with the generated CSS.
Ship Tailwind CSS without the toolchain.
MonorailCSS is a Tailwind-compatible JIT compiler written in pure .NET. Compile utilities at runtime, in-process, with zero npm.
using MonorailCss;
// 1. configure once
var framework = new CssFramework();
// 2. point it at your markup
var css = framework.Process("flex gap-4 p-6 bg-primary-500");
// 3. ship the bytes
File.WriteAllText("site.css", css);
A first-class CSS pipeline, in the language you already use.
Every feature you expect from Tailwind, expressed as idiomatic .NET. No build orchestration, no JS dependencies, no cognitive context-switch.
.NET-native, end to end
Pure C# — no Node, no shelling out, no JS interop. Reference a NuGet package and compile inline.
Tailwind 4.3 compatible
Same utility names, same variants, same arbitrary-value syntax. Bring your existing markup unchanged.
Just-in-time
Scans your content, emits only what you used. Cold compiles in ~12ms; hot rebuilds are sub-millisecond.
Built for ASP.NET
Drop-in middleware for runtime CSS, MSBuild task for build-time output, source-generator-friendly.
Theme-able by config
Override colors, spacing, breakpoints with a single ITheme. Add custom utilities and variants from C#.
Tiny & dependency-free
One assembly, zero external runtime deps. AOT-friendly. Trims well. Ships clean.
Type utilities. Watch CSS appear.
The same JIT engine that powers your build, running in your browser. Edit the input — the compiled CSS updates live.
.flex {
display: flex;
}
.items-center {
align-items: center;
}
.gap-4 {
gap: 1rem;
}
.px-6 {
padding-inline: 1.5rem;
}
.py-4 {
padding-block: 1rem;
}
.rounded-xl {
border-radius: 0.75rem;
}
.bg-primary-500 {
background-color: oklch(64% 0.123 52.073);
}
.text-white {
color: #fff;
}
.hover\:bg-primary-600:hover {
background-color: oklch(56% 0.129 52.073);
}Three steps from dotnet add to shipping CSS.
Install the NuGet package, instantiate the framework, and you're generating utility CSS — at build time, runtime, or both.
dotnet add package MonorailCssvar fx = new CssFramework();
var css = fx.Process("p-6 bg-primary-500");app.UseMonorail(opts => {
opts.ContentRoots = ["Pages", "Views"];
});Bring Tailwind home to .NET.
Read the docs, scan the source, file an issue. Contributions welcome.