Skip to content

Commit

Permalink
feat(color-alpha): export BACKGROUND_IMG.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jul 4, 2021
1 parent c8fc5bc commit 50a5b10
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/color-alpha/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface AlphaProps extends Omit<React.HTMLAttributes<HTMLDivElement>, '
onChange?: (newAlpha: { a: number }, offset: Interaction) => void;
}

const BACKGROUND =
export const BACKGROUND_IMG =
'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==) left center';

export default React.forwardRef<HTMLDivElement, AlphaProps>((props, ref) => {
Expand Down Expand Up @@ -70,7 +70,15 @@ export default React.forwardRef<HTMLDivElement, AlphaProps>((props, ref) => {
<div
{...other}
className={`${prefixCls} ${className || ''}`}
style={{ borderRadius: radius, ...style, position: 'relative', width, height, background: BACKGROUND }}
style={{
borderRadius: radius,
...style,
position: 'relative',
width,
height,
background: BACKGROUND_IMG,
backgroundColor: '#fff',
}}
ref={ref}
>
<div
Expand Down

0 comments on commit 50a5b10

Please sign in to comment.