Skip to content

Commit 32c5c7e

Browse files
fix(textarea): remove height override and fix label line-height (#1715)
We have predefined heights from the schema for all three sizes. We have also exposed a prop for textarea-height, so the line I am removing is completely unnecessary. Closes #1679, #1675 --------- Co-authored-by: Radoslav Karaivanov <[email protected]>
1 parent 2e9b2a5 commit 32c5c7e

File tree

7 files changed

+20
-16
lines changed

7 files changed

+20
-16
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,13 @@ $focused-height: calc(var-get($theme, 'size') - #{($focused-border-width * 2)});
4848
}
4949

5050
[part='label'] {
51-
@include type-style('subtitle-2');
51+
@include type-style('subtitle-2') {
52+
--ig-subtitle-2-line-height: #{rem(16px)};
53+
54+
margin-block: 0 rem(5px);
55+
};
5256

5357
color: var-get($theme, 'idle-secondary-color');
54-
margin-block-end: rem(5px);
5558
}
5659

5760
[part^='container'] {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ input:placeholder-shown + [part='notch'] [part='label'],
7272
transform 150ms cubic-bezier(0.4, 0, 0.2, 1),
7373
color 150ms cubic-bezier(0.4, 0, 0.2, 1),
7474
font-size 150ms cubic-bezier(0.4, 0, 0.2, 1);
75-
line-height: normal;
7675
text-overflow: ellipsis;
7776
overflow: hidden;
7877
will-change: font-size, color, transform;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ $theme: $bootstrap;
2121
position: static;
2222
display: block;
2323
padding: 0;
24-
line-height: rem(24px);
2524
transform: translateY(0);
2625
transform-origin: top left;
2726
margin-block: 0 rem(4px);

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,19 @@ $theme: $fluent;
5656
}
5757

5858
[part~='label'] {
59+
@include type-style('subtitle-2') {
60+
--ig-subtitle-2-line-height: #{rem(16px)};
61+
62+
margin-block: 0 rem(5px);
63+
};
64+
5965
display: block;
60-
font-size: rem(14px);
61-
font-weight: 600;
6266
position: static;
6367
transform: translateY(0);
6468
transform-origin: top left;
65-
margin-top: 0;
6669
height: auto;
67-
margin-block-end: rem(5px);
70+
71+
6872
}
6973

7074
:host([invalid]) {

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ $theme: $indigo;
7676
transition: background .25s $out-cubic;
7777
overflow: hidden;
7878
padding-inline-start: 0;
79-
height: calc(100% - #{rem(2px)});
80-
top: rem(1px);
8179

8280
&::after {
8381
content: '';

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,22 @@ textarea {
4646
}
4747

4848
%label-filled {
49+
@include type-style('caption');
50+
4951
transform: translateY(0);
5052
inset-block-start: calc(#{$input-top-padding} / 4);
51-
font-size: rem(12px);
5253
}
5354

5455
%label-outlined-filled {
56+
@include type-style('caption') {
57+
margin-block-end: auto;
58+
};
59+
5560
display: inline-block;
5661
position: relative;
5762
inset-block: 0;
5863
transform: translateY(-50%);
59-
margin-block-end: auto;
6064
padding-inline-end: 0;
61-
font-size: rem(12px);
6265
}
6366

6467
:host(:not([outlined])) {

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ $base-scale-size: (
2222

2323
[part~='label'] {
2424
@include ellipsis();
25-
26-
line-height: normal;
2725
}
2826
}
2927

@@ -69,7 +67,7 @@ textarea {
6967

7068
&:not([type='*']) {
7169
/* resets typography styles */
72-
line-height: normal;
70+
line-height: normal;
7371
}
7472
}
7573

0 commit comments

Comments
 (0)