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

Correct image based on "data-mode" #815

Closed
ghost opened this issue Dec 26, 2022 · 7 comments
Closed

Correct image based on "data-mode" #815

ghost opened this issue Dec 26, 2022 · 7 comments

Comments

@ghost
Copy link

ghost commented Dec 26, 2022

Checklist

  • [x ] I have read the newlest tutorials and know the correct effect of the functional design.
  • [x ] There is no similar question on existing issues (including closed ones).
  • [x ] I have tried to find the answer on Jekyll Forum and StackOverflow.
  • [x ] My question is based on the latest code of the master branch.

Description

I actually came across a similar question:
#481

However, my images are not exclusively diagrams, so I can't really use mermaid.

I wonder if there is a solution that would take "data-mode" into account and choose the correct image based on that.

If I insert something like "prefers-color-scheme" CSS media feature, but how would the markdown look?
Is it even feasible, so that I don't waste my time for no reason?

@ghost ghost added the question label Dec 26, 2022
@sunnamed434
Copy link

As I understand this could be done like that, but this is not working for me

@ghost
Copy link
Author

ghost commented Jan 4, 2023

Thanks a lot, for some reason I managed to miss this part of the tutorial about images, although I saw the part about shadow effect.. Anyway I'll try it as soon as I get home.

@ghost
Copy link
Author

ghost commented Jan 5, 2023

![Light mode only](/path/to/light-mode.png){: .light }
![Dark mode only](/path/to/dark-mode.png){: .dark }

Unfortunately, this solution does not work for some reason

@ghost
Copy link
Author

ghost commented Jan 5, 2023

I get it, you need to update theme to 5.4.0 and then everything works!

@sunnamed434
Copy link

sunnamed434 commented Jan 11, 2023

I get it, you need to update theme to 5.4.0 and then everything works!

What command name to update theme?

@NichtsHsu
Copy link
Contributor

I get it, you need to update theme to 5.4.0 and then everything works!

What command name to update theme?

Please check https://chirpy.cotes.page/posts/getting-started/#upgrading

@sunnamed434
Copy link

I get it, you need to update theme to 5.4.0 and then everything works!

What command name to update theme?

Please check https://chirpy.cotes.page/posts/getting-started/#upgrading

thx, works fine now

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

No branches or pull requests

3 participants