anki/ts/editable/ResizableImage.svelte
Damien Elmes cfe1b79737 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.
2022-12-24 12:57:38 +10:00

20 lines
611 B
Svelte

<!--
Copyright: Ankitects Pty Ltd and contributors
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, inherit);
max-height: var(--editor-default-max-height, inherit);
&:is([data-editor-shrink="true"]) {
max-width: var(--editor-shrink-max-width);
max-height: var(--editor-shrink-max-height);
}
&:is([data-editor-shrink="false"]) {
max-width: initial;
max-height: initial;
}
}
</style>