Strongly-typed CSS utility classes using C# (supports Blazor, Razor Pages and MVC)
FluentCss lets you compose Tailwind-inspired utility classes with a type-safe, chainable API. You write C#, the library generates the class names and the CSS.
Generated entirely from C#
<div class="@Css.P(6)
.RoundedLg()
.Background(Color.Emerald500)
.Color(Color.White)
.FontBold()
.Hover(h => h.Background(Color.Emerald600))">
Generated entirely from C#
</div>
Why FluentCss
Type-safe
Every utility is a method. Rename, refactor and navigate styles with the same tooling you already use for C#.
States and responsive
Compose hover, focus and active states, then layer responsive min/md and max/md variants on top.
Dark mode built in
Use the Dark builder for theme-aware styles, or Theme() for any custom theme name.
Automatic CSS
Classes are deduplicated in a registry that emits the final CSS for you.
Supports Blazor
All hosting models.
Supports MVC and Razor Pages
Some of us still love MVC.