Skip to content
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

Documentation request: how to support #gh-dark-mode-only and #gh-light-mode-only #79

Open
mrquincle opened this issue Jul 19, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@mrquincle
Copy link

mrquincle commented Jul 19, 2022

Currently there's a neat github feature to define if images should be rendered in dark and/or light mode. It's something like this:

<p align="center">
  <a href="https://crownstone.rocks#gh-light-mode-only">
    <img src="https://raw.githubusercontent.com/crownstone/bluenet/master/docs/images/crownstone_logo_text_black.svg?sanitize=true" alt="Crownstone Logo in Light Mode" />
  </a>
  <a href="https://crownstone.rocks#gh-dark-mode-only">
    <img src="https://raw.githubusercontent.com/crownstone/bluenet/master/docs/images/crownstone_logo_text_white.svg?sanitize=true" alt="Crownstone Logo in Dark Mode" />
  </a>
</p>

What I'm looking for is how to adjust the css to have the same behavior. It means I've to do something like the following depending on the mode.

a[href$="gh-light-mode-only"] { 
      display:none;
}     

It would be great to get some help in how to do this. Or otherwise, some directions I how this should be done in a manner that is github compatible.

@mrquincle
Copy link
Author

For now I've added

html.dark-mode
a[href$="#\gh-light-mode-only"] {
    display: none;
}

html.light-mode
a[href$="#\gh-dark-mode-only"] {
    display: none;
}

Corrections welcome!

@jothepro jothepro added the enhancement New feature or request label Aug 17, 2022
@jothepro
Copy link
Owner

This sounds like a nice feature! Unfortunately it has been deprecated by GitHub in favor of the <picture> element.
But the <picture> tag will not be accepted by Doxygen.

Any other suggestions? My guess is that the best approach would be to open an issue at doxygen/doxygen asking for <picture> support? 🤔

@mrquincle
Copy link
Author

@mrquincle
Copy link
Author

Oh no, this is just for displaying formulas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants