More work on the layout

This commit is contained in:
Gregory Schier
2023-03-04 21:51:17 -08:00
parent 1f5e7dbaa9
commit 1ecf642181
9 changed files with 198 additions and 147 deletions

View File

@@ -1,17 +1,18 @@
.cm-wrapper {
height: 100%;
width: 100%;
position: relative;
}
@apply h-full;
.cm-wrapper .cm-editor {
@apply inset-0;
position: absolute !important;
font-size: 0.85em;
&.cm-full-height {
@apply relative;
.cm-editor {
@apply inset-0;
position: absolute !important;
}
}
}
.cm-editor {
@apply w-full block;
@apply w-full block text-[0.85rem];
&.cm-focused {
outline: none !important;

View File

@@ -11,6 +11,7 @@ import { baseExtensions, getLanguageExtension, multiLineExtensions } from './ext
import { singleLineExt } from './singleLine';
export interface EditorProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
height?: 'auto' | 'full';
contentType?: string;
autoFocus?: boolean;
valueKey?: string | number;
@@ -23,6 +24,7 @@ export interface EditorProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onCha
}
export default function Editor({
height,
contentType,
autoFocus,
placeholder,
@@ -95,6 +97,7 @@ export default function Editor({
className={classnames(
className,
'cm-wrapper text-base',
height === 'auto' ? 'cm-auto-height' : 'cm-full-height',
singleLine ? 'cm-singleline' : 'cm-multiline',
)}
{...props}