some restructuring and added a color-scheme-picker

This commit is contained in:
Chris Kruining 2024-10-28 14:15:41 +01:00
parent c02fb2d924
commit fa9264326b
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
11 changed files with 137 additions and 103 deletions

View file

@ -24,6 +24,15 @@
color: var(--text-1);
border-color: var(--text-2);
border-radius: var(--radii-s);
&:has(::spelling-error, ::grammar-error) {
border-color: var(--fail);
}
& ::spelling-error {
outline: 1px solid var(--fail);
text-decoration: yellow underline;
}
}
& .cell {

View file

@ -218,26 +218,13 @@ const TextArea: Component<{ key: string, value: string, lang: string, oninput?:
mutate();
};
createEffect(() => {
props.value;
resize();
});
const observer = new MutationObserver((e) => {
if (element()?.isConnected) {
resize();
}
});
observer.observe(document.body, { childList: true, subtree: true });
return <textarea
ref={setElement}
value={props.value}
lang={props.lang}
placeholder={props.lang}
placeholder={`${props.key} in ${props.lang}`}
name={`${props.key}:${props.lang}`}
spellcheck
spellcheck={true}
wrap="soft"
onkeyup={onKeyUp}
on:keydown={e => e.stopPropagation()}