typedoc-theme-dark
v0.0.5
Published
Dark/light (prefers-color-scheme) theme for TypeDoc.
Downloads
5
Maintainers
Readme
Dark/light theme for TypeDoc
This theme will use the color scheme the user prefers. Setting CSS variables to set the color variables. Defaults to the dark theme if no preference.
@media (prefers-color-scheme: dark)
Install
npm add --dev typedoc-theme-dark
Usage
typedoc ./file.ts --theme ./node_modules/typedoc-theme-dark/dist/dark/
Build
To make a build:
npm run build
This puts the theme you want to use in dist/dark/
.
typedoc ./file.ts --theme path/to/dist/dark/
Custom CSS Variables
I put a good effort into updating all the colors to use CSS Variables. This allows us to use the built in @media(prefers-color-scheme: x)
to change the color. If you want to make a theme with color schemes, this might be good to fork and start with.
See: src/default/assets/css/_constants.sass
As a side note, this seems to work for me. I forked the https://github.com/TypeStrong/typedoc-default-themes repo and kept a lot of things. If there is something wrong or could be done better, make an issue or merge request.
Visit https://typedoc.org/ to learn more about TypeDoc. Theme Docs: https://typedoc.org/guides/themes/
License
Copyright (c) 2020 Dave Lage Copyright (c) 2015 Sebastian Lenz. Copyright (c) 2016-2020 TypeDoc Contributors. Licensed under the Apache License 2.0.