Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,6 @@ function ThemeButton(props: { theme: ThemeWithName }): JSXElement {
}

function Picker(props: { color: ColorName }): JSXElement {
let colorInputRef: HTMLInputElement | undefined = undefined;

const text = () => {
if (props.color === "bg") return "background";
if (props.color === "main") return "main";
Expand Down Expand Up @@ -583,13 +581,12 @@ function Picker(props: { color: ColorName }): JSXElement {
updateThemeColor(props.color, value);
}}
/>
<div class="grid">
<div class="relative">
<input
ref={(el) => (colorInputRef = el)}
type="color"
value={getTheme()[props.color]}
onInput={debouncedInput}
class="pointer-events-none col-[1/1] row-[1/1] m-0 h-full w-0 p-0 opacity-0"
class="peer pointer-events-auto absolute inset-0 z-10 h-full w-full cursor-pointer opacity-0"
// onChange={(e) => {
// const current = [...getConfig.customThemeColors];
// current[colorIndex()] = e.currentTarget.value;
Expand All @@ -601,17 +598,15 @@ function Picker(props: { color: ColorName }): JSXElement {
/>
<Button
class={cn(
`col-[1/1] row-[1/1]`,
`bg-(--picker-${props.color}) text-(--picker-bg)`,
`hover:bg-(--picker-text)`,
`peer-hover:bg-(--picker-text)`,
props.color === "bg" && "bg-(--picker-subAlt) text-(--picker-text)",
props.color === "subAlt" && "text-(--picker-text)",
)}
fa={{
icon: "fa-palette",
fixedWidth: true,
}}
onClick={() => colorInputRef?.click()}
/>
</div>
</div>
Expand Down
Loading