Skip to content

Commit 0d250df

Browse files
committed
refactor(inputs): update invalid styles
1 parent 08b9ef1 commit 0d250df

25 files changed

+98
-225
lines changed

src/components/combo/themes/shared/combo.common.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ $dropdown-theme: dropdown-theme.$material;
5959
}
6060
}
6161

62-
:host(:not([disabled])[invalid]),
63-
:host(:not(:disabled)[invalid]) {
62+
:host(:not([disabled]):state(ig-invalid)),
63+
:host(:not(:disabled):state(ig-invalid)) {
6464
::part(helper-text) {
6565
color: var-get($theme, 'error-secondary-color');
6666
}

src/components/combo/themes/shared/combo.indigo.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ $dropdown-theme: dropdown-theme.$indigo;
9292
}
9393
}
9494

95-
:host(:not([disabled])[invalid]),
96-
:host(:not(:disabled)[invalid]) {
95+
:host(:not([disabled]):state(ig-invalid)),
96+
:host(:not(:disabled):state(ig-invalid)) {
9797
::part(helper-text) {
9898
color: var-get($input-theme, 'helper-text-color');
9999
}

src/components/combo/themes/shared/combo.material.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,8 @@ $dropdown-theme: dropdown-theme.$material;
131131
}
132132

133133
:host(:disabled[outlined]),
134-
:host([outlined][disabled]),
135-
:host([outlined][invalid]) {
134+
:host([outlined][disabled]) {
136135
igc-input::part(filled) + igc-input::part(notch) {
137136
border-top-color: transparent;
138137
}
139138
}
140-

src/components/date-picker/themes/shared/date-picker.common.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ $input-theme: input-theme.$material;
9797
}
9898
}
9999

100-
:host(:not([disabled])[invalid]),
101-
:host(:not(:disabled)[invalid]) {
100+
:host(:not([disabled],[readonly]):state(ig-invalid)),
101+
:host(:not(:disabled,[readonly]):state(ig-invalid)) {
102102
::part(helper-text) {
103103
color: var-get($theme, 'error-secondary-color');
104104
}

src/components/date-picker/themes/shared/date-picker.fluent.scss

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,6 @@ $theme: $fluent;
3737
}
3838
}
3939

40-
:host(:not([invalid])[readonly]:hover) {
41-
igc-date-time-input::part(container) {
42-
border-color: var-get($theme, 'border-color');
43-
}
44-
}
45-
46-
:host(:not([invalid])[readonly]:focus-within) {
47-
igc-date-time-input::part(container) {
48-
border-color: var-get($theme, 'focused-border-color');
49-
}
50-
}
51-
5240
:host(:disabled),
5341
:host([disabled]) {
5442
[part='label']::after {

src/components/date-picker/themes/shared/date-picker.indigo.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ $input-theme: input-theme.$indigo;
3333
}
3434
}
3535

36-
:host(:not([invalid])[readonly]) {
36+
:host([readonly]) {
3737
igc-date-time-input::part(container) {
3838
border-color: var-get($theme, 'disabled-text-color');
3939
}
4040
}
4141

42-
:host(:not([disabled])[invalid]),
43-
:host(:not(:disabled)[invalid]) {
42+
:host(:not([disabled],[readonly]):state(ig-invalid)),
43+
:host(:not(:disabled,[readonly]):state(ig-invalid)) {
4444
::part(helper-text) {
4545
color: var-get($input-theme, 'helper-text-color');
4646
}

src/components/date-picker/themes/shared/date-picker.material.scss

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
$theme: $material;
55

6-
:host(:not([invalid])[outlined][readonly]:hover) {
6+
:host([outlined][readonly]:hover) {
77
igc-date-time-input::part(start),
88
igc-date-time-input::part(end),
99
igc-date-time-input::part(filler) {
@@ -15,7 +15,7 @@ $theme: $material;
1515
}
1616
}
1717

18-
:host(:not([invalid])[outlined][readonly]) {
18+
:host([outlined][readonly]) {
1919
igc-date-time-input:focus-within {
2020
&::part(start),
2121
&::part(end),
@@ -35,7 +35,7 @@ $theme: $material;
3535
}
3636
}
3737

38-
:host(:not([outlined],[invalid])[readonly]) {
38+
:host(:not([outlined])[readonly]) {
3939
igc-date-time-input:hover {
4040
&::part(container) {
4141
border-bottom-color: var-get($theme, 'idle-bottom-line-color');
@@ -56,16 +56,3 @@ $theme: $material;
5656
}
5757
}
5858
}
59-
60-
:host(:not([outlined])[readonly][invalid]) {
61-
igc-date-time-input:hover,
62-
igc-date-time-input:focus-within {
63-
&::part(container) {
64-
border-color: var-get($theme, 'error-secondary-color');
65-
66-
&::after {
67-
border-color: var-get($theme, 'error-secondary-color');
68-
}
69-
}
70-
}
71-
}

src/components/date-range-picker/themes/shared/date-range-picker.common.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ $theme: $material;
9191
}
9292
}
9393

94-
:host(:not([disabled])[invalid]),
95-
:host(:not(:disabled)[invalid]) {
94+
:host(:not([disabled],[readonly]):state(ig-invalid)),
95+
:host(:not(:disabled,[readonly]):state(ig-invalid)) {
9696
::part(helper-text) {
9797
color: var-get($theme, 'error-secondary-color');
9898
}

src/components/file-input/themes/shared/file-input.bootstrap.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ $theme-file-input: file-input.$bootstrap;
7272
}
7373

7474

75-
:host(:not([disabled])[invalid]) {
75+
:host(:not([disabled]):state(ig-invalid)) {
7676
--input-border-color: #{var-get($theme, 'error-secondary-color')};
7777

7878
[part='prefix'],
@@ -82,7 +82,7 @@ $theme-file-input: file-input.$bootstrap;
8282
}
8383
}
8484

85-
:host(:not([disabled])[invalid]:focus-within) {
85+
:host(:not([disabled]):state(ig-invalid):focus-within) {
8686
[part~='container'] {
8787
box-shadow: 0 0 0 rem(4px) var-get($theme, 'error-shadow-color');
8888
}

src/components/file-input/themes/shared/file-input.material.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ $active-border-width: rem(2px) !default;
8282
}
8383

8484

85-
:host([outlined][invalid]),
86-
:host([outlined][invalid]:focus-within) {
85+
:host([outlined]:state(ig-invalid)),
86+
:host([outlined]:state(ig-invalid):focus-within) {
8787
[part='file-selector-button'] {
8888
border-color: var-get($theme, 'error-secondary-color');
8989
}

0 commit comments

Comments
 (0)