swagger-ui icon indicating copy to clipboard operation
swagger-ui copied to clipboard

[Feature Request] Dark mode

Open lonix1 opened this issue 5 years ago • 27 comments

Would be nice to have a dark mode version of the UI.

lonix1 avatar Apr 24 '19 14:04 lonix1

I was going to open a issue right now on this subject hahaha

luca0898 avatar Sep 25 '20 17:09 luca0898

Poor man's dark mode:

.swagger-ui {
    filter: invert(88%) hue-rotate(180deg);
}

.swagger-ui .highlight-code {
    filter: invert(100%) hue-rotate(180deg);
}

silverwind avatar Dec 10 '20 08:12 silverwind

Yes, but this is a feature request.

KaKi87 avatar Dec 10 '20 11:12 KaKi87

For those who looking for dark mode in swagger, you can use custom CSS with a stylus plugin. https://33kk.github.io/uso-archive/?search=swagger

clementCharasson avatar Feb 08 '21 20:02 clementCharasson

There's also Dark Reader, but this shouldn't prevent Swagger from having a native dark theme ^^

KaKi87 avatar Feb 08 '21 20:02 KaKi87

Yea in my case I could build out an alternative, but swagger-ui-react sets sooooooo many default colors, I'm sure it will be brittle.

jeffersoneagley avatar Feb 16 '21 23:02 jeffersoneagley

Agreed, it must be built-in.

But to get this going, maybe someone has dark mode styles to contribute? I see other apps simply use one of the popular themes floating around: "dracula", "nord dark", etc.

I assume if we make it easy for the devs to adopt, then we'll get this feature.

lonix1 avatar Feb 17 '21 04:02 lonix1

Now that have the dark mode, can I disable it?

daniloab avatar Mar 01 '21 22:03 daniloab

There was an attempt to solve it https://github.com/swagger-api/swagger-ui/pull/5964 but for unknown reason PR was closed.

gleb-svechnikov avatar Jul 06 '21 10:07 gleb-svechnikov

Any news on this ?

ghandic avatar Oct 12 '21 09:10 ghandic

PR still closed, no other word about it. Dark mode must've killed one of the maintainers' hamster or something.

Atulin avatar Mar 21 '22 10:03 Atulin

Still a problem too.

jeffersoneagley avatar Apr 27 '22 16:04 jeffersoneagley

And most probably will continue being one: https://github.com/swagger-api/swagger-ui/pull/5964#issuecomment-1074046454

Atulin avatar Apr 27 '22 16:04 Atulin

at this point I might as well just make my own openapi compliant spec ui with dark mode supported by default I don't understand how a developer can make a light mode UI it's literally torture

mrmelon54 avatar Sep 08 '22 13:09 mrmelon54