20
common/resources/client/background-selector/css-props-from-bg-config.ts
Executable file
20
common/resources/client/background-selector/css-props-from-bg-config.ts
Executable file
@@ -0,0 +1,20 @@
|
||||
import {
|
||||
BackgroundSelectorConfig,
|
||||
EditableBackgroundProps,
|
||||
} from './background-selector-config';
|
||||
|
||||
export function cssPropsFromBgConfig(
|
||||
bgConfig?: Partial<BackgroundSelectorConfig>,
|
||||
): EditableBackgroundProps | undefined {
|
||||
if (bgConfig) {
|
||||
return {
|
||||
backgroundImage: bgConfig.backgroundImage,
|
||||
backgroundColor: bgConfig.backgroundColor,
|
||||
backgroundAttachment: bgConfig.backgroundAttachment,
|
||||
backgroundSize: bgConfig.backgroundSize,
|
||||
backgroundRepeat: bgConfig.backgroundRepeat,
|
||||
backgroundPosition: bgConfig.backgroundPosition,
|
||||
color: bgConfig.color,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user