-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Support GitHub theme-conditional images in README / Marketplace page #139556
Comments
Github uses CSS so I assume something will be added to the default preview styles to implement this, e.g: @media (prefers-color-scheme: light) {
:root[data-color-mode=auto] .entry-content [href$="#gh-dark-mode-only"],
:root[data-color-mode=auto] .comment-body [href$="#gh-dark-mode-only"],
:root[data-color-mode=auto] .readme [href$="#gh-dark-mode-only"] {
display: none;
}
}
@media (prefers-color-scheme: dark) {
:root[data-color-mode=auto] .entry-content [href$="#gh-light-mode-only"],
:root[data-color-mode=auto] .comment-body [href$="#gh-light-mode-only"],
:root[data-color-mode=auto] .readme [href$="#gh-light-mode-only"] {
display: none;
}
} |
MP request is captured by this microsoft/vsmarketplace#281 |
This would also make the README.md look right on https://open-vsx.org/ |
We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider. If you wonder what we are up to, please see our roadmap and issue reporting guidelines. Thanks for your understanding, and happy coding! |
😢 -- have to say I'm disappointed with this one getting closed. There isn't a way for extension authors to have good looking logos/images, because VS Code is fully themeable, GitHub has light & dark, and the marketplace is always light (currently). |
See https://github.blog/changelog/2021-11-24-specify-theme-context-for-images-in-markdown/
Will only show on dark themes
![GitHub-Mark-Light](https://user-images.githubusercontent.com/3369400/139447912-e0f43f33-6d9f-45f8-be46-2df5bbc91289.png#gh-dark-mode-only)
Will only show on light themes
![GitHub-Mark-Dark](https://user-images.githubusercontent.com/3369400/139448065-39a229ba-4b06-434b-bc67-616e2ed80c8f.png#gh-light-mode-only)
Example (notice only 1 image will show up and be dependent on the light vs dark theme):
I've filed this as a bug, because if someone tries to use this on their GitHub README it will work great, but then break on the extension's page and the marketplace.
/cc @misolori @sandy081 @isidorn
The text was updated successfully, but these errors were encountered: