-
Notifications
You must be signed in to change notification settings - Fork 33
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
CSS: Add bright background to images when using dark theme #309
Conversation
✅ Deploy Preview for trusting-archimedes-14c863 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
@@ -89,3 +89,8 @@ html[data-theme='dark'] .docusaurus-highlight-code-line { | |||
.theme-doc-sidebar-menu { | |||
font-size: 14px; | |||
} | |||
|
|||
/* Hack to make .svg and .png diagrams readable in dark theme */ | |||
html[data-theme='dark'] main img { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we'll be adding some transparent themed images: img:not([class^="themedImage"])
(not the most stable element selector but, https://docusaurus.io/docs/markdown-features/assets#themed-images
compiles un-themed images as <img class="img_vXGZ">
and themed images as <img class="themedImage_qLAv themedImage--dark_ONYO">
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh. and :not([src$='#gh-dark-mode-only'])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really - I imagined when #308 is done properly, then each image must either be universal (good to read both on light and dark background) or themed (one image for light, other for dark theme). Your hack would always set the background for universal images when on the dark background even though they should be readable fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep yep
A temporary hack to mitigate #308. Adds white background to images when switching to dark theme.