Migrates theme patching to top-level ThemeSupport
This CL replaces all uses of self.UI.themeSupport with an instance
function from the top level theme_support directory. It also dupes in
some of the functionality from ui/utils to prevent a circular dependency
between ui/utils and theme_support.
Change-Id: Ib8efd06630b99ee23af04ecba0dbf3cc4b19c036
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2352711
Commit-Queue: Paul Lewis <[email protected]>
Reviewed-by: Jack Franklin <[email protected]>
diff --git a/front_end/ui/utils/append-style.js b/front_end/ui/utils/append-style.js
index 11ead59..c9c5ff9 100644
--- a/front_end/ui/utils/append-style.js
+++ b/front_end/ui/utils/append-style.js
@@ -5,6 +5,8 @@
// @ts-nocheck
// TODO(crbug.com/1011811): Enable TypeScript compiler checks
+import * as ThemeSupport from '../../theme_support/theme_support.js';
+
/**
* @param {!Node} node
* @param {string} cssFile
@@ -19,7 +21,7 @@
styleElement.textContent = content;
node.appendChild(styleElement);
- const themeStyleSheet = self.UI.themeSupport.themeStyleSheet(cssFile, content);
+ const themeStyleSheet = ThemeSupport.ThemeSupport.instance().themeStyleSheet(cssFile, content);
if (themeStyleSheet) {
styleElement = createElement('style');
styleElement.textContent = themeStyleSheet + '\n' + Root.Runtime.resolveSourceURL(cssFile + '.theme');