mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-15 02:55:08 +08:00
The dark mode generation was disabled due to a bug (https://crbug.com/1185185) in the Sources Panel. The source of that bug was that the dark mode generation takes all the CSS in the source CSS file, applies the colour patching to it, prepends each rule with `.-theme-with-dark-background` and then writes the new file to disk. The problem was that any CSS overrides defined in the source file would not be applied, because the automatic CSS generated by the dark mode script would be loaded after it and therefore take precedent. The fix is to make the script smarter and recognise any overrides provided in the source CSS file, and include them in the bottom of the dark mode script, so that they are still applied and override the generated CSS. This isn't ideal, as it means we load some blocks of CSS twice, but it's better than having to manually update colours in some of our CSS files that have 50+ declarations to update. This CL doesn't re-enable the use of any of the dark mode scripts, this will be done in a follow-up. Bug: chromium:1188524 Change-Id: I03a1daa57d5535bb768696ca0d7bafc968618035 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2780804 Commit-Queue: Jack Franklin <jacktfranklin@chromium.org> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>