I'm using the latest drf-spectacular-sidecar which has Swagger 5.31 with dark mode support. However, I can't figure out how to get the dark mode toggle on my API page. I tried using the standalone preset:
SPECTACULAR_SETTINGS = {
'SWAGGER_UI_SETTINGS': {
'presets': ['SwaggerUI.presets.ApisPreset', 'SwaggerUIStandalonePreset'],
},
}
But that just made my page not render at all. Do I need to do something on my SpectacularSwaggerView? I tried adding 'SwaggerUIStandalonePreset' to SwaggerUIBundle(...presets...) in drf_spectacular/swagger_ui.js but that didn't make a difference. If I add class="dark mode" to the tag in drf_spectacular/swagger_ui.html then that works, but then it's just stuck in dark mode without a toggle.
Has anyone gotten dark mode to work with drf-spectacular-sidecar?
I'm using the latest drf-spectacular-sidecar which has Swagger 5.31 with dark mode support. However, I can't figure out how to get the dark mode toggle on my API page. I tried using the standalone preset:
But that just made my page not render at all. Do I need to do something on my SpectacularSwaggerView? I tried adding 'SwaggerUIStandalonePreset' to SwaggerUIBundle(...presets...) in drf_spectacular/swagger_ui.js but that didn't make a difference. If I add class="dark mode" to the tag in drf_spectacular/swagger_ui.html then that works, but then it's just stuck in dark mode without a toggle.
Has anyone gotten dark mode to work with drf-spectacular-sidecar?