Skip to content

Native Support for Light/Dark Mode in AsciiDoc Using This Theme

Is there a way for this theme to natively support both dark and light backgrounds while using the same AsciiDoc source file?

Workarounds are possible for images, but not for elements like font colors. For instance, when images need two variants depending on the background, we can manually create paired files such as my-image-bg-dark.svg and my-image-bg-light.svg, define a variable at the top of the master document, and rely on AsciiDoc’s conditional directives. However, this approach clutters the document and doesn’t scale well.

It would be helpful if the Vite engine could automatically select the correct image variant (or apply the appropriate styling) depending on a parameter in vite.config.ts, or another configuration mechanism.

Could you provide native support or suggest a cleaner solution that enables seamless light/dark mode handling without duplicating content or overloading the AsciiDoc files?