Commit Graph
8 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 fd9dfaa5e7 [Dark mode] replace #fff background-color
This CL searches for CSS that matches:

- background: #fff
- background: #ffffff
- background: #white
- background-color: #fff
- background-color: #ffffff
- background-color: #white

And replaces the declaration with var(--color-background) from the new
set of color variables.

Bug: 1152736
Change-Id: Ia0575ccfa4e23c92fd4f83e6c911236dbb893fea
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2577559
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-01-11 16:18:06 +00:00
Jack Franklin d1cf72489a [Dark mode]: network/RequestHTMLView.css
Bug: 1152736
Change-Id: I04d2b1cf567d45a240ff55b30cfa813326b8acd6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2567963
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
2020-12-02 12:19:03 +00:00
Mathias Bynens 42f585a5ad Fix -theme-preserve styles
Previously, many CSS rules were written as:

    -theme-preserve {
      foo: bar;
    }

Note that the selector is `-theme-preserve`, which in theory matches
any <-theme-preserve> elements — but we don’t use any such elements,
and it’s an invalid custom element name [1] anyway.

The only reason these selectors are used is to mark a CSS rule as
unaffected by DevTools theming; `_patchProperty` in `UIUtils.js` checks
if the selector contains `'-theme-'`.

stylelint-config-standard complains about this selector for good
reason, so we should use something else. A simple fix is to use a class
selector instead:

    .-theme-preserve {
      foo: bar;
    }

There is one gotcha: `-theme-preserve` gets applied as an actual class
name to some <input> elements in the memory timeline under the
Performance panel. To prevent those elements from getting all the
`-theme-preserve` styles, this patch changes the class name for that
specific case to `-theme-preserve-input`.

This works great: stylelint is now happy, and `_patchProperty` in
`UIUtils.js` still works correctly, since it only checks if the
selector contains `-theme-` anywhere.

[1]: https://mothereff.in/custom-element-name#-theme-preserve

Bug: chromium:1083142
Change-Id: I923f12de6d581e9fef71a9a58bda184e40dee796
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2252017
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2020-06-19 13:07:31 +00:00
Mathias Bynens b0c1f4bce2 Fix stylelint-config-standard violations
Bug: chromium:1083142
Change-Id: I5ea4cc5d0f83e52856383ba37a47472e33eb19a2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2204113
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Changhao Han <changhaohan@chromium.org>
Auto-Submit: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2020-05-15 17:05:27 +00:00
Joel Einbinder fc2612a359 DevTools: Network html preview should always have a white background
The iframe doesnt change colors due to dark theme, so the background
needs to stay white as well. Otherwise there is dark text on a
dark background.

Bug: 763919
Change-Id: I8a542dc613044bd8ac3d18dfccec66b65010ba0e
Reviewed-on: https://chromium-review.googlesource.com/c/1271943
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#598399}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c67340779f137602c4cb91ef5bfbaebc63226eed
2018-10-10 18:03:49 +00:00
Erik Luo 7e5bdf2677 DevTools: restore pointer events in HTML preview
- Restores pointer events (including scrolling) to HTML preview.
- Prevents accidentally focusing inputs/links inside the preview
  iframe when tabbing via keyboard.

Bug: 849204
Change-Id: Iea5dc6117decbe1d9e746139dd5974a8bfb45c62
Reviewed-on: https://chromium-review.googlesource.com/1107250
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#569093}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 122037b2541bf0932fd6fbcb29a98d487525c4ec
2018-06-20 23:54:16 +00:00
Blink Reformat 4c46d0969f The Great Blink mv for source files, part 2.
Move and rename files.

NOAUTOREVERT=true
NOPRESUBMIT=true
NOTREECHECKS=true
Bug: 768828
TBR=darin@chromium.org
NOTRY=true

Change-Id: I66d3b155808bc5bdbf237b80208e1e552bcf7f28
Reviewed-on: https://chromium-review.googlesource.com/1001153
Reviewed-by: Blink Reformat <blink-reformat@chromium.org>
Commit-Queue: Blink Reformat <blink-reformat@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#549061}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0aee4434a4dba42a42abaea9bfbc0cd196a63bc1
2018-04-07 15:32:37 +00:00