Add error border when rich text field fails validation

This commit is contained in:
Andrew Kingston 2022-02-03 14:08:30 +00:00
parent 51801bf2d0
commit 46ad1dc2c4
1 changed files with 27 additions and 8 deletions

View File

@ -10,11 +10,30 @@
export let fullScreenOffset = 0
</script>
<MarkdownEditor
{value}
{placeholder}
{height}
{id}
{fullScreenOffset}
on:change
/>
<div class:error>
<MarkdownEditor
{value}
{placeholder}
{height}
{id}
{fullScreenOffset}
on:change
/>
</div>
<style>
.error :global(.EasyMDEContainer .editor-toolbar) {
border-top-color: var(--spectrum-semantic-negative-color-default);
border-left-color: var(--spectrum-semantic-negative-color-default);
border-right-color: var(--spectrum-semantic-negative-color-default);
}
.error :global(.EasyMDEContainer .CodeMirror) {
border-bottom-color: var(--spectrum-semantic-negative-color-default);
border-left-color: var(--spectrum-semantic-negative-color-default);
border-right-color: var(--spectrum-semantic-negative-color-default);
}
.error :global(.EasyMDEContainer .editor-preview-side) {
border-bottom-color: var(--spectrum-semantic-negative-color-default);
border-right-color: var(--spectrum-semantic-negative-color-default);
}
</style>