anki/ts/editable/editable-base.scss
Hikaru Y 604e0f46e1
Fix and refactor image size constraints (#2318)
* Remove 'ResizableImage.svelte'

Rather than having a svelte file that just sets global styles, it's
better to set those in a (s)css file.

* Fix and refactor image size constraints

- Fixes https://forums.ankiweb.net/t/2-1-56-image-size-problem-in-editor/26207
- Use :host-context() to switch image styles instead of toggling CSS
variables.

* Fix toolbar buttons for image overlay sometimes being cut off
2023-01-13 23:18:25 +10:00

44 lines
719 B
SCSS

@use "sass/scrollbar";
* {
max-width: 100%;
}
p {
margin-top: 0;
margin-bottom: 1rem;
&:empty::after {
content: "\a";
white-space: pre;
}
}
[hidden] {
display: none;
}
:host(body),
:host(body) * {
@include scrollbar.custom;
}
pre {
white-space: pre-wrap;
}
// image size constraints
img:not(.mathjax) {
&:not([data-editor-shrink="false"]) {
:host-context(.shrink-image) & {
max-width: var(--editor-default-max-width);
max-height: var(--editor-default-max-height);
}
}
&[data-editor-shrink="true"] {
max-width: var(--editor-shrink-max-width);
max-height: var(--editor-shrink-max-height);
}
}