Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit dfc9ae7

Browse files
devversionThomasBurleson
authored andcommitted
fix(select, input): asterisk should be always red.
Commit 024e979 added support for asterisks for the `md-select`, but also removed the red styling for the asterisk. As per specs, the asterisk should be always red, except when the input is blurred and not invalid. This commit makes the asterisk always red and makes the `md-select` asterisk consistent to the inputs. Closes #9224
1 parent ebe2a87 commit dfc9ae7

File tree

2 files changed

+32
-14
lines changed

2 files changed

+32
-14
lines changed

src/components/input/input-theme.scss

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ md-input-container.md-THEME_NAME-theme {
1414
color: '{{foreground-3}}';
1515
}
1616

17-
&.md-input-invalid {
18-
label.md-required:after {
19-
color: '{{warn-A700}}'
20-
}
17+
label.md-required:after {
18+
color: '{{warn-A700}}'
2119
}
2220

2321
&:not(.md-input-focused):not(.md-input-invalid) label.md-required:after {

src/components/select/select-theme.scss

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
11
md-input-container {
2-
&.md-input-focused {
3-
&:not(.md-input-has-value) {
4-
md-select.md-THEME_NAME-theme {
5-
.md-select-value {
6-
color: '{{primary-color}}';
7-
&.md-select-placeholder {
8-
color: '{{primary-color}}';
9-
}
10-
}
2+
3+
// The asterisk of the select should always use the warn color.
4+
md-select.md-THEME_NAME-theme .md-select-value {
5+
span:first-child:after {
6+
color: '{{warn-A700}}'
7+
}
8+
}
9+
10+
// When the select is blurred and not invalid then the asterisk should use the foreground color.
11+
&:not(.md-input-focused):not(.md-input-invalid) {
12+
md-select.md-THEME_NAME-theme .md-select-value {
13+
span:first-child:after {
14+
color: '{{foreground-3}}';
15+
}
16+
}
17+
}
18+
19+
&.md-input-focused:not(.md-input-has-value) {
20+
md-select.md-THEME_NAME-theme .md-select-value {
21+
color: '{{primary-color}}';
22+
23+
&.md-select-placeholder {
24+
color: '{{primary-color}}';
1125
}
1226
}
1327
}
@@ -22,6 +36,7 @@ md-input-container {
2236
border-bottom-color: transparent !important;
2337
}
2438
}
39+
2540
}
2641

2742
md-select.md-THEME_NAME-theme {
@@ -31,10 +46,15 @@ md-select.md-THEME_NAME-theme {
3146
background-image: -ms-linear-gradient(left, transparent 0%, '{{foreground-3}}' 100%);
3247
}
3348
.md-select-value {
49+
border-bottom-color: '{{foreground-4}}';
50+
3451
&.md-select-placeholder {
3552
color: '{{foreground-3}}';
3653
}
37-
border-bottom-color: '{{foreground-4}}';
54+
55+
span:first-child:after {
56+
color: '{{warn-A700}}'
57+
}
3858
}
3959
&.md-no-underline .md-select-value {
4060
border-bottom-color: transparent !important;

0 commit comments

Comments
 (0)