Skip to content

Commit 872bbc7

Browse files
committed
refactor(input-group): textarea & combo changes
1 parent 5df020b commit 872bbc7

File tree

9 files changed

+64
-37
lines changed

9 files changed

+64
-37
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ $dropdown-theme: dropdown-theme.$bootstrap;
3232
background: var-get($dropdown-theme, 'background-color');
3333
border-radius: var-get($dropdown-theme, 'border-radius');
3434

35+
igc-input,
36+
igc-input::part(container),
37+
igc-input::part(input) {
38+
height: rem(28px);
39+
}
40+
3541
igc-input::part(container) {
3642
background: transparent;
3743
border-inline-start: 0;
@@ -67,6 +73,7 @@ $dropdown-theme: dropdown-theme.$bootstrap;
6773
[part='search-input'] {
6874
[part~='case-icon'] {
6975
border-block-end: rem(1px) solid color(gray, 400);
76+
border-inline: none;
7077
transition: border 0.15s ease-out;
7178
}
7279

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ $dropdown-theme: dropdown-theme.$indigo;
7070
}
7171

7272
[part='filter-input'] {
73-
padding: pad-inline(rem(12px));
73+
padding-inline: pad-inline(rem(8px), rem(12px), rem(12px));
74+
padding-block: pad-block(rem(12px));
7475
}
7576

7677
:host(:focus-within) {

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ $dropdown-theme: dropdown-theme.$material;
3535
background: var-get($dropdown-theme, 'background-color');
3636
border-radius: var-get($dropdown-theme, 'border-radius');
3737

38+
igc-input,
39+
igc-input::part(container),
40+
igc-input::part(input) {
41+
height: rem(38px);
42+
}
43+
3844
igc-input::part(container) {
3945
background: transparent;
4046
border-inline-start: 0;

src/components/date-range-picker/date-range-picker.base.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,8 @@
7070
}
7171

7272
igc-date-time-input {
73+
display: flex;
74+
flex-direction: column;
7375
width: 100%;
76+
min-width: 0;
7477
}

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ $theme: $bootstrap;
88

99
--component-size: var(--ig-size, #{var-get($theme, 'default-size')});
1010
--affix-padding: #{pad-inline(rem(8px), rem(10px), rem(14px))};
11+
--block-padding: #{sizable(rem(4px), rem(8px), rem(12px))};
12+
--border-width: #{rem(1px)};
13+
--textarea-height: calc((var(--ig-body-1-line-height) * 3) + var(--block-padding) + var(--border-width) * 2);
1114

1215
::part(helper-text) {
1316
@include type-style('body-2');
@@ -36,7 +39,7 @@ $theme: $bootstrap;
3639

3740
[part~='prefixed'] {
3841
[part~='prefix'] {
39-
border-block-width: rem(1px);
42+
border-block-width: var(--border-width);
4043
border-style: solid;
4144
border-color: var-get($theme, 'border-color');
4245
overflow: hidden;
@@ -65,7 +68,7 @@ $theme: $bootstrap;
6568

6669
[part~='suffixed'] {
6770
[part~='suffix'] {
68-
border-block-width: rem(1px);
71+
border-block-width: var(--border-width);
6972
border-style: solid;
7073
border-color: var-get($theme, 'border-color');
7174
overflow: hidden;
@@ -95,8 +98,8 @@ $theme: $bootstrap;
9598
textarea {
9699
@include type-style('body-1');
97100

98-
border: rem(1px) solid var-get($theme, 'border-color');
99-
padding-block: pad-block(rem(4px), rem(8px), rem(12px)) 0;
101+
border: var(--border-width) solid var-get($theme, 'border-color');
102+
padding-block: pad-block(var(--block-padding)) 0;
100103
padding-inline: pad-inline(rem(8px), rem(10px), rem(14px));
101104
border-radius: var-get($theme, 'border-border-radius');
102105
z-index: 1;
@@ -117,7 +120,7 @@ textarea {
117120
}
118121

119122
textarea {
120-
border: rem(1px) solid var-get($theme, 'focused-border-color');
123+
border: var(--border-width) solid var-get($theme, 'focused-border-color');
121124
box-shadow: 0 0 0 rem(4px) var-get($theme, 'focused-secondary-color');
122125
}
123126
}
@@ -138,7 +141,7 @@ textarea {
138141
:host(:not(:disabled,[readonly]):state(ig-invalid)),
139142
:host(:not([disabled],[readonly]):state(ig-invalid)) {
140143
textarea {
141-
border: rem(1px) solid var-get($theme, 'error-secondary-color');
144+
border: var(--border-width) solid var-get($theme, 'error-secondary-color');
142145
}
143146
}
144147

@@ -159,7 +162,7 @@ textarea {
159162

160163
textarea {
161164
background: var-get($theme, 'border-disabled-background');
162-
border: rem(1px) solid var-get($theme, 'disabled-border-color');
165+
border: var(--border-width) solid var-get($theme, 'disabled-border-color');
163166
box-shadow: none;
164167
}
165168

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ $border-size: rem(1px);
1010
--component-size: var(--ig-size, #{var-get($theme, 'default-size')});
1111
--textarea-border-size: #{rem(1px)};
1212
--affix-padding: #{pad-inline(rem(8px), rem(10px), rem(14px))};
13+
--block-padding: #{sizable(rem(6px), rem(10px), rem(14px))};
14+
--textarea-height: calc((var(--ig-body-2-line-height) * 3) + var(--block-padding));
1315

1416
::part(helper-text) {
1517
grid-auto-rows: minmax(rem(18px), auto);
@@ -80,7 +82,7 @@ textarea {
8082
@include type-style('body-2');
8183

8284
padding-inline: pad-inline(rem(8px));
83-
padding-block: pad-block(rem(6px), rem(10px), rem(14px)) 0;
85+
padding-block: pad-block(var(--block-padding)) 0;
8486
}
8587

8688
:host([required]:not(:disabled)),

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ $theme: $indigo;
1010
--component-size: var(--ig-size, #{var-get($theme, 'default-size')});
1111
--input-icon: #{sizable(rem(14px), rem(16px), rem(16px))};
1212
--affix-padding: #{pad-inline(rem(2px), rem(4px), rem(6px))};
13+
--block-padding: #{sizable(rem(4px), rem(6px), rem(8px))};
14+
--textarea-height: calc((var(--ig-body-2-line-height) * 3) + var(--block-padding));
1315

1416
::slotted(igc-icon) {
1517
--size: var(--input-icon) !important;
@@ -88,7 +90,7 @@ $theme: $indigo;
8890
textarea {
8991
@include type-style('body-2');
9092

91-
padding-block: pad-block(rem(4px), rem(6px), rem(8px)) 0;
93+
padding-block: pad-block(var(--block-padding)) 0;
9294
padding-inline: pad-inline(rem(2px), rem(4px), rem(6px));
9395
margin-block-end: pad-block(rem(1px));
9496

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

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,44 @@
33
@use 'igniteui-theming/sass/animations/easings' as *;
44

55
$theme: $material;
6-
$input-top-padding: pad-block(rem(8px), rem(12px), rem(16px));
76
$input-bottom-padding: rem(6px);
87

98
:host {
109
@include type-style('subtitle-1');
1110

1211
--component-size: var(--ig-size, #{var-get($theme, 'default-size')});
1312
--affix-padding: #{pad-inline(rem(12px), rem(14px), rem(16px))};
13+
--outlined-top-padding: #{sizable(rem(8px), rem(12px), rem(16px))};
14+
--textarea-height: calc((var(--ig-subtitle-1-line-height) * 3) + var(--outlined-top-padding));
1415

1516
::part(helper-text) {
1617
grid-auto-rows: minmax(rem(18px), auto);
1718
padding-inline: pad-inline(rem(12px), rem(14px), rem(16px));
1819
}
20+
21+
[part~='container'] {
22+
--textarea-height: calc((var(--ig-subtitle-1-line-height) * 3));
23+
}
1924
}
2025

2126
textarea {
2227
border: none;
2328
padding: 0;
2429
overflow: auto;
25-
margin-block-start: $input-top-padding;
30+
margin-block-start: pad-block(var(--outlined-top-padding));
2631
grid-area: 1 / 2 / span 1 / span 2;
2732
flex-grow: 1;
2833
position: relative;
2934
max-width: inherit;
35+
min-height: var(--textarea-height);
3036
padding-inline: pad-inline(rem(4px));
3137
z-index: 1;
3238
}
3339

3440
[part='label'] {
35-
position: absolute;
41+
position: relative;
3642
transform-origin: top left;
37-
inset-block-start: calc($input-top-padding - #{rem(2px)});
43+
inset-block-start: calc((var(--outlined-top-padding)) - #{rem(2px)});
3844
padding-inline-end: pad-inline(rem(4px));
3945
transition:
4046
transform 150ms cubic-bezier(.4, 0, .2, 1),
@@ -47,7 +53,7 @@ textarea {
4753
@include type-style('caption');
4854

4955
translate: 0;
50-
inset-block-start: calc(#{$input-top-padding} / 4);
56+
inset-block-start: calc((var(--outlined-top-padding)) / 4);
5157
}
5258

5359
%label-outlined-filled {
@@ -64,6 +70,8 @@ textarea {
6470

6571
:host(:not([outlined])) {
6672
[part~='container'] {
73+
--box-bottom-padding: #{rem(2px)};
74+
6775
overflow: hidden;
6876
border-start-start-radius: var-get($theme, 'box-border-radius');
6977
border-start-end-radius: var-get($theme, 'box-border-radius');
@@ -80,13 +88,27 @@ textarea {
8088
}
8189

8290
textarea {
83-
margin-block: pad-block(rem(8px), rem(12px), rem(16px)) rem(2px);
91+
margin-block: pad-block(var(--box-top-padding)) var(--box-bottom-padding);
92+
min-height: var(--textarea-height);
93+
}
94+
}
95+
96+
[part~='container']:not([part~='labelled']) {
97+
--box-top-padding: #{sizable(rem(8px), rem(12px), rem(16px))};
98+
--textarea-height: #{calc(rem(80px) + var(--box-top-padding))};
99+
100+
101+
textarea {
102+
--textarea-height: #{calc(rem(80px) - var(--box-bottom-padding))};
84103
}
85104
}
86105

87106
[part~='labelled'] {
107+
--box-top-padding: #{sizable(rem(16px), rem(20px), rem(24px))};
108+
--textarea-height: #{calc((var(--ig-subtitle-1-line-height) * 3) + var(--box-top-padding))};
109+
88110
textarea {
89-
margin-block: pad-block(rem(16px), rem(20px), rem(24px)) rem(2px);
111+
--textarea-height: #{calc((var(--ig-subtitle-1-line-height) * 3) - var(--box-bottom-padding))};
90112
}
91113
}
92114

@@ -379,7 +401,7 @@ textarea {
379401

380402
:host([readonly][outlined]:focus-within) {
381403
[part='label'] {
382-
inset-block-start: calc($input-top-padding - #{rem(3px)});
404+
inset-block-start: calc(var(--outlined-top-padding) - #{rem(3px)});
383405
}
384406

385407
[part='notch'] {

src/components/textarea/themes/textarea.base.scss

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,7 @@
33
@use 'styles/utilities' as *;
44
@use 'igniteui-theming/sass/animations/easings' as *;
55

6-
$base-scale-size: (
7-
'large': rem(16px),
8-
'medium': rem(19px),
9-
'small': rem(22px)
10-
);
11-
126
:host {
13-
--textarea-height: #{sizable(
14-
rem(82px, map.get($base-scale-size, 'small')),
15-
rem(82px, map.get($base-scale-size, 'medium')),
16-
rem(82px, map.get($base-scale-size, 'large'))
17-
)};
187
--component-size: var(--ig-size, var(--ig-size-large));
198

209
display: block;
@@ -62,18 +51,10 @@ textarea {
6251
overflow: auto;
6352
text-overflow: ellipsis;
6453

65-
/* resets typography styles */
66-
line-height: normal;
67-
6854
&::placeholder {
6955
opacity: 1;
7056
line-height: normal;
7157
}
72-
73-
&:not([type='*']) {
74-
/* resets typography styles */
75-
line-height: normal;
76-
}
7758
}
7859

7960
%prefix,

0 commit comments

Comments
 (0)