Fix images not being constrained to field width

Appears to have regressed in #2071. I'd used 'inherit' so that the default
editable styling would impose a 100% limit, but it appears that variable
interpolation prevents the parent styling from being applied.
This commit is contained in:
Damien Elmes 2022-12-24 12:57:38 +10:00
parent ff1f5f9f7a
commit cfe1b79737
2 changed files with 4 additions and 6 deletions

View File

@ -4,8 +4,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<style lang="scss">
:global(img:not(.mathjax)) {
max-width: var(--editor-default-max-width);
max-height: var(--editor-default-max-height);
max-width: var(--editor-default-max-width, inherit);
max-height: var(--editor-default-max-height, inherit);
&:is([data-editor-shrink="true"]) {
max-width: var(--editor-shrink-max-width);

View File

@ -94,13 +94,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
`${maxHeight}px`,
);
} else {
document.documentElement.style.setProperty(
document.documentElement.style.removeProperty(
"--editor-default-max-width",
"inherit",
);
document.documentElement.style.setProperty(
document.documentElement.style.removeProperty(
"--editor-default-max-height",
"inherit",
);
}
}