Commit Graph
5 Commits
Author SHA1 Message Date
Jack Franklin 8064d3ba7a Lint against non-theme-color variables
This CL turns on the use_theme_colors stylelint rule which enforces that
any colors use variables defined in our codebase.

There are many, many violations, unsurprisingly (about 1500), so for now
I have disabled every single violation. The goal of the dark mode
migration will be in part to remove all violations of this rule.

Additionally, new code going forwards should adhere to the rule and not
add the comment to disable the warning.

Bug: 1152736
Change-Id: I51372724ea51485daef3d4f75b7d3f60a7c8016f
No-Presubmit: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2671323
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-02-03 11:02:09 +00:00
Jack Franklin 13812f6305 PRESUBMIT check for dark mode stylesheets
Bug: chromium:1164945
Change-Id: Ie592e9c2e5ebcde94d2b0f080e9375e51f06419c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2662987
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-02-01 16:19:17 +00:00
Jack Franklin 40b5fb67b3 Remove python script for generating dark mode CSS
Now devtools_paths.js exists, we can use JS and remove the Python
version completely. This unblocks further work to enforce that
`.darkmode.css` files are up to date as part of a PRESUBMIT.

Bug: chromium:1164945
Change-Id: Ie9e8fa1cd5287d8e444085d7f036a4b17c99eda9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2662976
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-02-01 14:51:37 +00:00
Jack Franklin cac69b4441 [Dark mode]: generate dark styles for cmdevtools.css
Uses the new script to generate the dark mode styles for cmdevtools so save us
manually processing it. Tested by clicking around the sources panel in light and
dark mode and verifying that things look as expected.

Also fixed some bugs in the generator script to ensure we generate the
right selectors.

Bug: 1152736
Change-Id: If3491651be116033be7248e695ceab1de5f3fc5c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2593129
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-01-11 16:10:06 +00:00
Jack Franklin 81eb91a605 Script to generate dark mode stylesheets
This CL provides a script that generates a dark mode stylesheet for a
given sheet, just like the runtime color patching (in fact, it uses the
same code!).

The script loads up the given CSS file, imports `ThemeSupport`, and
patches it. It then takes the final CSS file and prefixes
`:host-context(.-theme-with-dark-background)` to each selector. We can
then load the lightmode and the dark mode stylesheet into DevTools.

This is non ideal because we end up loading two stylesheets, but the
alternative is to maintain the runtime color patching for ever, or
update all third party stylesheets to use our CSS variables, which is a
lot of work.

The script does rely on the hosted mode server running but I think this
is reasonable; it's only going to be run rarely on a few CSS files, so
we won't be running it automatically on CI or anything so we can keep
the process fairly manual.

Bug: 1152736
Change-Id: I707c53fbccb3e03c9fac6691f40df32bcdb17c1f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2587024
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-12-14 10:47:31 +00:00