Don't patch CSS variables for dark mode

The logic for translating colors automatically to dark mode
was patching variables names, e.g. it was patching
  color: var(--issue-gray);
to
  color: var(--issue-rgb(127 127 127));

This CL prevents this. As a follow-up, it would probably be good
to fix the regexps in Color.js, but let's fix one thing after
another.

Bug:chromium:1122511
Change-Id: Iba3598cd21224a0cf59c70a7b373f30fe46f4cc2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2390622
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
This commit is contained in:
Sigurd Schneider
2020-09-02 16:26:30 +00:00
committed by Commit Bot
parent 132b4bab67
commit 9eb483fcb1
+5
View File
@@ -1888,6 +1888,11 @@ export class ThemeSupport {
return;
}
// Don't operate on CSS variables.
if (/^var\(.*\)$/.test(value)) {
return;
}
if (selectorText.indexOf('-theme-') !== -1) {
return;
}