Do not use width/height auto important to avoid enlarging smaller images

This commit is contained in:
Henrik Giesel 2021-07-21 14:27:10 +02:00 committed by Damien Elmes
parent a1df49b11e
commit a09187007d

View file

@ -35,10 +35,8 @@ export class EditableContainer extends HTMLDivElement {
const imageIndex = sheet.insertRule("anki-editable img {}");
this.imageRule = sheet.cssRules[imageIndex] as CSSStyleRule;
this.imageRule.style.setProperty("width", "auto", "important");
this.imageRule.style.setProperty("height", "auto", "important");
this.imageRule.style.setProperty("max-width", "min(250px, 100%)", "important");
this.imageRule.style.setProperty("max-height", "min(250px, 100%)", "important");
this.imageRule.style.setProperty("max-height", "200px", "important");
}
initialize(color: string): void {