Turn Swagger Theme to the Dark Mode

2 · Romans Pokrovskis · June 26, 2021, 6:49 a.m.
So you have Swagger integrated into your .NET Core Web API application. Maybe even using my previous guide . And now you want to customize it a bit. I prefer my UI’s dark. So, when I am presented with a predominantly white screen from the Swagger default theme, I immediately want to change it. Luckily SwaggerUI supports CSS injection. Here are the tweaks that we need to make: Changes for Startup.cs Enable support for static files in a Configure() method app.UseStaticFiles(); Add folder structu...