Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dark mode support to the HTML versions of the OpenAPI specs #3866

Open
mikekistler opened this issue May 30, 2024 · 5 comments
Open

Add dark mode support to the HTML versions of the OpenAPI specs #3866

mikekistler opened this issue May 30, 2024 · 5 comments
Assignees
Labels
Housekeeping script Pull requests that update Bash or JavaScript code

Comments

@mikekistler
Copy link
Contributor

mikekistler commented May 30, 2024

Update the rendering process for the HTML versions of the OpenAPI specs (using ReSpec) to generate pages that support dark mode.

ReSpec has added dark mode support: speced/respec#2651

Related: #3576

@handrews handrews added Housekeeping script Pull requests that update Bash or JavaScript code labels May 30, 2024
@handrews
Copy link
Member

Paging @Bellangelo (we're working on making it so that we can assign issues to you, but haven't quite sorted that out yet).

@Bellangelo
Copy link
Member

Unfortunately, this seems not to be so easy. Our js/respec-oai.js file loads this css file https://www.w3.org/StyleSheets/TR/2016/base.css which overrides most styles. There is a https://www.w3.org.org/StyleSheets/TR/2026/dark.css but even if we add it, it still gets overridden by the base.css.
It looks like we need to give more effort in this issue #3845 which will help us have more control over the respec-oai.js

@ralfhandl
Copy link
Contributor

ReSpec documentation of dark mode says

Note: This is supported for W3C specs only, and makes use of official dark.css in tr-design.

We can enable the switch, and it has no effect 😞

image

@ralfhandl
Copy link
Contributor

ralfhandl commented Jul 25, 2024

@mikekistler Don't know what changed in the last two weeks, now dark mode seems to work (at least if your system theme is set to dark mode):

Quite some fine-tuning needed for dark mode to really work:

  • different OAS logos for light/dark mode
  • table and code-block background color depending on light/dark mode
  • ...

I'll gladly leave this to someone fluent in CSS 😁

@pavelkornev
Copy link
Contributor

pavelkornev commented Sep 3, 2024

I have started on this, please assign to my name.

Intermediate results can be seen here: https://pavelkornev.github.io/OpenAPI-Specification/oas/latest.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Housekeeping script Pull requests that update Bash or JavaScript code
Projects
Status: No status
Development

No branches or pull requests

5 participants