Skip to content

Commit

Permalink
feat: add black alpha background to handle button and increase line b…
Browse files Browse the repository at this point in the history
…ox shadow opacity
  • Loading branch information
nerdyman committed Oct 21, 2023
1 parent 554bb13 commit 4d85242
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/src/ReactCompareSliderHandle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const ReactCompareSliderHandle: FC<
width: portrait ? '100%' : 2,
backgroundColor: 'currentColor',
pointerEvents: 'auto',
boxShadow: '0 0 7px rgba(0,0,0,.35)',
boxShadow: '0 0 7px rgba(0,0,0,.5)',
...linesStyle,
};

Expand All @@ -79,6 +79,7 @@ export const ReactCompareSliderHandle: FC<
pointerEvents: 'auto',
backdropFilter: 'blur(7px)',
WebkitBackdropFilter: 'blur(7px)', // For Safari.
backgroundColor: 'rgba(0, 0, 0, 0.125)',
boxShadow: '0 0 7px rgba(0,0,0,.35)',
transform: portrait ? 'rotate(90deg)' : undefined,
...buttonStyle,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const useResizeObserver = (

// Bind/rebind observer when `handler` changes.
useIsomorphicLayoutEffect(() => {
observer.current = new ResizeObserver(([entry]) => handler(entry.contentRect));
observer.current = new ResizeObserver(([entry]) => handler(entry!.contentRect));
observe();

return (): void => {
Expand Down

0 comments on commit 4d85242

Please sign in to comment.