Skip to content

Commit 3fa676f

Browse files
fix(input-group): bootstrap prefix & suffix border (#1820)
* fix(inputs): bootstrap border * fix(inputs): lint errors * chore(input-group): formatting * fix(input-group): fix comments + apply padding to all prefix & suffix elements * fix(input-group): change var name --------- Co-authored-by: Simeon Simeonoff <[email protected]>
1 parent f86fd00 commit 3fa676f

File tree

18 files changed

+189
-26
lines changed

18 files changed

+189
-26
lines changed

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ $dropdown-theme: dropdown-theme.$bootstrap;
1717
grid-auto-rows: minmax(rem(20px), auto);
1818
margin-block-start: rem(4px);
1919
}
20+
21+
::slotted([slot='suffix']),
22+
::slotted([slot='prefix']) {
23+
height: 100%;
24+
display: flex;
25+
align-items: center;
26+
}
2027
}
2128

2229
[part='list-wrapper'] {
@@ -128,4 +135,25 @@ $dropdown-theme: dropdown-theme.$bootstrap;
128135
color: inherit;
129136
}
130137
}
138+
139+
::slotted([slot='suffix']),
140+
[part|='toggle'] {
141+
border-inline-end: rem(1px) solid var(--disabled-border-color);
142+
}
143+
144+
::slotted([slot='prefix']) {
145+
border-inline-start: rem(1px) solid var(--disabled-border-color);
146+
}
131147
}
148+
149+
:host(:not([disabled])),
150+
:host(:not(:disabled)) {
151+
::slotted([slot='suffix']),
152+
[part|='toggle'] {
153+
border-inline-end: rem(1px) solid var(--border-color);
154+
}
155+
156+
::slotted([slot='prefix']) {
157+
border-inline-start: rem(1px) solid var(--border-color);
158+
}
159+
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,8 @@ $dropdown-theme: dropdown-theme.$material;
9494
}
9595
}
9696
}
97+
98+
::slotted([slot='suffix']),
99+
::slotted([slot='prefix']) {
100+
padding-inline: var(--affix-padding);
101+
}

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,29 @@ $theme: $bootstrap;
5959
[part='actions'] {
6060
min-height: #{sizable(rem(47px), rem(54px), rem(64px))};
6161
}
62+
63+
:host(:not([disabled])),
64+
:host(:not(:disabled)) {
65+
::slotted([slot^='prefix-']),
66+
[part|='calendar-icon'] {
67+
border-inline-start: rem(1px) solid var(--border-color);
68+
}
69+
70+
::slotted([slot^='suffix-']),
71+
[part|='clear-icon'] {
72+
border-inline-end: rem(1px) solid var(--border-color);
73+
}
74+
}
75+
76+
:host(:disabled),
77+
:host([disabled]) {
78+
::slotted([slot^='prefix-']),
79+
[part|='calendar-icon'] {
80+
border-inline-start: rem(1px) solid var(--disabled-border-color);
81+
}
82+
83+
::slotted([slot^='suffix-']),
84+
[part|='clear-icon'] {
85+
border-inline-end: rem(1px) solid var(--disabled-border-color);
86+
}
87+
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,8 @@ igc-icon,
129129
::slotted(igc-icon) {
130130
--component-size: var(--input-size);
131131
}
132+
133+
::slotted([slot|='suffix']),
134+
::slotted([slot|='prefix']) {
135+
padding-inline: var(--affix-padding);
136+
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ $theme-file-input: file-input.$bootstrap;
8080
[part~='file-names'] {
8181
border-color: var-get($theme, 'error-secondary-color');
8282
}
83+
84+
[part~='prefixed'] ::slotted([slot='prefix']) {
85+
border-inline-start-color: var(--error-secondary-color);
86+
}
87+
88+
[part~='suffixed'] ::slotted([slot='suffix']) {
89+
border-inline-end-color: var(--error-secondary-color);
90+
}
8391
}
8492

8593
:host(:not([disabled]):state(ig-invalid):focus-within) {

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

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ $theme: $bootstrap;
1010
--input-font: #{sizable(rem(16px), rem(16px), rem(20px))};
1111
--input-border-color: #{var-get($theme, 'border-color')};
1212
--input-height: #{var-get($theme, 'size')};
13+
--affix-padding: #{pad-inline(rem(8px), rem(12px), rem(14px))};
1314

1415
::part(helper-text) {
1516
@include type-style('body-2');
@@ -18,6 +19,14 @@ $theme: $bootstrap;
1819
grid-auto-rows: minmax(rem(20px), auto);
1920
margin-block-start: rem(4px);
2021
}
22+
23+
[part='prefix'] {
24+
border-inline-start-width: 0;
25+
}
26+
27+
[part='suffix'] {
28+
border-inline-end-width: 0;
29+
}
2130
}
2231

2332
[part~='container'] {
@@ -87,7 +96,6 @@ $theme: $bootstrap;
8796
align-items: center;
8897
width: max-content;
8998
height: 100%;
90-
padding-inline: pad-inline(8px, 12px, 16px);
9199
}
92100

93101
[part='prefix'],
@@ -211,3 +219,25 @@ $theme: $bootstrap;
211219
color: var-get($theme, 'disabled-text-color');
212220
}
213221
}
222+
223+
:host(:not(:disabled, [role='combobox'])),
224+
:host(:not([disabled], [role='combobox'])) {
225+
::slotted([slot='suffix']) {
226+
border-inline-end: rem(1px) solid var(--border-color);
227+
}
228+
229+
::slotted([slot='prefix']) {
230+
border-inline-start: rem(1px) solid var(--border-color);
231+
}
232+
}
233+
234+
:host(:disabled:not([role='combobox'])),
235+
:host([disabled]:not([role='combobox'])) {
236+
::slotted([slot='suffix']) {
237+
border-inline-end: rem(1px) solid var(--disabled-border-color);
238+
}
239+
240+
::slotted([slot='prefix']) {
241+
border-inline-start: rem(1px) solid var(--disabled-border-color);
242+
}
243+
}

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,14 @@ $theme: $base;
8181
::part(helper-text) {
8282
display: grid;
8383
}
84+
85+
[name='suffix']::slotted(:is([part|='toggle'], [part|='clear'])) {
86+
padding-inline: var(--affix-padding);
87+
}
88+
89+
:host(:not([role='combobox'])) {
90+
::slotted([slot='suffix']),
91+
::slotted([slot='prefix']) {
92+
padding-inline: var(--affix-padding);
93+
}
94+
}

src/components/input/themes/shared/input.fluent.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ $theme: $fluent;
88
--input-size: var(--component-size);
99
--helper-text-top-spacer: rem(5px);
1010
--input-border-size: #{rem(1px)};
11+
--affix-padding: #{pad-inline(rem(8px), rem(12px), rem(16px))};
1112

1213
[part='prefix'],
1314
[part='suffix'] {
@@ -34,7 +35,6 @@ $theme: $fluent;
3435
align-items: center;
3536
width: max-content;
3637
height: 100%;
37-
padding-inline: pad-inline(8px, 12px, 16px);
3838
}
3939

4040
[part='prefix'] {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ $transition-duration: .25s;
1010
width: max-content;
1111
align-items: center;
1212
height: calc(100% - #{rem(1px)});
13-
padding-inline: pad-inline(2px, 4px, 6px);
1413
}
1514

1615
:host {
1716
--component-size: var(--ig-size, #{var-get($theme, 'default-size')});
1817
--input-size: var(--component-size);
1918
--input-icon: #{sizable(rem(14px), rem(16px), rem(18px))};
19+
--affix-padding: #{pad-inline(rem(2px), rem(4px), rem(6px))};
2020

2121
::slotted(igc-icon) {
2222
--size: var(--input-icon) !important;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ $fs: rem(16px) !default;
2020
align-items: center;
2121
width: max-content;
2222
height: 100%;
23-
padding-inline: pad-inline(rem(12px), rem(14px), rem(16px));
2423
}
2524

2625
:host {
2726
--component-size: var(--ig-size, #{var-get($theme, 'default-size')});
2827
--input-size: var(--component-size);
28+
--affix-padding: #{pad-inline(rem(12px), rem(14px), rem(16px))};
2929

3030
input:placeholder-shown + [part='notch'] {
3131
@extend %floated-styles;

0 commit comments

Comments
 (0)