fix(theme): allow raw html in head style
This commit is contained in:
@@ -13,16 +13,6 @@
|
|||||||
`#${value.map((c) => c.toString(16).padStart(2, '0')).join('')}`
|
`#${value.map((c) => c.toString(16).padStart(2, '0')).join('')}`
|
||||||
);
|
);
|
||||||
|
|
||||||
let rValue = $state(value[0]);
|
|
||||||
let gValue = $state(value[1]);
|
|
||||||
let bValue = $state(value[2]);
|
|
||||||
|
|
||||||
$effect(() => {
|
|
||||||
rValue = value[0];
|
|
||||||
gValue = value[1];
|
|
||||||
bValue = value[2];
|
|
||||||
});
|
|
||||||
|
|
||||||
function handleHexInput(e: Event) {
|
function handleHexInput(e: Event) {
|
||||||
const target = e.target as HTMLInputElement;
|
const target = e.target as HTMLInputElement;
|
||||||
let val = target.value.replace(/[^0-9a-fA-F]/g, '');
|
let val = target.value.replace(/[^0-9a-fA-F]/g, '');
|
||||||
@@ -41,12 +31,6 @@
|
|||||||
] as [number, number, number];
|
] as [number, number, number];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleHexBlur() {
|
|
||||||
rValue = value[0];
|
|
||||||
gValue = value[1];
|
|
||||||
bValue = value[2];
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex overflow-hidden rounded-sm border border-outline bg-layer-2 w-min">
|
<div class="flex overflow-hidden rounded-sm border border-outline bg-layer-2 w-min">
|
||||||
@@ -69,7 +53,6 @@
|
|||||||
value={hexValue.slice(1)}
|
value={hexValue.slice(1)}
|
||||||
{id}
|
{id}
|
||||||
oninput={handleHexInput}
|
oninput={handleHexInput}
|
||||||
onblur={handleHexBlur}
|
|
||||||
maxlength={6}
|
maxlength={6}
|
||||||
class="w-15 bg-transparent text-text outline-none"
|
class="w-15 bg-transparent text-text outline-none"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -52,6 +52,7 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<svelte:head>
|
||||||
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
|
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
|
||||||
{@html themeCss}
|
{@html themeCss}
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|||||||
Reference in New Issue
Block a user