Skip to content

Latest commit

 

History

History
29 lines (15 loc) · 1.36 KB

README.md

File metadata and controls

29 lines (15 loc) · 1.36 KB

swagger-compact-css

A compact swagger stylesheet for use with .net swashbuckle and other swagger UI implementations. Less unused white space and scrolling.

  1. Add the custom.css stylesheet to your wwwroot/swagger-ui/ directory just like it is in this repo.
  2. Edit your program.cs file and add InjectStylesheet to your SwaggerUI options and specify the same file as in step 1 .InjectStylesheet("/swagger-ui/custom.css");.
  3. Then add UseStaticFiles() to your app configuration.

image

Default UI (before custom CSS)

Info section takes up 1/3 of the page, need to move the mouse across the screen and back to "Try This Out" and "Execute" then scroll down futher to see the response. alt-text-1

Compact UI (after custom CSS)

All buttons on the left with the info section in a side bar, no wasted white space and this particular response is visible without scrolling down. alt-text-2

with .NET theme

image