File tree Expand file tree Collapse file tree
apps/desktop/src/renderer/src/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,30 +44,30 @@ function ColorSwatch({
4444 pickColorLabel : string ;
4545} ) {
4646 const canPickNatively = isNativeColorInputValue ( value ) ;
47+ const swatchClassName = `relative inline-flex h-[28px] w-[28px] shrink-0 overflow-hidden rounded-[var(--radius-sm)] shadow-[var(--shadow-inset-soft)] transition-transform duration-[var(--duration-faster)] ${
48+ canPickNatively
49+ ? 'cursor-pointer hover:scale-[1.04] active:scale-[var(--scale-press-down)]'
50+ : 'cursor-default'
51+ } `;
52+ const swatchFill = (
53+ < span className = "block h-full w-full" style = { { backgroundColor : value } } aria-hidden = "true" />
54+ ) ;
4755 return (
4856 < div className = "flex items-center gap-[var(--space-2)]" >
49- < label
50- className = { `relative inline-flex h-[28px] w-[28px] shrink-0 overflow-hidden rounded-[var(--radius-sm)] shadow-[var(--shadow-inset-soft)] transition-transform duration-[var(--duration-faster)] ${
51- canPickNatively
52- ? 'cursor-pointer hover:scale-[1.04] active:scale-[var(--scale-press-down)]'
53- : 'cursor-default'
54- } `}
55- >
56- < span
57- className = "block h-full w-full"
58- style = { { backgroundColor : value } }
59- aria-hidden = "true"
60- />
61- { canPickNatively ? (
57+ { canPickNatively ? (
58+ < label className = { swatchClassName } >
59+ { swatchFill }
6260 < input
6361 type = "color"
6462 value = { value }
6563 onChange = { ( e ) => onChange ( e . target . value ) }
6664 className = "absolute inset-0 cursor-pointer opacity-0"
6765 aria-label = { pickColorLabel }
6866 />
69- ) : null }
70- </ label >
67+ </ label >
68+ ) : (
69+ < div className = { swatchClassName } > { swatchFill } </ div >
70+ ) }
7171 < input
7272 type = "text"
7373 value = { value }
You can’t perform that action at this time.
0 commit comments