Skip to content

Commit 21ea549

Browse files
Kateryna ProkopenkoDevtools-frontend LUCI CQ
authored andcommitted
[GM3Restyling] Update non-toolbar chrome select comboboxes
Bug: 368246828 Change-Id: I183514af74784a2a5be48d0a451875be82bc7c97 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5972820 Auto-Submit: Kateryna Prokopenko <[email protected]> Commit-Queue: Kateryna Prokopenko <[email protected]> Commit-Queue: Kim-Anh Tran <[email protected]> Reviewed-by: Kim-Anh Tran <[email protected]>
1 parent a67e0c9 commit 21ea549

File tree

2 files changed

+42
-32
lines changed

2 files changed

+42
-32
lines changed

front_end/panels/network/networkConfigView.css

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,6 @@
8585
.network-config-ua .chrome-select {
8686
width: calc(100% - 20px);
8787
max-width: 250px;
88-
89-
&:disabled {
90-
opacity: unset;
91-
}
9288
}
9389

9490
.network-config-ua span[is="dt-radio"] {
@@ -97,10 +93,15 @@
9793

9894
.network-config-ua-custom {
9995
padding-bottom: 8px;
100-
opacity: 38%;
101-
pointer-events: none;
10296

103-
&.checked {
97+
input,
98+
devtools-user-agent-client-hints-form {
99+
opacity: 38%;
100+
pointer-events: none;
101+
}
102+
103+
&.checked input,
104+
&.checked devtools-user-agent-client-hints-form {
104105
opacity: revert;
105106
pointer-events: revert;
106107
}

front_end/ui/legacy/inspectorCommon.css

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -382,29 +382,33 @@ input::placeholder {
382382
.chrome-select {
383383
appearance: none;
384384
user-select: none;
385-
border: 1px solid var(--sys-color-neutral-outline);
386-
border-radius: 4px;
385+
width: var(--sys-size-22);
386+
height: var(--sys-size-11);
387+
border: var(--sys-size-1) solid var(--sys-color-neutral-outline);
388+
border-radius: var(--sys-shape-corner-extra-small);
387389
color: var(--sys-color-on-surface);
388390
font: inherit;
389391
margin: 0;
390392
outline: none;
391-
padding-right: 20px;
392-
padding-left: 6px;
393-
background-image: var(--image-file-arrow-drop-down-light);
393+
padding: 0 var(--sys-size-4) 0 var(--sys-size-5);
394+
background-image: var(--combobox-dropdown-arrow);
394395
background-color: var(--sys-color-surface);
395396
background-position: right center;
396397
background-repeat: no-repeat;
397-
min-height: 24px;
398-
min-width: 80px;
398+
399+
--combobox-dropdown-arrow: var(--image-file-arrow-drop-down-light);
399400
}
400401

401402
.chrome-select:disabled {
402-
opacity: 38%;
403+
opacity: 100%;
404+
border: var(--sys-size-1) solid transparent;
405+
color: var(--sys-color-state-disabled);
406+
background-color: var(--sys-color-state-disabled-container);
403407
}
404408

405409
.theme-with-dark-background .chrome-select,
406410
:host-context(.theme-with-dark-background) .chrome-select {
407-
background-image: var(--image-file-arrow-drop-down-dark);
411+
--combobox-dropdown-arrow: var(--image-file-arrow-drop-down-dark);
408412
}
409413

410414
.chrome-select:enabled {
@@ -416,31 +420,36 @@ input::placeholder {
416420
background-color: var(--sys-color-state-ripple-neutral-on-subtle);
417421
}
418422

423+
&:hover:active {
424+
/* stylelint-disable plugin/use_theme_colors */
425+
background:
426+
var(--combobox-dropdown-arrow),
427+
linear-gradient(var(--sys-color-state-hover-on-subtle), var(--sys-color-state-hover-on-subtle)),
428+
linear-gradient(var(--sys-color-state-ripple-neutral-on-subtle), var(--sys-color-state-ripple-neutral-on-subtle));
429+
/* stylelint-enable plugin/use_theme_colors */
430+
background-position: right center;
431+
background-repeat: no-repeat;
432+
}
433+
419434
&:focus {
420-
outline: 2px solid var(--sys-color-state-focus-ring);
421-
outline-offset: 2px;
435+
outline: var(--sys-size-2) solid var(--sys-color-state-focus-ring);
436+
outline-offset: -1px;
422437
}
423438
}
424439

425440
@media (forced-colors: active) and (prefers-color-scheme: light) {
426-
.chrome-select {
427-
background-image: var(--image-file-arrow-drop-down-light);
428-
}
429-
430-
.theme-with-dark-background .chrome-select,
431-
:host-context(.theme-with-dark-background) .chrome-select {
432-
background-image: var(--image-file-arrow-drop-down-light);
441+
:root,
442+
.theme-with-dark-background,
443+
:host-context(.theme-with-dark-background) {
444+
--combobox-dropdown-arrow: var(--image-file-arrow-drop-down-light);
433445
}
434446
}
435447

436448
@media (forced-colors: active) and (prefers-color-scheme: dark) {
437-
.chrome-select {
438-
background-image: var(--image-file-arrow-drop-down-dark);
439-
}
440-
441-
.theme-with-dark-background .chrome-select,
442-
:host-context(.theme-with-dark-background) .chrome-select {
443-
background-image: var(--image-file-arrow-drop-down-dark);
449+
:root,
450+
.theme-with-dark-background,
451+
:host-context(.theme-with-dark-background) {
452+
--combobox-dropdown-arrow: var(--image-file-arrow-drop-down-dark);
444453
}
445454
}
446455

0 commit comments

Comments
 (0)