-
Notifications
You must be signed in to change notification settings - Fork 865
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
[Feature Request] Images for light and dark theme #9386
Comments
+1 |
1 similar comment
+1 |
Until this feature is implemented, do you known of any trick or workaround how to provide different images (and some icons) based on the theme? |
Or at least set light theme as default and disable theme switcher without deep diving into custom template creation... |
It depends on the logo, but it's possible to create a transparent background logo which will work in light and dark themes. |
You can achieve that by adding a custom template and a #logo {
margin-right: 10px;
}
[data-bs-theme=dark] #logo {
content:url("../images/dark-logo.png");
}
[data-bs-theme=light] #logo {
content:url("../images/light-logo.png");
} I have created a sample repo and a sample demo site if needed. |
Describe the solution you'd like
docfx has a switcher in the header that lets readers choose between the light and the dark theme. If applicable authors should provide both the light and the dark version of every screenshot used in the documentation.
Additional context
Add the
_dark.png
suffix to the name of the dark image version. This image will be then used when the user switches to the dark theme.For example, save images as
example.png
andexample_dark.png
.The text was updated successfully, but these errors were encountered: