create-next-app-template
Version:
This is a template set up to create Next.js App with fast speed and high performance<br/> The current template is provided in a **page routing** structure.<br/>
18 lines (14 loc) • 520 B
text/typescript
import { BackgroundType } from '../types/piece/BackgroundType';
const backgroundStylesProps = (props?: BackgroundType) => {
if (!props) return {};
return {
backgroundColor: props.fill,
backgroundRepeat: props.repeat,
backgroundSize: props.size,
backgroundPosition: props.position,
backgroundImage: props?.imageUrl ? `url(${props?.imageUrl})` : undefined,
backgroundClip: props.clip,
filter: !!props.blur ? `blur(${props.blur}px)` : undefined,
};
};
export { backgroundStylesProps };