Skip to content

Commit 7c6a004

Browse files
committed
refactor(select): update the styles for no fill
1 parent 06e2034 commit 7c6a004

File tree

4 files changed

+53
-14
lines changed

4 files changed

+53
-14
lines changed

core/src/components/select/select.md.outline.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,3 +240,17 @@
240240
:host(.label-floating.select-fill-outline) .select-outline-notch {
241241
border-top: none;
242242
}
243+
244+
// Select Icon
245+
// ----------------------------------------------------------------
246+
247+
/**
248+
* When the select has a fill, is
249+
* in an item, and is expanded, then
250+
* the icon should take on the
251+
* highlight color.
252+
*/
253+
:host(.in-item.select-expanded.select-fill-outline) .select-wrapper .select-icon,
254+
:host(.in-item.select-expanded.ion-touched.ion-invalid.select-fill-outline) .select-wrapper .select-icon {
255+
color: var(--highlight-color);
256+
}

core/src/components/select/select.md.scss

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@
1212
--highlight-height: 2px;
1313
}
1414

15-
.select-icon {
16-
width: $select-md-icon-size;
17-
18-
transition: transform .15s cubic-bezier(.4, 0, .2, 1);
19-
20-
color: #{$text-color-step-500};
21-
}
22-
2315
// Select Label
2416
// ----------------------------------------------------------------
2517

@@ -77,6 +69,14 @@
7769
// Select Icon
7870
// ----------------------------------------------------------------
7971

72+
.select-icon {
73+
width: $select-md-icon-size;
74+
75+
transition: transform .15s cubic-bezier(.4, 0, .2, 1);
76+
77+
color: #{$select-md-icon-color};
78+
}
79+
8080
/**
8181
* This rotates the chevron icon
8282
* when the select is activated.
@@ -86,17 +86,24 @@
8686
@include transform(rotate(180deg));
8787
}
8888

89+
/**
90+
* When the select has no fill, is
91+
* in an item, and is expanded, then
92+
* the icon should be the same color
93+
* as the text color.
94+
*/
95+
:host(.in-item.select-expanded) .select-wrapper .select-icon,
96+
:host(.in-item.select-expanded.ion-touched.ion-invalid) .select-wrapper .select-icon {
97+
color: #{$select-md-icon-color};
98+
}
99+
89100
/**
90101
* When the select is focused the icon should
91-
* take on the highlight color when the select
92-
* is not in an item or when the select is in
93-
* an item and has a fill.
102+
* take on the highlight color.
94103
* The icon should also take on the highlight
95104
* color if there is a validation state.
96105
*/
97-
:host(.select-expanded:not(.in-item)) .select-wrapper .select-icon,
98-
:host(.in-item.select-expanded.select-fill-solid) .select-wrapper .select-icon,
99-
:host(.in-item.select-expanded.select-fill-outline) .select-wrapper .select-icon,
106+
:host(.select-expanded) .select-wrapper .select-icon,
100107
:host(.ion-focused.ion-valid) .select-wrapper .select-icon,
101108
:host(.ion-touched.ion-invalid) .select-wrapper .select-icon,
102109
:host(.ion-focused) .select-wrapper .select-icon {

core/src/components/select/select.md.solid.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,17 @@
8080
*/
8181
max-width: calc(100% / #{$form-control-label-stacked-scale});
8282
}
83+
84+
// Select Icon
85+
// ----------------------------------------------------------------
86+
87+
/**
88+
* When the select has a fill, is
89+
* in an item, and is expanded, then
90+
* the icon should take on the
91+
* highlight color.
92+
*/
93+
:host(.in-item.select-expanded.select-fill-solid) .select-wrapper .select-icon,
94+
:host(.in-item.select-expanded.ion-touched.ion-invalid.select-fill-solid) .select-wrapper .select-icon {
95+
color: var(--highlight-color);
96+
}

core/src/components/select/select.md.vars.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
/// @prop - Size of the select icon
88
$select-md-icon-size: dynamic-font(13px);
9+
10+
/// @prop - Color of the select icon
11+
$select-md-icon-color: $text-color-step-500;
12+
913
/// @prop - The amount of whitespace to display on either side of the floating label
1014
$select-md-floating-label-padding: 4px;
1115

0 commit comments

Comments
 (0)