Commit Graph
18 Commits
Author SHA1 Message Date
Jack Franklin 49a9481a74 Lint color usage in background and border-* properties.
The list of CSS properties we check for colors wasn't thorough and
didn't include `border-left/right/top/bottom` or `background` on its
own. This CL fixes that and disables the rule for any current
violations.

Bug: 1152736
Change-Id: Ic732d653fdfab0462a04dc891bcece1f44e5d471
No-Presubmit: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2676157
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
2021-02-05 15:39:39 +00:00
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
Benedikt Meurer 10872bf1e4 Fix stylelint-config-standard issues in ui/textButton.css
Bug: chromium:1083142
Change-Id: I074dd6c6e064c4d235d25bdbbbc3a1b0c2be1d65
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2288692
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-07-09 11:54:49 +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 ca9fa2d73f Consistently format CSS color and opacity values
- Prefer the modern comma-free CSS color function syntax over the
  legacy syntax. [1]
- Explicitly use the `deg` suffix for angle values in colors, to
  clarify the range.
- Explicitly use the `%` suffix for percentages instead of formatting
  the value as a number, again to clarify the range.

[1]: https://twitter.com/mathias/status/1253242715304857601
[2]: https://goo.gle/devtools-css-color

Bug: chromium:1083142
Fixed: chromium:1073885
Change-Id: I8e1582a2dee3553a61df88564051ea84c2011d76
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2209091
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Mathias Bynens <mathias@chromium.org>
2020-05-19 16:50:26 +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
Livvie Lin 21ee186a36 [DevTools] Set button hover color only when text color not red
crrev.com/c/2152929 set a hover/focus color on all text buttons, but
didn't account for text colors other than blue, such as the Stop
button when Memory - Allocation Sampling is running. This CL fixes
that by only setting the hover color when the class is not .running.

Bug: 1078246
Change-Id: I71f9034e9027728c74b9d70a174493048b47fd96
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2182813
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Livvie Lin <livvielin@chromium.org>
2020-05-06 17:42:42 +00:00
Livvie Lin d3f79db3fd [DevTools] Fix -theme-preserve button color on focus/hover/active
Blue buttons were seen washed out on focus/hover/active since the
color on white buttons was set to a darker blue in crrev.com/c/2146012.
Manually set the color to white on -theme-preserve to override the
blue color CSS.

Bug: 1071313
Change-Id: I3e946f37c58748179474affff2045e7f6fef764b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2152929
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Livvie Lin <livvielin@chromium.org>
2020-04-21 16:58:47 +00:00
Livvie Lin 5056b2aa5a [DevTools] Improve Security Panel color contrast
The color contrast for the 'Reload' and 'View Certificate' text was
too low (< 4.5), so update the colors.

Bug: 1062409
Change-Id: I1753ed727d9ae3408d376e665a4c44b12da3e5cf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2146012
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Livvie Lin <livvielin@chromium.org>
2020-04-15 18:10:18 +00:00
Kham Udom 42c29073d3 High contrast in text button
Removed data-keyboard-focus attribute to fix correct focused color.

Before: https://imgur.com/a/jQDCgxg
After: https://imgur.com/a/NEaAqW3

Bug: 1048378
Change-Id: I171d0b7c6b7bba2426a3890915bb1011fbbce748
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2069799
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Kalon Hinds <kahinds@microsoft.com>
Commit-Queue: Kham Udom <khamu@microsoft.com>
2020-02-25 00:51:07 +00:00
Kham Udom 2de1869d1c High contrast pass to dropdowns, buttons and links
There are multiple changes in this patch. For the Styles panel,
the color on the the web property when focused, now changes to
HighlightText. The link is now LinkText color on rest and hover state,
but changes to HighlightText when focused.
The toolbar with drop-down, the history drop-down and search box
now have borders. The disabled text button is fixed, with the correct
background, foreground and border color. The toolbar button text has
the correct color on hover and focus.
Made another pass to remove !important

Before: https://imgur.com/a/PJRm3K0
After: https://imgur.com/a/kFUXCFp

Bug: 1048378
Change-Id: Ie33778a0129203b98c5426f2a4a58fc5ee34a568
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2063384
Commit-Queue: Kham Udom <khamu@microsoft.com>
Reviewed-by: Kalon Hinds <kahinds@microsoft.com>
2020-02-20 21:30:13 +00:00
Kham Udom 7fe34ca6d1 Add high contrast fix in Performance tools panel.
For the pie chart and its labels, it is opt-out of forced colors
on the color swatch, so we are able to distinguish the difference of
swatches, instead of seeing empty boxes. Timeline status dialog
got a border treatment and fixed text-buttons to use the correct
color values for hover and focus.
Hover, select, and focus on grid view, for Bottom-Up, Call Tree
and Event Log, is updated to correct color value.

update:
Use border-color for focus state
https://imgur.com/a/HKBMlRy


Before: https://imgur.com/a/0sD79Qy
After: https://imgur.com/a/vxsIo2m

Bug: 1048378
Change-Id: If9d89702a6eb427ab8e6d240c087fe70dc85d867
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2031069
Commit-Queue: Kham Udom <khamu@microsoft.com>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-02-13 16:27:20 +00:00
Michael Liao 3df126818a DevTools [Common - Infobar]: Make infobars keyboard accessible
Changes:
- Infobar buttons are keyboard accessible

Infobar button focus:
https://imgur.com/a/z9r8wvt

Reduced button size and added margin (current implementation):
https://imgur.com/ZElowjJ

Bug: 963183

Change-Id: Ied028e357be961cc70fde45b952ce8dbf4a7c384
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1657229
Commit-Queue: Michael Liao <michael.liao@microsoft.com>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#702653}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 46cbf4cdaa3b18d16805b9ec36a21cfaa46d88db
2019-10-04 00:33:08 +00:00
Joel Einbinder 7ff1b02818 DevTools: Remove ShadowDOM from text-button
With ShadowDOM v1, shadow roots can no longer be attached to buttons.

Bug: 685385
Change-Id: I57500c976fb3b31c43344dcaeef2140b93a38b80
Reviewed-on: https://chromium-review.googlesource.com/c/1413356
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#623963}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d58585ed08d92f075d39ea9e684fe78777700940
2019-01-18 02:28:46 +00:00
Erik Luo dc405faf4f DevTools: restore styles for UI controls
- Font inherits again for button, input, select
- Dark theme Elements tree gets blue focused selection color

Screenshot: https://imgur.com/a/hRWeVWv

Bug: 850500
Change-Id: Ia4baabbda7371b23dd2c327a6b5ea34fd6814cd5
Reviewed-on: https://chromium-review.googlesource.com/c/1405971
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#623121}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 4303dc173fc9f92911981f70a778aa1c791cb67b
2019-01-16 05:37:55 +00:00
Pavel Feldman 7ad5b27948 DevTools: follow up to the selection color update:
- don't force the icon colors on the tree outline with light selection.
- use material colors for selection and buttons.

Bug: 850500
Change-Id: Iaba73dfb6ac762b3d5b1c374e1f1e7e3664cf41d
Reviewed-on: https://chromium-review.googlesource.com/c/1399567
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#620592}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c4afae7755c91545afd726ad3d6865fd74fd7de9
2019-01-08 03:01:00 +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