Skip to content

Commit 9d77269

Browse files
fix: multi select icon mode style and some code refactoring
1 parent f6e3bb6 commit 9d77269

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
lines changed

projects/components/src/multi-select/multi-select.component.scss

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
border-radius: 6px;
1313
}
1414

15-
&.open {
16-
background-color: $gray-2;
17-
}
18-
1915
.multi-select-container {
2016
width: 100%;
2117
}
@@ -33,11 +29,20 @@
3329
cursor: pointer;
3430
height: 34px;
3531

32+
&.open {
33+
background-color: $gray-2;
34+
}
35+
3636
&.icon-mode {
3737
border: 1px solid transparent;
3838
border-radius: 64px;
3939
padding: 0 4px;
4040

41+
&.open {
42+
background: $blue-2;
43+
border-color: $blue-3;
44+
}
45+
4146
&:hover {
4247
color: $blue-5;
4348
background: $blue-1;
@@ -61,10 +66,10 @@
6166
margin-left: auto;
6267
}
6368
}
64-
}
6569

66-
&:hover {
67-
background-color: $gray-1;
70+
&:hover {
71+
background-color: $gray-1;
72+
}
6873
}
6974
}
7075

projects/components/src/multi-select/multi-select.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import { MultiSelectJustify } from './multi-select-justify';
4444
<div
4545
class="trigger-content"
4646
[style.justify-content]="this.justify"
47-
[ngClass]="this.triggerLabelDisplayMode"
47+
[ngClass]="[this.triggerLabelDisplayMode, this.popoverOpen ? 'open' : '']"
4848
#triggerContainer
4949
>
5050
<ht-icon *ngIf="this.icon" [icon]="this.icon" [size]="this.iconSize"> </ht-icon>

projects/components/src/select/select.component.scss

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,17 @@
9898
margin-left: auto;
9999
color: $gray-7;
100100
}
101+
102+
&:hover {
103+
background-color: $gray-1;
104+
border-radius: 6px;
105+
}
101106
}
102107

103108
.icon-only {
104109
display: flex;
105110
align-items: center;
106111

107-
&.open {
108-
background-color: transparent;
109-
}
110-
111112
.icon {
112113
padding: 6px;
113114
border: 1px solid white;
@@ -134,11 +135,6 @@
134135
color: $blue-5;
135136
}
136137
}
137-
138-
&:hover {
139-
background-color: $gray-1;
140-
border-radius: 6px;
141-
}
142138
}
143139

144140
.select-content {

projects/components/src/select/select.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ import { SelectSize } from './select-size';
6464
<div
6565
*ngSwitchCase="'${SelectTriggerDisplayMode.Icon}'"
6666
class="trigger-content icon-only"
67-
[ngClass]="[this.selected !== undefined ? 'selected' : '', this.popoverOpen ? 'open' : '']"
67+
[ngClass]="{ selected: this.selected !== undefined, open: this.popoverOpen }"
6868
>
6969
<ht-icon
7070
class="icon"

0 commit comments

Comments
 (0)