mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 09:16:38 -04:00
Fix field margin issues
This commit is contained in:
parent
a26f7ee86b
commit
4d59d04187
2 changed files with 34 additions and 26 deletions
|
@ -85,34 +85,36 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
onDestroy(() => api?.destroy());
|
||||
</script>
|
||||
|
||||
<slot name="field-label" />
|
||||
<div class="field-container">
|
||||
<slot name="field-label" />
|
||||
|
||||
<Collapsible collapse={collapsed} let:collapsed={hidden}>
|
||||
<div
|
||||
use:elementResolve
|
||||
class="editor-field"
|
||||
on:focusin
|
||||
on:focusout
|
||||
on:mouseenter
|
||||
on:mouseleave
|
||||
{hidden}
|
||||
>
|
||||
<EditingArea
|
||||
{content}
|
||||
fontFamily={field.fontFamily}
|
||||
fontSize={field.fontSize}
|
||||
api={editingArea}
|
||||
<Collapsible collapse={collapsed} let:collapsed={hidden}>
|
||||
<div
|
||||
use:elementResolve
|
||||
class="editor-field"
|
||||
on:focusin
|
||||
on:focusout
|
||||
on:mouseenter
|
||||
on:mouseleave
|
||||
{hidden}
|
||||
>
|
||||
{#if flipInputs}
|
||||
<slot name="plain-text-input" />
|
||||
<slot name="rich-text-input" />
|
||||
{:else}
|
||||
<slot name="rich-text-input" />
|
||||
<slot name="plain-text-input" />
|
||||
{/if}
|
||||
</EditingArea>
|
||||
</div>
|
||||
</Collapsible>
|
||||
<EditingArea
|
||||
{content}
|
||||
fontFamily={field.fontFamily}
|
||||
fontSize={field.fontSize}
|
||||
api={editingArea}
|
||||
>
|
||||
{#if flipInputs}
|
||||
<slot name="plain-text-input" />
|
||||
<slot name="rich-text-input" />
|
||||
{:else}
|
||||
<slot name="rich-text-input" />
|
||||
<slot name="plain-text-input" />
|
||||
{/if}
|
||||
</EditingArea>
|
||||
</div>
|
||||
</Collapsible>
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
.editor-field {
|
||||
|
|
|
@ -12,5 +12,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-grow: 1;
|
||||
|
||||
/* replace with "gap: 5px" once it's available
|
||||
- required: Chromium 84 (Qt6 only) and iOS 14.1 */
|
||||
> :global(*) {
|
||||
margin: 5px 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in a new issue