RFR: 8342705: Add dark mode for docs
Hannes Wallnöfer
hannesw at openjdk.org
Tue Jul 15 11:15:39 UTC 2025
On Tue, 8 Jul 2025 13:22:20 GMT, Hannes Wallnöfer <hannesw at openjdk.org> wrote:
> Please review an enhancement to add a dark theme to javadoc-generated API documentation. There is a new button in the top right corner that brings up a menu to switch between themes. Available options are "Light", "Dark", and "System Setting" (following the system-wide theme setting). The selected theme is stored and preserved across browser sessions.
>
> Generated docs [can be viewed here](https://cr.openjdk.org/~hannesw/8342705/api.02/) (`java.base` module only). The docs were generated with syntax highlighting enabled in order to view the highlighting themes, although that is obviously not part of the change.
I'm finding the orange link color a bit too flashy, so I [created a new snapshot](https://cr.openjdk.org/~hannesw/8342705/api.03/index.html) that uses a pale blue color for links. This results in a less striking color scheme that is more in line with the default light theme IMO.
I also realized that there is no requirement in terms of a11y to use a particular link color for navigation links, so I switched to a neutral color for links [in the subnavigation and sidebar](https://cr.openjdk.org/~hannesw/8342705/api.03/java.base/java/lang/StringBuilder.html), which further "calms" the layout and improves readability IMO.
I haven't updated the PR yet and posting this here for discussion.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26185#issuecomment-3073193599
More information about the javadoc-dev
mailing list