UNPKG

apphouse

Version:

Component library for React that uses observable state management and theme-able components.

16 lines (15 loc) 591 B
/** * helper function to apply theme main background and foreground color to the document body * @param backgroundColor string color to be applied to the background of the document body * @param foregroundColor string color to be applied to the foreground of the document body */ export function applyThemeColorsToHtmlBody( backgroundColor: string, foregroundColor: string ) { // Force update body styles with theme background and foreground colors if (document) { document.body.style.backgroundColor = backgroundColor; document.body.style.color = foregroundColor; } }