diff --git a/app.config.ts b/app.config.ts index 329c488..d5e271a 100644 --- a/app.config.ts +++ b/app.config.ts @@ -23,6 +23,11 @@ export default defineConfig({ navigateFallback: 'index.html', }, }), - ] - } + ], + }, + solid: { + babel: { + compact: true, + }, + }, }); diff --git a/src/app.css b/src/app.css index b232fd7..4ece343 100644 --- a/src/app.css +++ b/src/app.css @@ -1,22 +1,22 @@ @import url("https://fonts.googleapis.com/css2?family=Roboto+Flex:opsz,wght,GRAD@8..144,400,45;8..144,400,50;8..144,1000,0&family=Roboto+Serif:opsz,GRAD@8..144,71&display=swap"); :root { - --surface-1: #ddd; - --surface-2: #e8e8e8; - --surface-3: #eee; - --surface-4: #f8f8f8; - --surface-5: #fff; - --text-1: #222; - --text-2: #282828; - --primary: #41c6b3; + --surface-1: light-dark(#ddd, #222); + --surface-2: light-dark(#e8e8e8, #282828); + --surface-3: light-dark(#eee, #333); + --surface-4: light-dark(#f8f8f8, #383838); + --surface-5: light-dark(#fff, #444); + --text-1: light-dark(#222, #eee); + --text-2: light-dark(#282828, #d8d8d8); + --primary: light-dark(#41c6b3, #6be8d6); color: var(--text-1); accent-color: var(--primary); - --info: oklch(.71 .17 249); - --fail: oklch(.64 .21 25.3); - --warn: oklch(.82 .18 78.9); - --succ: oklch(.86 .28 150); + --info: light-dark(oklch(.71 .17 249), oklch(.71 .17 249)); + --fail: light-dark(oklch(.64 .21 25.3), oklch(.64 .21 25.3)); + --warn: light-dark(oklch(.82 .18 78.9), oklch(.82 .18 78.9)); + --succ: light-dark(oklch(.86 .28 150), oklch(.86 .28 150)); --radii-s: .125em; --radii-m: .25em; @@ -33,25 +33,6 @@ --padding-l: 1em; } -@media (prefers-color-scheme: dark) { - :root { - --surface-1: #222; - --surface-2: #282828; - --surface-3: #333; - --surface-4: #383838; - --surface-5: #444; - --text-1: #eee; - --text-2: #d8d8d8; - - --primary: #6be8d6; - - --info: oklch(.71 .17 249); - --fail: oklch(.64 .21 25.3); - --warn: oklch(.82 .18 78.9); - --succ: oklch(.86 .28 150); - } -} - html { inline-size: 100%; block-size: 100%; @@ -80,40 +61,6 @@ body { outline: 1px solid var(--info); } } - - & .menu-root { - display: grid; - grid-auto-flow: column; - justify-content: start; - position: relative; - z-index: 10; - - gap: .5em; - padding-inline-start: 1em; - block-size: 2em; - - background-color: var(--surface-3); - color: var(--text-1); - - & > .logo { - inline-size: 3em; - block-size: 3em; - padding: .75em; - margin-block-end: -1em; - background-color: inherit; - color: inherit; - border-radius: .25em; - - & > svg { - inline-size: 100%; - block-size: 100%; - } - } - - & > div { - display: contents; - } - } } a { diff --git a/src/components/colorschemepicker.module.css b/src/components/colorschemepicker.module.css new file mode 100644 index 0000000..f9af56f --- /dev/null +++ b/src/components/colorschemepicker.module.css @@ -0,0 +1,4 @@ +.picker { + border: none; + background-color: var(--surface-3); +} \ No newline at end of file diff --git a/src/components/colorschemepicker.tsx b/src/components/colorschemepicker.tsx new file mode 100644 index 0000000..66ff9ee --- /dev/null +++ b/src/components/colorschemepicker.tsx @@ -0,0 +1,43 @@ +import { Accessor, Component, createEffect, createSignal, For, Setter } from "solid-js"; +import css from './colorschemepicker.module.css'; + +export enum ColorScheme { + Auto = 'light dark', + Light = 'light', + Dark = 'dark', +} + +const colorSchemeEntries = [ + [ColorScheme.Auto, 'Auto'], + [ColorScheme.Light, 'Light'], + [ColorScheme.Dark, 'Dark'], +] as const; + +interface ColorSchemePickerProps { + value?: Setter | [Accessor, Setter]; +} + +export const ColorSchemePicker: Component = (props) => { + const [value, setValue] = createSignal(ColorScheme.Auto); + + createEffect(() => { + const currentValue = value(); + const setter = props.value instanceof Array ? props.value[1] : props.value; + + if (!setter) { + return; + } + + setter(currentValue); + }); + + return ; +}; \ No newline at end of file diff --git a/src/components/tabs.module.css b/src/components/tabs.module.css index eb97eb3..94ee47a 100644 --- a/src/components/tabs.module.css +++ b/src/components/tabs.module.css @@ -19,6 +19,7 @@ color: var(--text-2); padding: var(--padding-m) var(--padding-l); border: none; + cursor: pointer; &.active { background-color: var(--surface-3); diff --git a/src/features/file/grid.module.css b/src/features/file/grid.module.css index 553c24a..2f3ab9f 100644 --- a/src/features/file/grid.module.css +++ b/src/features/file/grid.module.css @@ -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 { diff --git a/src/features/file/grid.tsx b/src/features/file/grid.tsx index 6a3f709..bba478e 100644 --- a/src/features/file/grid.tsx +++ b/src/features/file/grid.tsx @@ -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