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

Port labs 11-13 #23

Merged
merged 2 commits into from
May 3, 2024
Merged

Port labs 11-13 #23

merged 2 commits into from
May 3, 2024

Conversation

votroto
Copy link
Collaborator

@votroto votroto commented May 3, 2024

Request to port labs 11 to 13 from CW.

labs/lab11.md Outdated
Comment on lines 1 to 7
<style>
@media (prefers-color-scheme: dark) {
.inverting-image {
filter: invert(1);
}
}
</style>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh, cool! I just didn't worry about dark versions of images that much yet so it would be great to have an automatic way to do this.

somehow for me only the dark versions of the images are showing up now though. I think there is a way of using two different files for everything by adding a .vitepress/theme/index.js file with:

// .vitepress/theme/index.js
import DefaultTheme, { VPImage } from 'vitepress/theme';

export default {
  extends: DefaultTheme,
  enhanceApp({ app }) {
    // https://github.com/vuejs/vitepress/issues/2813#issuecomment-1683915241
    app.component('Image', VPImage);
  }
};

according to vuejs/vitepress#2814. so in the md files we could then do something like

<Image alt="Logo" :image="{ light: '/logo.svg', dark: '/logo-dark.svg' }" />

but I have no idea how to do that with the css invert (which I really like because then we only need one image :P) any ideas?

@nmheim nmheim merged commit 292687c into main May 3, 2024
2 checks passed
@nmheim nmheim deleted the port1113 branch May 3, 2024 17:01
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

Successfully merging this pull request may close these issues.

2 participants