@@ -12,17 +12,6 @@ export function createAntDesignStyleContainer() {
1212 document . head . insertBefore ( template , document . head . firstChild )
1313 return template
1414}
15- /**
16- * Set the background color of the app from the admin bar background color
17- */
18- export function setAppBgFromAdminBarBg ( ) {
19- const bitAppsRootElm = select ( '#bit-apps-root' )
20- const wpAdminBarElm = select ( '#wpadminbar' )
21- if ( bitAppsRootElm && wpAdminBarElm ) {
22- bitAppsRootElm . style . backgroundColor = globalThis . getComputedStyle ( wpAdminBarElm ) ?. backgroundColor
23- }
24- }
25-
2615/**
2716 * Check if the css file is conflicting with project styles
2817 * @param cssUrl a string containing the url of the css file
@@ -33,12 +22,14 @@ export function isConflictingCSS(cssUrl: string) {
3322}
3423
3524/**
36- * Check if the css file is from the plugin
37- * @param cssUrl url of the css file
38- * @returns boolean indicating if the css file is from the plugin
25+ * Set the background color of the app from the admin bar background color
3926 */
40- function isPluginCss ( cssUrl : string ) {
41- return cssUrl . replaceAll ( window . location . host , '' ) . includes ( `${ SERVER_VARIABLES . pluginSlug } -ba-assets` )
27+ export function setAppBgFromAdminBarBg ( ) {
28+ const bitAppsRootElm = select ( '#bit-apps-root' )
29+ const wpAdminBarElm = select ( '#wpadminbar' )
30+ if ( bitAppsRootElm && wpAdminBarElm ) {
31+ bitAppsRootElm . style . backgroundColor = globalThis . getComputedStyle ( wpAdminBarElm ) ?. backgroundColor
32+ }
4233}
4334
4435/**
@@ -81,3 +72,12 @@ export function setCascadeLayerToWordpressStyles(cssLayers: string) {
8172
8273 document . head . insertBefore ( wpStyles , document . head . firstChild )
8374}
75+
76+ /**
77+ * Check if the css file is from the plugin
78+ * @param cssUrl url of the css file
79+ * @returns boolean indicating if the css file is from the plugin
80+ */
81+ function isPluginCss ( cssUrl : string ) {
82+ return cssUrl . replaceAll ( window . location . host , '' ) . includes ( `${ SERVER_VARIABLES . pluginSlug } -ba-assets` )
83+ }
0 commit comments