Skip to content

Commit

Permalink
boxShadow 관련 유틸 추가했다
Browse files Browse the repository at this point in the history
  • Loading branch information
healtheloper committed Nov 22, 2023
1 parent 1e01863 commit ccbd10c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/co-design-core/src/utils/boxShadow.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
interface BoxShadowObject {
radius: number;
color: string;
offsetX: number;
offsetY: number;
spread: number;
}

export const getBoxShadow = (boxShadowObject: BoxShadowObject) => {
const { radius: blur, color, offsetX, offsetY, spread } = boxShadowObject;
return `${offsetX}px ${offsetY}px ${blur}px ${spread}px ${color}`;
};
1 change: 1 addition & 0 deletions packages/co-design-core/src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from './addAlpha';
export * from './clamp';
export * from './boxShadow';
export * from './getFieldValue';
export * from './toRgba';
export * from './warning';
Expand Down

0 comments on commit ccbd10c

Please sign in to comment.