From ce44e271ae59bd92b4c43cb37d9e8cb285afb6fa Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Thu, 4 Mar 2021 15:52:12 +0100 Subject: [PATCH] input styles --- packages/web/public/global.css | 48 +++++++++++++++++++ .../web/src/forms/FormPasswordField.svelte | 14 ++++++ .../web/src/forms/FormPasswordFieldRaw.svelte | 34 +++++++++++++ packages/web/src/forms/FormTextField.svelte | 3 +- packages/web/src/forms/TextField.svelte | 9 +++- .../modals/ConnectionModalDriverFields.svelte | 45 +++++++++++++++++ 6 files changed, 151 insertions(+), 2 deletions(-) create mode 100644 packages/web/src/forms/FormPasswordField.svelte create mode 100644 packages/web/src/forms/FormPasswordFieldRaw.svelte diff --git a/packages/web/public/global.css b/packages/web/public/global.css index 87b922cd..05ac2642 100644 --- a/packages/web/public/global.css +++ b/packages/web/public/global.css @@ -79,3 +79,51 @@ body { box-sizing: border-box; border-radius: 4px; } + +body *::-webkit-scrollbar { + height: 0.8em; + width: 0.8em; +} +body *::-webkit-scrollbar-track { + border-radius: 1px; + background-color: var(--theme-bg-1); +} +body *::-webkit-scrollbar-corner { + border-radius: 1px; + background-color: var(--theme-bg-2); +} + +body *::-webkit-scrollbar-thumb { + border-radius: 1px; + background-color: var(--theme-bg-3); +} + +body *::-webkit-scrollbar-thumb:hover { + background-color: var(--theme-bg-4); +} + +input { + background-color: var(--theme-bg-0); + color: var(--theme-font-1); + border: 1px solid var(--theme-border); +} + +input[disabled] { + background-color: var(--theme-bg-1); +} + +select { + background-color: var(--theme-bg-0); + color: var(--theme-font-1); + border: 1px solid var(--theme-border); +} + +select[disabled] { + background-color: var(--theme-bg-1); +} + +textarea { + background-color: var(--theme-bg-0); + color: var(--theme-font-1); + border: 1px solid var(--theme-border); +} diff --git a/packages/web/src/forms/FormPasswordField.svelte b/packages/web/src/forms/FormPasswordField.svelte new file mode 100644 index 00000000..6f5e2b13 --- /dev/null +++ b/packages/web/src/forms/FormPasswordField.svelte @@ -0,0 +1,14 @@ + + + + + diff --git a/packages/web/src/forms/FormPasswordFieldRaw.svelte b/packages/web/src/forms/FormPasswordFieldRaw.svelte new file mode 100644 index 00000000..d0eca95f --- /dev/null +++ b/packages/web/src/forms/FormPasswordFieldRaw.svelte @@ -0,0 +1,34 @@ + + +
+ setFieldValue(name, e.target['value'])} + placeholder={isCrypted ? '(Password is encrypted)' : undefined} + type={isCrypted || showPassword ? 'text' : 'password'} + /> + {#if !isCrypted} + (showPassword = !showPassword)} {disabled}> + + + {/if} +
diff --git a/packages/web/src/forms/FormTextField.svelte b/packages/web/src/forms/FormTextField.svelte index 4eac349c..0e9ac3d5 100644 --- a/packages/web/src/forms/FormTextField.svelte +++ b/packages/web/src/forms/FormTextField.svelte @@ -5,10 +5,11 @@ export let label; export let name; export let templateProps = {}; + export let focused = false; const { template } = getFormContext(); - + diff --git a/packages/web/src/forms/TextField.svelte b/packages/web/src/forms/TextField.svelte index f69d17f7..3c0692a1 100644 --- a/packages/web/src/forms/TextField.svelte +++ b/packages/web/src/forms/TextField.svelte @@ -1,5 +1,12 @@ - + diff --git a/packages/web/src/modals/ConnectionModalDriverFields.svelte b/packages/web/src/modals/ConnectionModalDriverFields.svelte index d681d83e..55946900 100644 --- a/packages/web/src/modals/ConnectionModalDriverFields.svelte +++ b/packages/web/src/modals/ConnectionModalDriverFields.svelte @@ -1,4 +1,6 @@