KhronosGroup / antora-ui-khronos

Default UI for Khronos Antora sites, forked 2023-03-12 from https://gitlab.com/antora/antora-ui-default at commit 41b1c83f648a656fcbb274a8003d7292ba4136b0
Mozilla Public License 2.0
5 stars 3 forks source link

Dark theme #11

Open gpx1000 opened 3 months ago

gpx1000 commented 3 months ago

This will setup the dark theme based upon your browser preferences settings.

SaschaWillems commented 3 months ago

Gave this a quick spin, and it's already looking pretty nice. But before we get this out of the door we need to fix a few things. Right out of the box, there are elements that don't look good in dark mode.

Note: I only checked samples, guide and tutorial (not the spec) and also only did a quick runthrough.

E.g. the top bar:

image

The search bar doesn't match the dark theme, and the navigation links are black on dark red, which is pretty low in contrast, making them very hard to read.

Also the search term is almost impossible to read with dark gray on darker gray, esp. as the result popover is still white:

image

Same for the breadcrumb, which is gray on gray and very hard to read:

image

Bottom navigation also needs fixing:

image

Same for pages with right hand navigation:

image

Source highlighting also needs to be adjusted, as it currently has some very low contrast elements:

image

We also need to find a way to deal with transparent images that are pretty much unreadable now, like this from the Index buffer chapter of the tutorial:

image

Or the start page of the guide:

image

We should also adjust the link color, as the dark blue on black doesn't have a good contrast or visibility:

image

To sum it up: Great first step, but those tiny bits to make it work and look good for all content is probably gonna take quite some time and effort ;)

SaschaWillems commented 2 months ago

Maybe we can take some queues from https://docs.spring.io/spring-framework/reference/overview.html

They also use Antora and have a dark mode toggle.

The site also seems to do some additional things that could be interesting for our docs site including a programming language toggle.

SaschaWillems commented 1 month ago

Maybe we could take some queues from dark mode extensions (e.g. Dark reader for Chrome). This is what the site looks for me with that extension:

docs vulkan org_tutorial_latest_03_Drawing_a_triangle_00_Setup_00_Base_code html

Not perfect but very decent. It's using a color scheme similar to what I use on https://www.gpuinfo.org/

Dark mode seems to be the no 1 request for our docs site btw. So maybe we could prioritize this a bit ;)