Resize image

Wonderful. I have something similar set in CSS, but native is much better, so I don’t need to maintain the CSS across vaults - plus it’s entirely customizable. Thanks @rigmarole !

Since it sounds like you’re pretty in the know here, do you have any idea if there plans or feature requests to support % for alttext|width notation, as a function of window width?

In my CSS, I have some categories that I’ve picked for convenience that use this (though mine uses both px and % to arrive at a max. It might be a fairly simple feature to implement by appending a % to the end of the number, so if there’s no feature request I’d be interested in creating one.

![sm](image.png)
![md](image.png)
![lg](image.png)
.markdown-preview-view img[alt="sm"] {
  width: max(300px,30%);
  max-height:auto;
}
.markdown-preview-view img[alt="md"] {
  width: max(500px,50%);
  max-height:auto;
}
.markdown-preview-view img[alt="lg"] {
  width: max(1080px,70%);
  max-height:auto;
}

Edit: apologies for the laziness in asking here - I have a TODO for myself to look into this in the future, but currently have a lot of things going on and unable to, so figure it’s worth a shot to ask :slight_smile: If I find anything, I’ll follow-up here!

8 Likes