@mikezimm/fps-core-v7
Version:
Library of reusable core interfaces, types and constants migrated from fps-library-v2
53 lines • 1.97 kB
JavaScript
/**
* 2024-09-07: Migrated from the same folder in fps-library-v2/common/commandStyles/...
* src\common\commandStyles\adjustCmdThemes.ts
*/
import { defaultBannerCommandStyles } from './defaults';
export function adjustCmdStyles(bannerCmdReactCSS, margin, backgroundColor, color, fontSize, padding) {
const propsCmdCSS = JSON.parse(JSON.stringify(bannerCmdReactCSS));
if (margin !== null)
propsCmdCSS.marginLeft = margin;
if (backgroundColor !== null)
propsCmdCSS.backgroundColor = backgroundColor;
if (color !== null)
propsCmdCSS.color = color;
if (fontSize !== null)
propsCmdCSS.fontSize = fontSize;
if (padding !== null)
propsCmdCSS.padding = padding;
return propsCmdCSS;
}
export function alvFMCmdStyles(bannerCmdReactCSS) {
const finalCSS = adjustCmdStyles(bannerCmdReactCSS, '0px 0px 0px 30px', 'transparent', null, '24px', null);
return finalCSS;
}
;
export function pageInfoCmdStyles(bannerCmdReactCSS) {
const finalCSS = adjustCmdStyles(bannerCmdReactCSS, '0px 0px 0px 30px', 'transparent', null, null, null);
return finalCSS;
}
;
/**
* This is used by ss7 for buttons on Code Page - white buttons, black color for gray canvas
* Just adjusts the margin on default white/black buttons
* @param bannerCmdReactCSS
* @returns
*/
export function adjustDefaultCmdMargin(margin) {
const finalCSS = adjustCmdStyles(defaultBannerCommandStyles, margin, null, null, null, null);
return finalCSS;
}
;
/**
* This is used by ss7 for creating buttons with different colors (like red and yellow)
* @param margin
* @param backgroundColor
* @param color
* @returns
*/
export function adjustDefaultCmdColorMargin(margin, backgroundColor, color) {
const finalCSS = adjustCmdStyles(defaultBannerCommandStyles, margin, backgroundColor, color, null, null);
return finalCSS;
}
;
//# sourceMappingURL=adjustCmdThemes.js.map