Skip to content

Commit 14a3264

Browse files
authored
feat: support icons with custom colors in select (#600)
1 parent cc2db28 commit 14a3264

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

projects/common/src/color/color.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export const enum Color {
1212
Gray5 = '#657277',
1313
Gray7 = '#272c2e',
1414
Gray9 = '#080909',
15+
Green3 = '#95EABE',
1516
Orange3 = '#FDC088',
1617
Orange5 = '#fb8b24',
1718
Purple2 = '#f2d0f5',
@@ -23,5 +24,6 @@ export const enum Color {
2324
Red3 = '#FEA395',
2425
Red5 = '#FD5138',
2526
Red6 = '#F72202',
26-
Brown1 = '#9e4c41'
27+
Brown1 = '#9e4c41',
28+
White = '#FFFFFF'
2729
}

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,16 @@
134134
align-items: center;
135135
justify-content: space-between;
136136

137+
.select-option-info {
138+
display: flex;
139+
flex-direction: row;
140+
align-items: center;
141+
142+
& > * {
143+
margin-right: 8px;
144+
}
145+
}
146+
137147
.label {
138148
padding-right: 8px;
139149
}

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,17 @@ import { SelectSize } from './select-size';
9797
class="select-option"
9898
[ngClass]="this.size"
9999
>
100-
<ht-icon *ngIf="item.icon" class="icon" [icon]="item.icon" size="${IconSize.Small}"> </ht-icon>
101-
<span class="label">{{ item.label }}</span>
100+
<div class="select-option-info">
101+
<ht-icon
102+
*ngIf="item.icon"
103+
class="icon"
104+
[icon]="item.icon"
105+
size="${IconSize.Small}"
106+
[color]="item.iconColor"
107+
>
108+
</ht-icon>
109+
<span class="label">{{ item.label }}</span>
110+
</div>
102111
<ht-icon
103112
class="status-icon"
104113
*ngIf="showSelectionStatus && this.highlightSelected && this.isSelectedItem(item)"

0 commit comments

Comments
 (0)