mirror of
https://github.com/directus/directus.git
synced 2026-01-29 19:08:06 -05:00
fix color interface showing black color when empty (#12445)
* fix color interface showing black color when empty * Default interface value to null Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
This commit is contained in:
@@ -168,7 +168,7 @@ const { t } = useI18n();
|
||||
|
||||
interface Props {
|
||||
disabled?: boolean;
|
||||
value?: string;
|
||||
value?: string | null;
|
||||
placeholder?: string;
|
||||
presets?: { name: string; color: string }[];
|
||||
width: string;
|
||||
@@ -177,7 +177,7 @@ interface Props {
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
disabled: false,
|
||||
value: undefined,
|
||||
value: () => null,
|
||||
placeholder: undefined,
|
||||
opacity: false,
|
||||
presets: () => [
|
||||
@@ -223,6 +223,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
const emit = defineEmits(['input']);
|
||||
|
||||
const valueWithoutVariables = computed(() => {
|
||||
if (!props.value) return null;
|
||||
return props.value?.startsWith('var(--') ? cssVar(props.value.substring(4, props.value.length - 1)) : props.value;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user