frontend: add custom background color to inputField

This commit is contained in:
Alex
2025-02-19 12:05:43 +01:00
parent 3b08e49d6f
commit afe0a0de54

View File

@@ -37,6 +37,9 @@
/** @type {boolean} */ /** @type {boolean} */
export let readonly = false; export let readonly = false;
/** @type {string} */
export let backgroundColor = '--surface0'; // New prop for background color
/** /**
* @param {Event} event - The input event * @param {Event} event - The input event
*/ */
@@ -110,7 +113,10 @@
$: selectedColor = selectedOption ? selectedOption.color : ''; $: selectedColor = selectedOption ? selectedOption.color : '';
</script> </script>
<div class="input-box {type === 'checkbox' ? 'checkbox-container' : ''}"> <div
class="input-box {type === 'checkbox' ? 'checkbox-container' : ''}"
style="background-color: var({backgroundColor});"
>
{#if type === 'checkbox'} {#if type === 'checkbox'}
<label class="form-control {readonly ? 'form-control--disabled' : ''}"> <label class="form-control {readonly ? 'form-control--disabled' : ''}">
<input <input