Commit 6798107e authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'psi-dark-select2' into 'master'

Fix select2 dropdowns in dark mode

See merge request gitlab-org/gitlab!58862
parents c8a58613 2afce5a8
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
.select2-container, .select2-container,
.select2-container.select2-drop-above { .select2-container.select2-drop-above {
.select2-choice { .select2-choice {
background: $white; background: var(--white, $white);
color: $gl-text-color; color: var(--gl-text-color, $gl-text-color);
border-color: $border-color; border-color: var(--border-color, $border-color);
height: 34px; height: 34px;
padding: $gl-vert-padding $gl-input-padding; padding: $gl-vert-padding $gl-input-padding;
font-size: $gl-font-size; font-size: $gl-font-size;
...@@ -27,6 +27,10 @@ ...@@ -27,6 +27,10 @@
/* stylelint-disable-next-line function-url-quotes */ /* stylelint-disable-next-line function-url-quotes */
background: url(asset_path('chevron-down.png')) no-repeat 2px 8px; background: url(asset_path('chevron-down.png')) no-repeat 2px 8px;
.gl-dark & {
filter: invert(0.9);
}
b { b {
display: none; display: none;
} }
...@@ -37,8 +41,8 @@ ...@@ -37,8 +41,8 @@
} }
&:hover { &:hover {
border-color: $gray-darkest; border-color: var(--gray-200, $gray-200);
color: $gl-text-color; color: var(--gl-text-color, $gl-text-color);
} }
} }
...@@ -49,8 +53,8 @@ ...@@ -49,8 +53,8 @@
// .select2-focusser element instead. // .select2-focusser element instead.
&.select2-container-active:not(.select2-dropdown-open) { &.select2-container-active:not(.select2-dropdown-open) {
.select2-choice { .select2-choice {
color: $input-focus-color; color: var(--gray-700, $gray-700);
background-color: $input-focus-bg; background-color: var(--white, $white);
border-color: $input-focus-border-color; border-color: $input-focus-border-color;
outline: 0; outline: 0;
} }
...@@ -85,19 +89,19 @@ ...@@ -85,19 +89,19 @@
.select2-choices, .select2-choices,
.select2-choice { .select2-choice {
border-color: $red-500; border-color: var(--red-500, $red-500);
} }
} }
} }
.select2-drop, .select2-drop,
.select2-drop.select2-drop-above { .select2-drop.select2-drop-above {
background: $white; background: var(--white, $white);
box-shadow: 0 2px 4px $dropdown-shadow-color; box-shadow: 0 2px 4px $dropdown-shadow-color;
border-radius: $gl-border-radius-base; border-radius: $gl-border-radius-base;
border: 1px solid $border-color; border: 1px solid var(--border-color, $border-color);
min-width: 175px; min-width: 175px;
color: $gl-text-color; color: var(--gl-text-color, $gl-text-color);
z-index: 999; z-index: 999;
.modal-open & { .modal-open & {
...@@ -114,7 +118,7 @@ ...@@ -114,7 +118,7 @@
} }
.select2-drop.select2-drop-above.select2-drop-active { .select2-drop.select2-drop-above.select2-drop-active {
border-top: 1px solid $border-color; border-top: 1px solid var(--border-color, $border-color);
margin-top: -6px; margin-top: -6px;
} }
...@@ -128,7 +132,7 @@ ...@@ -128,7 +132,7 @@
.select2-dropdown-open, .select2-dropdown-open,
.select2-dropdown-open.select2-drop-above { .select2-dropdown-open.select2-drop-above {
.select2-choice { .select2-choice {
border-color: $gray-darkest; border-color: var(--border-color, $border-color);
outline: 0; outline: 0;
} }
} }
...@@ -136,7 +140,7 @@ ...@@ -136,7 +140,7 @@
.select2-container-multi { .select2-container-multi {
.select2-choices { .select2-choices {
border-radius: $border-radius-default; border-radius: $border-radius-default;
border-color: $border-color; border-color: var(--border-color, $border-color);
background: none; background: none;
.select2-search-field input { .select2-search-field input {
...@@ -149,10 +153,10 @@ ...@@ -149,10 +153,10 @@
.select2-search-choice { .select2-search-choice {
margin: 5px 0 0 8px; margin: 5px 0 0 8px;
box-shadow: none; box-shadow: none;
border-color: $border-color; border-color: var(--border-color, $border-color);
color: $gl-text-color; color: var(--gl-text-color, $gl-text-color);
line-height: 15px; line-height: 15px;
background-color: $gray-light; background-color: var(--gray-50, $gray-50);
background-image: none; background-image: none;
padding: 3px 18px 3px 5px; padding: 3px 18px 3px 5px;
...@@ -163,7 +167,7 @@ ...@@ -163,7 +167,7 @@
} }
&.select2-search-choice-focus { &.select2-search-choice-focus {
border-color: $gl-text-color; border-color: var(--gl-text-color, $gl-text-color);
} }
} }
} }
...@@ -188,22 +192,22 @@ ...@@ -188,22 +192,22 @@
input { input {
padding: $grid-size; padding: $grid-size;
background: transparent image-url('select2.png'); background: transparent image-url('select2.png');
color: $gl-text-color; color: var(--gl-text-color, $gl-text-color);
background-clip: content-box; background-clip: content-box;
background-origin: content-box; background-origin: content-box;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: right 0 bottom 0 !important; background-position: right 0 bottom 0 !important;
border: 1px solid $border-color; border: 1px solid var(--border-color, $border-color);
border-radius: $border-radius-default; border-radius: $border-radius-default;
line-height: 16px; line-height: 16px;
transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
&:focus { &:focus {
border-color: $blue-300; border-color: var(--blue-300, $blue-300);
} }
&.select2-active { &.select2-active {
background-color: $white; background-color: var(--white, $white);
background-image: image-url('select2-spinner.gif') !important; background-image: image-url('select2-spinner.gif') !important;
background-origin: content-box; background-origin: content-box;
background-repeat: no-repeat; background-repeat: no-repeat;
...@@ -236,10 +240,10 @@ ...@@ -236,10 +240,10 @@
.select2-highlighted { .select2-highlighted {
background: transparent; background: transparent;
color: $gl-text-color; color: var(--gl-text-color, $gl-text-color);
.select2-result-label { .select2-result-label {
background: $gray-darker; background: var(--gray-50, $gray-50);
} }
} }
...@@ -249,14 +253,14 @@ ...@@ -249,14 +253,14 @@
li.select2-result-with-children > .select2-result-label { li.select2-result-with-children > .select2-result-label {
font-weight: $gl-font-weight-bold; font-weight: $gl-font-weight-bold;
color: $gl-text-color; color: var(--gl-text-color, $gl-text-color);
} }
} }
.select2-highlighted { .select2-highlighted {
.group-result { .group-result {
.group-path { .group-path {
color: $gray-700; color: var(--gray-700, $gray-700);
} }
} }
} }
......
---
title: Fix select2 dropdowns in dark mode
merge_request: 58862
author:
type: fixed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment